:root {
    /* Brand Colors */
    --color-primary-green: #8CD63F;
    --color-secondary-blue: #1F7CCF;
    --color-accent-yellow: #F7C948;

    /* Neutrals */
    --color-text-dark: #1F2937;
    --color-text-muted: #6B7280;
    --color-border: #E5E7EB;
    --color-bg-body: #F9FAFB;
    --color-bg-card: #FFFFFF;

    /* Semantic */
    --color-status-active: var(--color-primary-green);
    --color-status-trial: var(--color-secondary-blue);
    --color-status-expired: #EF4444;
    /* Standard Red */

    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius-card: 14px;
    --font-family-base: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family-base);
    background-color: var(--color-bg-body);
    color: var(--color-text-dark);
    font-size: 14px;
    line-height: 1.5;
}

/* Layout Grid */
.app-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    background-color: var(--color-bg-card);
    border-right: 1px solid var(--color-border);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary-green);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--color-text-muted);
    border-radius: 8px;
    transition: all 0.2s;
    font-weight: 500;
}

.nav-item a:hover,
.nav-item a.active {
    background-color: #F0FDF4;
    /* Light green tint */
    color: var(--color-primary-green);
}

/* Main Content */
.main-content {
    padding: 2rem;
    overflow-y: auto;
    background-color: #F3F4F6;
    /* Slightly darker bg for proper contrast with white cards */
    height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
    /* Subtle modern gradient */
    border-right: 1px solid var(--color-border);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    position: sticky;
    top: 0;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.02);
    scrollbar-width: thin;
    scrollbar-color: #E5E7EB transparent;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background-color: #E5E7EB;
    border-radius: 20px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background-color: #D1D5DB;
}

/* Modern Colorful KPIs */
.kpi-card {
    position: relative;
    overflow: hidden;
    border: none;
    background: #fff;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px -8px rgba(0, 0, 0, 0.15);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--color-border);
}

/* Variant: Blue (Primary/Active) */
.kpi-blue {
    border-left: 4px solid #3B82F6;
}

.kpi-blue .kpi-value {
    color: #1E40AF;
}

.kpi-blue .kpi-icon {
    background: #eff6ff;
    color: #1E40AF;
}

/* Variant: Green (Success/Growth) */
.kpi-green {
    border-left: 4px solid #10B981;
}

.kpi-green .kpi-value {
    color: #065F46;
}

.kpi-green .kpi-icon {
    background: #ecfdf5;
    color: #065F46;
}

/* Variant: Purple (Users/Students) */
.kpi-purple {
    border-left: 4px solid #8B5CF6;
}

.kpi-purple .kpi-value {
    color: #5B21B6;
}

.kpi-purple .kpi-icon {
    background: #f5f3ff;
    color: #5B21B6;
}

/* Variant: Red (Alerts/Danger) */
.kpi-red {
    border-left: 4px solid #EF4444;
}

.kpi-red .kpi-value {
    color: #991B1B;
}

.kpi-red .kpi-icon {
    background: #fef2f2;
    color: #991B1B;
}

/* Variant: Orange (Bus/Fleet) */
.kpi-orange {
    border-left: 4px solid #F59E0B;
}

.kpi-orange .kpi-value {
    color: #92400E;
}

.kpi-orange .kpi-icon {
    background: #fffbeb;
    color: #92400E;
}

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.kpi-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 1.25rem;
    transition: transform 0.2s ease;
}

.kpi-card:hover .kpi-icon {
    transform: scale(1.1);
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 0.5rem 2rem 0.5rem;
    /* Added bottom padding */
    margin-bottom: 2rem;
    background: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    /* The separator line */
}

.brand-logo {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #8CD63F 0%, #166534 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.5rem;
    box-shadow: 0 4px 10px rgba(140, 214, 63, 0.3);
}

.brand-text {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--color-text-dark);
    letter-spacing: -0.01em;
}

