/* ============================================================
   ADMIN DASHBOARD - Sistem Informasi MWC NU
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --admin-sidebar-width: 260px;
    --admin-sidebar-collapsed: 70px;
    --admin-header-height: 60px;
    --admin-primary: #1b5e20;
    --admin-primary-light: #2e7d32;
    --admin-primary-dark: #0d3311;
    --admin-bg: #f0f2f5;
    --admin-card-bg: #ffffff;
    --admin-text: #343a40;
    --admin-text-muted: #868e96;
    --admin-border: #e9ecef;
    --admin-gradient: linear-gradient(135deg, #1b5e20 0%, #2e7d32 100%);
}

/* ---- Admin Body ---- */
body.admin-body {
    font-family: 'Inter', sans-serif;
    background: var(--admin-bg);
    color: var(--admin-text);
    overflow-x: hidden;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--admin-sidebar-width);
    height: 100vh;
    background: var(--admin-gradient);
    color: #fff;
    z-index: 1000;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.admin-sidebar::-webkit-scrollbar {
    width: 4px;
}

.admin-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.admin-sidebar.collapsed {
    width: var(--admin-sidebar-collapsed);
}

/* Sidebar Header */
.sidebar-header {
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    min-height: 70px;
}

.sidebar-header img {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.sidebar-header .sidebar-brand {
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.2s ease;
}

.collapsed .sidebar-brand {
    opacity: 0;
    width: 0;
}

.sidebar-brand h5 {
    font-weight: 800;
    font-size: 1rem;
    margin: 0;
    line-height: 1.2;
}

.sidebar-brand small {
    font-size: 0.65rem;
    opacity: 0.7;
}

/* Sidebar Menu */
.sidebar-menu {
    padding: 0.75rem 0;
    flex: 1;
}

.sidebar-menu .menu-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.4);
    padding: 1rem 1.25rem 0.5rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
}

.collapsed .menu-label {
    text-align: center;
    padding: 1rem 0.5rem 0.5rem;
    font-size: 0;
}

.collapsed .menu-label::after {
    content: '•••';
    font-size: 0.7rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.25rem;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
    border-left: 3px solid transparent;
    margin: 1px 0;
}

.sidebar-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border-left-color: rgba(255, 255, 255, 0.5);
}

.sidebar-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    border-left-color: #fbc02d;
}

.sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.sidebar-link .link-text {
    overflow: hidden;
    transition: opacity 0.2s ease;
}

.collapsed .sidebar-link {
    justify-content: center;
    padding: 0.7rem;
}

.collapsed .sidebar-link .link-text,
.collapsed .sidebar-link .badge {
    display: none;
}

/* Sidebar submenu */
.sidebar-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(0, 0, 0, 0.1);
}

.sidebar-submenu.show {
    max-height: 500px;
}

.sidebar-submenu .sidebar-link {
    padding-left: 3rem;
    font-size: 0.8rem;
}

.sidebar-link .arrow {
    margin-left: auto;
    font-size: 0.65rem;
    transition: transform 0.2s ease;
}

.sidebar-link.expanded .arrow {
    transform: rotate(90deg);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.collapsed .sidebar-footer {
    padding: 0.75rem 0.5rem;
    text-align: center;
}

/* ============================================================
   ADMIN HEADER / NAVBAR
   ============================================================ */
.admin-header {
    position: fixed;
    top: 0;
    left: var(--admin-sidebar-width);
    right: 0;
    height: var(--admin-header-height);
    background: var(--admin-card-bg);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-collapsed .admin-header {
    left: var(--admin-sidebar-collapsed);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

#sidebarToggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--admin-text);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

#sidebarToggle:hover {
    background: var(--admin-bg);
    color: var(--admin-primary);
}

.header-search {
    position: relative;
}

.header-search input {
    width: 280px;
    padding: 0.5rem 1rem 0.5rem 2.25rem;
    border: 1px solid var(--admin-border);
    border-radius: 2rem;
    font-size: 0.85rem;
    background: var(--admin-bg);
    transition: all 0.2s;
}

.header-search input:focus {
    outline: none;
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(27, 94, 32, 0.1);
    width: 320px;
}

.header-search i {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--admin-text-muted);
    font-size: 0.85rem;
}

/* Notification Bell */
.notification-bell {
    position: relative;
    background: none;
    border: none;
    font-size: 1.15rem;
    color: var(--admin-text-muted);
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.notification-bell:hover {
    background: var(--admin-bg);
    color: var(--admin-primary);
}

.notification-bell .badge {
    position: absolute;
    top: 0;
    right: -2px;
    font-size: 0.6rem;
    padding: 0.2rem 0.4rem;
    border-radius: 1rem;
    background: #c62828;
    color: #fff;
}

/* User Dropdown */
.user-dropdown .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 2rem;
    transition: background 0.2s;
}

.user-dropdown .dropdown-toggle:hover {
    background: var(--admin-bg);
}

.user-dropdown .dropdown-toggle::after {
    display: none;
}

.user-dropdown .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--admin-primary);
}

