/* ============================================================
   DigitalWorld Admin Portal — Core Stylesheet
   ============================================================ */
:root {
    --sidebar-width: 256px;
    --header-height: 62px;
    --sidebar-bg: #0f172a;
    --sidebar-surface: #1e293b;
    --sidebar-text: #cbd5e1;
    --sidebar-muted: #64748b;
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --body-bg: #f1f5f9;
    --border-color: #e2e8f0;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--body-bg);
    color: #1e293b;
    font-size: 14px;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============ LAYOUT WRAPPER ============ */
.wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* ============ SIDEBAR ============ */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: sticky;
    top: 0;
    max-height: 100vh;
    z-index: 1040;
    transition: margin-left 0.25s ease, transform 0.25s ease;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar.collapsed {
    margin-left: calc(-1 * var(--sidebar-width));
}

.sidebar-brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.brand-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.brand-name {
    font-size: 15px;
    font-weight: 700;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.02);
    flex-shrink: 0;
}

.sidebar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-user-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-username {
    font-size: 13px;
    font-weight: 600;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-badge {
    display: inline-block;
    width: fit-content;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: 999px;
    letter-spacing: 0.3px;
}

.badge-admin        { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.badge-distributor  { background: rgba(139, 92, 246, 0.25); color: #c4b5fd; }
.badge-mobile-op-sb { background: rgba(20, 184, 166, 0.22); color: #5eead4; }
.badge-user         { background: rgba(59, 130, 246, 0.22); color: #93c5fd; }

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 10px 10px 18px;
}

.sidebar-nav::-webkit-scrollbar { width: 5px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.25); border-radius: 999px; }

.nav-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.75px;
    color: var(--sidebar-muted);
    padding: 10px 10px 5px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8.5px 12px;
    border-radius: 8px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 2px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-item i {
    font-size: 15px;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.9), rgba(139, 92, 246, 0.85));
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.28);
}

.nav-item.active-parent {
    background: rgba(99, 102, 241, 0.16);
    color: #e0e7ff;
    font-weight: 600;
}

.nav-badge {
    margin-left: auto;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.22);
    color: #c7d2fe;
    line-height: 1.3;
}

.nav-arrow {
    margin-left: auto;
    font-size: 11px !important;
    width: auto !important;
    transition: transform 0.2s ease;
    opacity: 0.75;
}

.nav-badge + .nav-arrow {
    margin-left: 6px;
}

.nav-submenu-toggle[aria-expanded="true"] .nav-arrow {
    transform: rotate(180deg);
}

.nav-submenu {
    padding-left: 14px;
    margin-bottom: 4px;
}

.nav-sub-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6.5px 11px;
    border-radius: 7px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 500;
    margin-bottom: 2px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-sub-item i {
    font-size: 13px;
    width: 16px;
    text-align: center;
}

.nav-sub-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #f8fafc;
}

.nav-sub-item.sub-active {
    background: rgba(99, 102, 241, 0.2);
    color: #ffffff;
    font-weight: 600;
}

.nav-item.text-danger-nav {
    color: #fca5a5;
}

.nav-item.text-danger-nav:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #fecaca;
}

.sidebar-footer {
    padding: 10px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    font-size: 11px;
    color: var(--sidebar-muted);
    text-align: center;
    flex-shrink: 0;
}

/* ============ MAIN CONTENT & TOP HEADER ============ */
.main-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--body-bg);
}

.top-header {
    height: var(--header-height);
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 1020;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.sidebar-toggle {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    background: #f8fafc;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    color: #334155;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.15s ease;
}

.sidebar-toggle:hover {
    background: #e2e8f0;
}

.page-title h5 {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
    color: #0f172a;
    line-height: 1.2;
}

.page-title .breadcrumb {
    font-size: 11px;
    line-height: 1.2;
}

.page-title .breadcrumb a {
    color: #6366f1;
    text-decoration: none;
}

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

.header-wallet {
    display: flex;
    align-items: center;
    gap: 7px;
    background: #eef2ff;
    color: #4338ca;
    padding: 6px 13px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid #c7d2fe;
}

.header-icon-btn .btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    border: 1px solid var(--border-color);
    background: #ffffff;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.header-icon-btn .btn-icon:hover {
    background: #f8fafc;
    color: #0f172a;
}

.badge-dot {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #ef4444;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid #ffffff;
}

.notification-dropdown {
    width: 300px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}

