:root {
    --primary-color: #1b6ef3;
    --primary-hover: #155dd1;
    --secondary-color: #64748b;
    --accent-color: #14b8a6;
    --deep-bg: #0f172a;
    --shell-bg: #eef2ff;
    --surface: #ffffff;
    --surface-soft: rgba(255, 255, 255, 0.72);
    --border-color: rgba(148, 163, 184, 0.25);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.18);
    --shadow-md: 0 12px 24px rgba(15, 23, 42, 0.12);
    --shadow-sm: 0 6px 12px rgba(15, 23, 42, 0.08);
    --transition: all 0.3s ease;
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Sora', sans-serif;
    color: var(--text-main);
    background: var(--shell-bg);
    display: flex; /* Make body a flex container */
    flex-direction: column; /* Arrange children vertically */
}

.app-shell {
    height: 100%; /* Changed from min-height: 100vh */
    background: radial-gradient(circle at top left, #e0f2fe 0%, transparent 40%),
        radial-gradient(circle at 15% 25%, #fef3c7 0%, transparent 40%),
        radial-gradient(circle at 80% 10%, #ede9fe 0%, transparent 35%),
        var(--shell-bg);
}

.auth-shell {
    height: 100vh;
    background: radial-gradient(circle at top, #dbeafe 0%, transparent 40%),
        radial-gradient(circle at 80% 40%, #f5d0fe 0%, transparent 40%),
        #f8fafc;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    color: #0f172a;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.page-title {
    margin: 0.25rem 0 0.5rem;
    font-size: 2rem;
}

.page-subtitle {
    margin: 0;
    color: var(--text-muted);
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.7rem;
    color: var(--accent-color);
    font-weight: 600;
    margin: 0;
}

/* Cards */
.card {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    background: var(--surface);
    overflow: hidden;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

.glass-card {
    background: var(--surface-soft);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

/* Layout */


/* Main Content Area */
.main-content {
    margin-left: 270px; /* Account for fixed sidebar width */
    padding-top: 76px; /* Account for fixed topbar height */
    min-height: 100vh; /* Ensure it takes full viewport height */
    width: calc(100% - 270px); /* Adjust width to prevent horizontal overflow */
}

/* Sidebar */
.sidebar {
    position: fixed; /* Make the sidebar fixed */
    top: 0; /* Start from the top of the viewport */
    left: 0; /* Align to the left */
    width: 270px !important;
    background: linear-gradient(180deg, #0f172a 0%, #111827 45%, #1e293b 100%) !important;
    box-shadow: 8px 0 30px rgba(15, 23, 42, 0.35);
    padding-bottom: 1.5rem;
    height: 100vh; /* Occupy full viewport height */
    z-index: 1030; /* Ensure it's above other content */
    overflow-y: auto; /* Enable vertical scrolling for sidebar content */
}

/* Custom Scrollbar for Sidebar */
.sidebar::-webkit-scrollbar {
    width: 8px; /* Width of the scrollbar */
}

.sidebar::-webkit-scrollbar-track {
    background: #1e293b; /* Color of the scrollbar track */
}

.sidebar::-webkit-scrollbar-thumb {
    background-color: #475569; /* Color of the scrollbar thumb */
    border-radius: 10px; /* Rounded corners for the thumb */
    border: 2px solid #1e293b; /* Border around the thumb */
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background-color: #64748b; /* Color of the scrollbar thumb on hover */
}

.brand-logo {
    padding: 1.75rem 1.5rem 1.25rem;
    display: flex;
    gap: 12px;
    align-items: center;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.brand-name {
    color: #f8fafc;
    font-weight: 600;
    font-size: 1.05rem;
}

.brand-tenant {
    color: #94a3b8;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.sidebar .nav-link {
    color: #cbd5f5 !important;
    padding: 0.85rem 1.4rem;
    font-weight: 500;
    border-radius: 12px;
    margin: 0.2rem 1rem;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
}

.sidebar .nav-link i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    color: #94a3b8;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: #f8fafc !important;
    background: rgba(59, 130, 246, 0.2);
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.35);
}

.sidebar .nav-link.active i {
    color: #bfdbfe;
}

/* Topbar */
.topbar {
    position: fixed;
    top: 0;
    right: 0;
    left: 270px;
    height: 76px;
    background: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    backdrop-filter: blur(14px);
    z-index: 990;
}

.topbar-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-date {
    color: var(--text-muted);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.tenant-pill {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0.25rem 0.85rem;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    font-size: 0.7rem;
    color: var(--text-muted);
    min-width: 140px;
}

.tenant-pill span {
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.78rem;
}

.avatar-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1d4ed8 0%, #38bdf8 100%);
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: calc(2rem + 76px) 2.5rem 2rem;
    overflow-y: auto;
}

/* Buttons */
.btn {
    font-weight: 600;
    border-radius: 999px;
    padding: 0.5rem 1.4rem;
    transition: var(--transition);
}

.btn-sm {
    padding: 0.35rem 1rem;
    font-size: 0.85rem;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #38bdf8 100%);
    border: none;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #0ea5e9 100%);
    transform: translateY(-1px);
}

.btn-outline-secondary,
.btn-outline-primary,
.btn-outline-danger {
    border-radius: 999px;
}

/* Tables */
.table {
    color: var(--text-main);
}

.table th {
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    padding: 1rem;
    border-bottom-width: 1px;
}

.table td {
    vertical-align: middle;
    padding: 1rem;
    border-bottom-color: var(--border-color);
}

/* Forms */
.form-control, .form-select {
    border-radius: 14px;
    border: 1px solid var(--border-color);
    padding: 0.6rem 1rem;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.2);
}

/* Login */
.login-card {
    max-width: 700px; /* Further increased width for signup form */
    margin: 80px auto;
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    background: #fff;
    border: 1px solid var(--border-color);
    transition: var(--transition); /* Added transition for smoother effects */
}

.login-header {
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem !important;
    border-bottom: 1px solid var(--border-color);
}

.login-footer {
    padding-top: 1.5rem;
    margin-top: 1.5rem !important;
    border-top: 1px solid var(--border-color);
}

.login-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 1.5rem; /* Added margin for spacing */
}

.login-brand .brand-mark {
    width: 52px; /* Increased size */
    height: 52px; /* Increased size */
    font-size: 1.4rem; /* Increased icon size */
}

.login-brand .brand-name {
    font-size: 1.5rem; /* Increased font size for prominence */
}

.brand-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #0f172a;
}

.input-group:focus-within .input-group-text {
    border-color: #60a5fa;
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.2);
}

.reveal {
    animation: revealUp 0.7s ease forwards;
    opacity: 0;
    transform: translateY(12px);
}

.reveal-delay-1 { animation-delay: 0.08s; }
.reveal-delay-2 { animation-delay: 0.16s; }
.reveal-delay-3 { animation-delay: 0.24s; }
.reveal-delay-4 { animation-delay: 0.32s; }

@keyframes revealUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.plan-card {
    display: block;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background: #f8fafc;
    transition: var(--transition);
    cursor: pointer;
    height: 100%;
}

.plan-card input {
    display: none;
}

.plan-card .plan-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border-radius: var(--radius-md);
    padding: 1rem;
    border: 1px solid transparent;
}

.plan-card .plan-name {
    font-weight: 600;
    font-size: 1rem;
}

.plan-card .plan-price {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    font-size: 1.4rem;
    font-weight: 700;
}

.plan-card .plan-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.plan-card input:checked + .plan-content,
.plan-card:hover .plan-content {
    color: #0f172a;
}

.plan-card input:checked + .plan-content {
    border-color: rgba(37, 99, 235, 0.4);
    background: #eff6ff;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.12);
}

/* Billing */
.plan-price {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.plan-price .amount {
    font-size: 2rem;
    font-weight: 700;
}

.plan-price .period {
    color: var(--text-muted);
}

.metric-tile {
    background: #f8fafc;
    border-radius: var(--radius-md);
    padding: 1rem;
    border: 1px solid var(--border-color);
}

.metric-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.metric-value {
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: 0.25rem;
}

.usage-row {
    display: grid;
    grid-template-columns: 1.5fr 2fr auto;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 0;
}

.usage-meter {
    height: 8px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.usage-bar {
    height: 100%;
    background: linear-gradient(135deg, #22d3ee 0%, #2563eb 100%);
}

.usage-value {
    font-weight: 600;
}

.payment-card {
    background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
    color: #fff;
    border-radius: 18px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}

.payment-brand {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.7);
}

.payment-number {
    font-size: 1.3rem;
    letter-spacing: 0.15em;
    margin: 1rem 0;
}

.payment-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

.invoice-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 0;
    border-bottom: 1px dashed var(--border-color);
}

.invoice-row:last-child {
    border-bottom: none;
}

/* Utilities */
.student-photo {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: var(--shadow-sm);
}

@media (max-width: 992px) {
    .sidebar {
        width: 230px !important;
    }

    .topbar {
        left: 230px;
    }

    .main-content {
        padding: calc(2rem + 76px) 1.5rem 2rem;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .topbar {
        left: 0;
    }

    .page-header {
        flex-direction: column;
    }
}

/* Report Card (Print specific) */
.report-card {
    background: #fff;
    border: 1px solid #000;
    padding: 20px;
    width: 210mm;
    min-height: 297mm;
    margin: auto;
}