:root {
    --primary: #facc15;
    /* Bright Cyber Yellow */
    --primary-glow: rgba(250, 204, 21, 0.4);
    --bg-main: #060b13;
    /* Ultra Dark Blue/Black */
    --bg-sidebar: #0b121d;
    --bg-card: #111a27;
    --bg-input: #1b2635;
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    --text-yellow: #facc15;
    --border: #1e293b;
    --success: #10b981;
    --warning: #facc15;
    --danger: #ef4444;
    --info: #3b82f6;
    --sidebar-width: 280px;
    --shadow-glow: 0 0 20px var(--primary-glow);
    --glass: rgba(11, 18, 29, 0.8);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Layout Structure */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 2.5rem 2rem;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 900;
    letter-spacing: -0.05em;
    color: var(--text-main);
}

.sidebar-nav {
    flex: 1;
    padding: 0 1.25rem;
}

.nav-label {
    padding: 1.5rem 1rem 0.75rem;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.25rem;
    border-radius: 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9375rem;
}

.nav-item i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.nav-item:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
}

.nav-item.active {
    color: var(--text-yellow);
    background: rgba(250, 204, 21, 0.08);
}

.nav-item.active i {
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

/* Nav Dropdown Styles */
.nav-dropdown {
    margin-bottom: 0.25rem;
}

.dropdown-header {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 0.75rem;
    transition: all 0.3s;
    font-weight: 600;
    font-size: 0.9375rem;
    gap: 1rem;
}

.dropdown-header:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
}

.dropdown-header i:not(.chevron) {
    width: 24px;
    text-align: center;
    font-size: 1.2rem;
}

.dropdown-header span {
    flex: 1;
}

.chevron {
    font-size: 0.7rem;
    transition: transform 0.3s;
}

.nav-dropdown.open .chevron {
    transform: rotate(180deg);
}

.sub-menu {
    display: none;
    padding-left: 1.5rem;
    margin-left: 2rem;
    margin-bottom: 0.5rem;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-dropdown.open .sub-menu {
    display: flex;
    flex-direction: column;
}

.sub-item {
    display: block;
    padding: 0.6rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0.5rem;
    margin-bottom: 0.1rem;
}

.sub-item:hover,
.sub-item.active {
    color: var(--text-yellow);
    background: rgba(250, 204, 21, 0.05);
    transform: translateX(5px);
}

/* Main Content Area */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2.5rem;
    background: radial-gradient(circle at 50% -20%, #1e293b 0%, #060b13 70%);
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.page-title h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-main);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.top-icon-btn {
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}

.top-icon-btn:hover {
    color: var(--text-main);
}

.top-icon-btn .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 2px solid var(--bg-main);
}

.user-avatar-top {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
}

/* Dashboard Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    padding: 1.75rem;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
}

.stat-card .label {
    display: block;
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.stat-card .value {
    font-size: 2.25rem;
    font-weight: 900;
    color: var(--text-yellow);
    letter-spacing: -0.02em;
    text-shadow: 0 0 15px rgba(250, 204, 21, 0.2);
}

.stat-card .trend {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-weight: 700;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Charts Section */
.chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 1.5rem;
    padding: 2rem;
    margin-bottom: 2rem;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

/* Table Section */
.content-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 1.5rem;
    padding: 1.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 1.25rem 1rem;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: capitalize;
}

td {
    padding: 1.25rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    font-weight: 500;
}

/* Action Buttons */
.btn-yellow {
    background: var(--primary);
    color: #000;
    padding: 1rem 2rem;
    border-radius: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
    box-shadow: 0 10px 25px var(--primary-glow);
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
    cursor: pointer;
}

.btn-yellow:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px var(--primary-glow);
}

/* Sidebar Footer Profile */
.sidebar-footer {
    padding: 1.5rem;
    margin-top: auto;
}

.user-profile-small {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 1rem;
    transition: background 0.2s;
}

.user-profile-small:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Layout Utilities */
.container {
    padding: 2.5rem;
    margin: 0 auto;
}

/* Base Form Styling */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label,
label {
    display: block;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-muted);
    margin-bottom: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.full-width {
    grid-column: span 2;
}

.form-control,
select.form-control,
input.form-control {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 0.875rem;
    padding: 0.875rem 1.25rem;
    color: var(--text-main);
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    appearance: none;
}

select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.25rem;
    padding-right: 3rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-card);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    border-radius: 0.875rem;
    font-weight: 700;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--primary);
    color: #000;
    box-shadow: 0 10px 20px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px var(--primary-glow);
    filter: brightness(1.1);
}

.btn-outline {
    background: transparent;
    border-color: var(--border);
    color: var(--text-main);
}

.btn-outline:hover {
    background: var(--bg-card);
    border-color: var(--primary);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid transparent;
}

.badge-paid,
.badge-complete {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
}

.badge-pending,
.badge-active {
    color: #facc15;
    background: rgba(250, 204, 21, 0.1);
    border-color: rgba(250, 204, 21, 0.2);
}

.badge-expired {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
}

.badge i {
    font-size: 0.8em;
}

/* Table and Containers */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 1.5rem;
    position: relative;
    overflow: hidden;
}

.animate-in {
    animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Alerts and Notifications */
.alert {
    padding: 1.25rem 1.5rem;
    border-radius: 1rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 600;
    font-size: 0.9375rem;
    border: 1px solid transparent;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.2);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.2);
}

/* Mobile Toggle Button */
.mobile-toggle {
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-main);
    width: 45px;
    height: 45px;
    border-radius: 12px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.25rem;
    z-index: 1001;
    transition: all 0.2s;
}

.mobile-toggle:active {
    transform: scale(0.95);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s ease;
}

@media (max-width: 1024px) {
    .sidebar {
        left: calc(var(--sidebar-width) * -1);
        transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .sidebar.open {
        left: 0;
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
    }

    .sidebar-overlay.show {
        display: block;
        opacity: 1;
    }

    .main-wrapper {
        margin-left: 0;
        padding: 1.5rem;
        padding-top: 5rem;
        /* Space for floating button */
    }

    .mobile-toggle {
        display: flex;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .full-width {
        grid-column: span 1;
    }
}

@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
        margin-bottom: 2rem;
    }

    .top-bar-right {
        width: 100%;
        justify-content: space-between;
    }

    .page-title h1 {
        font-size: 1.5rem;
    }

    .stat-card .value {
        font-size: 1.75rem;
    }
}

.animate-fade {
    animation: fadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}