.user-dropdown .user-avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--admin-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.user-dropdown .user-info {
    text-align: left;
    line-height: 1.2;
}

.user-dropdown .user-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--admin-text);
}

.user-dropdown .user-role {
    font-size: 0.7rem;
    color: var(--admin-text-muted);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.admin-content {
    margin-left: var(--admin-sidebar-width);
    margin-top: var(--admin-header-height);
    padding: 1.5rem;
    min-height: calc(100vh - var(--admin-header-height));
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-collapsed .admin-content {
    margin-left: var(--admin-sidebar-collapsed);
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--admin-text);
    margin: 0;
}

.page-header .breadcrumb {
    margin: 0;
    background: transparent;
    padding: 0;
    font-size: 0.8rem;
}

.page-header .breadcrumb-item a {
    color: var(--admin-primary);
}

/* ============================================================
   DASHBOARD CARDS
   ============================================================ */
.stat-widget {
    background: var(--admin-card-bg);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s ease;
    border: 1px solid var(--admin-border);
    position: relative;
    overflow: hidden;
}

.stat-widget:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.stat-widget::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100%;
    opacity: 0.05;
    border-radius: 0 0.75rem 0.75rem 0;
}

.stat-widget .stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #fff;
    flex-shrink: 0;
}

.stat-widget .stat-icon.bg-green { background: linear-gradient(135deg, #2e7d32, #43a047); }
.stat-widget .stat-icon.bg-blue { background: linear-gradient(135deg, #1565c0, #1e88e5); }
.stat-widget .stat-icon.bg-orange { background: linear-gradient(135deg, #e65100, #f57c00); }
.stat-widget .stat-icon.bg-purple { background: linear-gradient(135deg, #6a1b9a, #8e24aa); }
.stat-widget .stat-icon.bg-teal { background: linear-gradient(135deg, #00695c, #00897b); }
.stat-widget .stat-icon.bg-red { background: linear-gradient(135deg, #c62828, #e53935); }
.stat-widget .stat-icon.bg-amber { background: linear-gradient(135deg, #f57f17, #fbc02d); }
.stat-widget .stat-icon.bg-indigo { background: linear-gradient(135deg, #283593, #3f51b5); }

.stat-widget .stat-details {
    flex: 1;
}

.stat-widget .stat-number {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.15rem;
    color: var(--admin-text);
}

.stat-widget .stat-label {
    font-size: 0.75rem;
    color: var(--admin-text-muted);
    font-weight: 500;
}

.stat-widget .stat-change {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
    margin-top: 0.25rem;
    display: inline-block;
}

.stat-change.up { color: #2e7d32; background: rgba(46, 125, 50, 0.1); }
.stat-change.down { color: #c62828; background: rgba(198, 40, 40, 0.1); }

/* ============================================================
   ADMIN CARDS & PANELS
   ============================================================ */
.admin-card {
    background: var(--admin-card-bg);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--admin-border);
    margin-bottom: 1.5rem;
}

.admin-card .card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--admin-border);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-card .card-header h5 {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
    color: var(--admin-text);
}

.admin-card .card-body {
    padding: 1.5rem;
}

.admin-card .card-footer {
    padding: 0.75rem 1.5rem;
    border-top: 1px solid var(--admin-border);
    background: var(--admin-bg);
    border-radius: 0 0 0.75rem 0.75rem;
}

/* ============================================================
   ADMIN TABLE
   ============================================================ */
.admin-table {
    width: 100%;
    font-size: 0.85rem;
}

.admin-table thead th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--admin-text-muted);
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--admin-border);
    white-space: nowrap;
}

.admin-table tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--admin-border);
    vertical-align: middle;
}

.admin-table tbody tr:hover {
    background: rgba(27, 94, 32, 0.02);
}

/* Status Badges */
.status-badge {
    padding: 0.25rem 0.65rem;
    border-radius: 2rem;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-badge.published { background: rgba(46, 125, 50, 0.1); color: #2e7d32; }
.status-badge.published::before { background: #2e7d32; }
.status-badge.draft { background: rgba(134, 142, 150, 0.1); color: #868e96; }
.status-badge.draft::before { background: #868e96; }
.status-badge.pending { background: rgba(245, 158, 11, 0.1); color: #d97706; }
.status-badge.pending::before { background: #d97706; }
.status-badge.rejected { background: rgba(198, 40, 40, 0.1); color: #c62828; }
.status-badge.rejected::before { background: #c62828; }

/* Action Buttons */
.action-btns {
    display: flex;
    gap: 0.35rem;
}

.action-btns .btn {
    width: 30px;
    height: 30px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    border-radius: 0.375rem;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--admin-gradient);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.login-page::after {
    content: '';
    position: absolute;
    bottom: -15%;
    left: -5%;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 50%;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 1.25rem;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

.login-card .login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-card .login-logo img {
    width: 70px;
    height: 70px;
    margin: 0 auto 0.75rem;
}

.login-card .login-logo h4 {
    font-weight: 800;
    color: var(--admin-primary);
    margin-bottom: 0.25rem;
}

.login-card .login-logo p {
    color: var(--admin-text-muted);
    font-size: 0.85rem;
}

.login-card .form-floating {
    margin-bottom: 1rem;
}

.login-card .form-floating .form-control {
    border-radius: 0.625rem;
    border: 1px solid var(--admin-border);
    padding: 1rem 0.75rem;
    height: 3.25rem;
}

.login-card .form-floating .form-control:focus {
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(27, 94, 32, 0.12);
}

.login-card .btn-login {
    width: 100%;
    background: var(--admin-gradient);
    border: none;
    padding: 0.85rem;
    border-radius: 0.625rem;
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
    transition: all 0.3s;
}

.login-card .btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(27, 94, 32, 0.35);
}

.login-card .btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* ============================================================
   CHART CONTAINERS
   ============================================================ */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

/* ============================================================
   ACTIVITY LOG
   ============================================================ */
.activity-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--admin-border);
    font-size: 0.82rem;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.activity-icon.login { background: rgba(21, 101, 192, 0.1); color: #1565c0; }
.activity-icon.create { background: rgba(46, 125, 50, 0.1); color: #2e7d32; }
.activity-icon.edit { background: rgba(245, 127, 23, 0.1); color: #f57f17; }
.activity-icon.delete { background: rgba(198, 40, 40, 0.1); color: #c62828; }

.activity-text strong {
    color: var(--admin-text);
}

.activity-time {
    font-size: 0.7rem;
    color: var(--admin-text-muted);
    margin-top: 0.15rem;
}

/* ============================================================
   RESPONSIVE ADMIN
   ============================================================ */
@media (max-width: 991.98px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }

    .admin-sidebar.mobile-show {
        transform: translateX(0);
    }

    .admin-header {
        left: 0;
    }

    .admin-content {
        margin-left: 0;
    }

    .sidebar-collapsed .admin-header { left: 0; }
    .sidebar-collapsed .admin-content { margin-left: 0; }

    .header-search input {
        width: 200px;
    }

    .admin-sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s;
    }

    .admin-sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
    }
}

@media (max-width: 575.98px) {
    .admin-content { padding: 1rem; }
    .header-search { display: none; }
    .user-info { display: none; }
    .page-header { flex-direction: column; gap: 0.5rem; align-items: flex-start; }
    .stat-widget { padding: 1rem; }
    .stat-widget .stat-number { font-size: 1.25rem; }
}