.notification-dropdown .dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
}

.notification-list {
    max-height: 280px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 12.5px;
}

.notification-item.unread {
    background: #eef2ff;
}

.notification-item .notif-icon {
    color: #6366f1;
    font-size: 16px;
    margin-top: 1px;
}

.user-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border-color);
    background: #ffffff;
    border-radius: 10px;
    padding: 4px 10px 4px 5px;
}

.user-dropdown-btn:hover {
    background: #f8fafc;
}

.user-avatar-sm {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #ffffff;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-info-sm {
    display: flex;
    flex-direction: column;
    text-align: left;
    line-height: 1.15;
}

.user-name-sm {
    font-size: 12.5px;
    font-weight: 600;
    color: #0f172a;
}

.user-role-sm {
    font-size: 10.5px;
    color: #64748b;
}

/* ============ INFO STRIP ============ */
.info-strip {
    background: #0f172a;
    color: #e2e8f0;
    padding: 7px 18px;
    border-bottom: 1px solid #1e293b;
    font-size: 12.5px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.info-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.combo-row {
    justify-content: space-between;
}

.combo-seg {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 240px;
}

.combo-divider {
    width: 1px;
    height: 18px;
    background: rgba(255, 255, 255, 0.14);
}

.info-icon {
    color: #fbbf24;
    font-size: 13px;
}

.pending-icon { color: #38bdf8; }
.upcoming-icon { color: #34d399; }

.info-label {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #94a3b8;
    white-space: nowrap;
}

.info-text {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.info-count {
    font-size: 10.5px;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.25);
    color: #c7d2fe;
}

.live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    display: inline-block;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
}

.type-caret {
    animation: blinkCaret 0.9s infinite;
    color: #818cf8;
    font-weight: 700;
}

@keyframes blinkCaret {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.pn-type { color: #a5b4fc; font-weight: 600; }
.pn-name { color: #f8fafc; font-weight: 600; }
.pn-id   { color: #38bdf8; }
.pn-fee  { color: #34d399; font-weight: 600; }
.pn-time { color: #94a3b8; }
.pn-pos  { color: #64748b; font-size: 11px; }
.pn-sep  { color: #475569; }

/* ============ CONTENT AREA & SHARED CARDS ============ */
.content-area {
    padding: 20px;
    flex: 1;
}

.card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.card-header {
    background: #ffffff;
    border-bottom: 1px solid #f1f5f9;
    padding: 12px 16px;
    font-weight: 600;
    border-top-left-radius: 12px !important;
    border-top-right-radius: 12px !important;
}

.section-title {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}

.section-sub {
    font-size: 11.5px;
    color: #64748b;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    height: 100%;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.stat-icon.green  { background: #dcfce7; color: #15803d; }
.stat-icon.red    { background: #fee2e2; color: #b91c1c; }
.stat-icon.yellow { background: #fef3c7; color: #b45309; }
.stat-icon.indigo { background: #e0e7ff; color: #4338ca; }
.stat-icon.blue   { background: #dbeafe; color: #1d4ed8; }

.stat-label {
    font-size: 11.5px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.stat-value {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.25;
}

.table thead th {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.35px;
    color: #475569;
    background-color: #f8fafc;
    border-bottom: 1px solid var(--border-color);
}

/* ============ AUTH PAGES (REGISTER) ============ */
.auth-wrapper {
    min-height: 100vh;
    background: #0b1230;
    background-image:
        radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.18), transparent 45%),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.15), transparent 45%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 18px;
    padding: 32px 28px;
    box-shadow: 0 22px 55px rgba(0, 0, 0, 0.35);
}

.auth-logo {
    width: 48px;
    height: 48px;
    border-radius: 13px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin: 0 auto 12px;
}

.auth-title {
    text-align: center;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
}

.auth-sub {
    text-align: center;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 22px;
}

/* ============ MOBILE RESPONSIVE SIDEBAR ============ */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 1035;
}

.sidebar-backdrop.show {
    display: block;
}

@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        margin-left: calc(-1 * var(--sidebar-width));
    }

    .sidebar.mobile-open {
        margin-left: 0;
    }

    .content-area {
        padding: 14px;
    }

    .top-header {
        padding: 0 12px;
    }

    .header-wallet {
        padding: 5px 10px;
        font-size: 12px;
    }

    .user-info-sm {
        display: none;
    }
}