/* Dashboard Welcome Banner */
.dashboard-welcome {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
    padding: 2rem;
    border-radius: var(--radius-card);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.dashboard-welcome h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    font-weight: 800;
}

.dashboard-welcome p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    max-width: 600px;
}

.dashboard-welcome::after {
    content: '🛡️';
    font-size: 10rem;
    position: absolute;
    right: -2rem;
    bottom: -3rem;
    opacity: 0.1;
    transform: rotate(-15deg);
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex-grow: 1;
    /* Pushes footer down */
    overflow-y: auto;
    /* Allow menu to scroll if too tall */
    margin-right: -10px;
    padding-right: 10px;
    /* Hide scrollbar visual */
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: #4B5563;
    border-radius: 12px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    font-size: 0.95rem;
}

.nav-item a:hover {
    background-color: #F3F4F6;
    color: var(--color-text-dark);
    transform: translateX(4px);
}

.nav-item a.active {
    background-color: #ECFCCB;
    /* Light lime green */
    color: #365314;
    /* Dark green */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    /* Subtle shadow for active */
}

/* Sidebar Footer (Logout) */
.sidebar-footer {
    padding-top: 1.5rem;
    margin-top: auto;
    border-top: 1px solid var(--color-border);
}

.nav-item-logout {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 1rem 1.25rem;
    background: #FEF2F2;
    border: 1px solid #FEE2E2;
    color: #DC2626;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s;
    justify-content: center;
}

.nav-item-logout:hover {
    background: #FEE2E2;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(220, 38, 38, 0.1);
}

/* User Badge in Header */
.user-badge {
    padding: 0.5rem 1rem;
    background: #F3f4F6;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.875rem;
    color: #374151;
    border: 1px solid #E5E7EB;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Cards & KPIs */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card,
.kpi-card {
    background: var(--color-bg-card);
    border-radius: var(--radius-card);
    padding: 1.5rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--color-border);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover,
.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.kpi-title {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.kpi-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--color-text-dark);
    line-height: 1.2;
}

.kpi-trend {
    font-size: 0.875rem;
    color: #9CA3AF;
    margin-top: 0.5rem;
}

/* Tables */
.table-container {
    background: var(--color-bg-card);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--color-border);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

th {
    background-color: #F9FAFB;
    font-weight: 600;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

tr:last-child td {
    border-bottom: none;
}

/* Utilities */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.status-active {
    background-color: #DCFCE7;
    color: #166534;
}

.status-trial {
    background-color: #DBEAFE;
    color: #1E40AF;
}

.status-expired {
    background-color: #FEE2E2;
    color: #991B1B;
}

/* Authentication Layout */
/* Authentication Layout - Modern Split */
.auth-container {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background-color: #fff;
}

@media (max-width: 1024px) {
    .auth-container {
        grid-template-columns: 1fr;
    }

    .auth-branding {
        display: none;
    }
}

.auth-branding {
    background: linear-gradient(135deg, #8CD63F 0%, #166534 100%);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.auth-branding::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.auth-branding-content {
    position: relative;
    z-index: 10;
    color: white;
    text-align: center;
}

.auth-branding-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.auth-branding-desc {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.6;
}

.auth-form-side {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background-color: var(--color-bg-card);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    padding: 0;
    background: transparent;
    box-shadow: none;
    border: none;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-dark);
}

.auth-subtitle {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-dark);
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-family: var(--font-family-base);
    font-size: 0.875rem;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary-green);
    box-shadow: 0 0 0 3px rgba(140, 214, 63, 0.1);
}

.w-full {
    width: 100%;
}

.btn-primary {
    width: auto;
    display: inline-block;
    text-align: center;
    background-color: var(--color-primary-green);
    color: #064E3B;
    /* Dark green/teal for contrast */
    font-weight: 600;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    filter: brightness(95%);
}

.alert-danger {
    background-color: #FEE2E2;
    border: 1px solid #FECACA;
    color: #991B1B;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}