/* ==========================================================================
   NEETSaathi Admin & Telecalling CRM — Mobile-First Modern Stylesheet
   ========================================================================== */

:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.85);
    --bg-card-hover: rgba(30, 41, 59, 0.95);
    --bg-input: #161f30;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-focus: #3b82f6;

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-glow: rgba(37, 99, 235, 0.35);

    --emerald: #10b981;
    --emerald-dark: #059669;
    --emerald-glow: rgba(16, 185, 129, 0.25);

    --amber: #f59e0b;
    --amber-glow: rgba(245, 158, 11, 0.25);

    --rose: #ef4444;
    --rose-glow: rgba(239, 68, 68, 0.25);

    --purple: #8b5cf6;
    --blue: #3b82f6;
    --whatsapp: #25d366;
    --whatsapp-dark: #128c7e;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;

    --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 10px 30px -10px rgba(16, 185, 129, 0.3);
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Outfit', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    background-image: 
        radial-gradient(circle at 15% 20%, rgba(37, 99, 235, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(16, 185, 129, 0.07) 0%, transparent 40%);
    background-attachment: fixed;
}

/* ==========================================================================
   Typography & Utilities
   ========================================================================== */

h1, h2, h3, h4, h5 {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--text-primary);
}

a {
    color: var(--blue);
    text-decoration: none;
    transition: all 0.2s ease;
}

.text-muted { color: var(--text-muted); }
.text-success { color: var(--emerald); }
.text-emerald { color: var(--emerald); }
.text-amber { color: var(--amber); }
.text-blue { color: var(--blue); }
.text-purple { color: var(--purple); }
.text-rose { color: var(--rose); }
.text-center { text-align: center; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.full-width { grid-column: 1 / -1; width: 100%; }

/* ==========================================================================
   Buttons & Controls (Touch-Friendly)
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.875rem;
    min-height: 42px;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    text-decoration: none;
    user-select: none;
}

.btn:active {
    transform: scale(0.97);
}

.btn-sm {
    min-height: 34px;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-accent {
    background: linear-gradient(135deg, #059669, #10b981);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.btn-success {
    background: #10b981;
    color: #ffffff;
}

.btn-whatsapp {
    background: #25d366;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.btn-whatsapp:hover, .btn-whatsapp:active {
    background: #128c7e;
    color: #ffffff;
}

.btn-block {
    width: 100%;
}

.btn-icon-subtle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
}

.form-group {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.form-group label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-control,
.filter-select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
textarea,
select {
    width: 100%;
    min-height: 42px;
    padding: 0.625rem 0.875rem;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.9375rem; /* Prevents auto-zoom on iOS */
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.form-control:focus,
.filter-select:focus,
input:focus,
textarea:focus,
select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.password-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrap input {
    padding-right: 2.5rem;
}

.password-input-wrap .btn-icon-subtle {
    position: absolute;
    right: 0.5rem;
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */

.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    left: 1rem;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    background: #1e293b;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--blue);
    color: var(--text-primary);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 420px;
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    animation: toastSlideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast.toast-success { border-left-color: var(--emerald); }
.toast.toast-error { border-left-color: var(--rose); }

@keyframes toastSlideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Login / Auth Screen
   ========================================================================== */

.auth-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: radial-gradient(circle at center, rgba(37, 99, 235, 0.12) 0%, rgba(10, 14, 23, 0.98) 70%);
}

.auth-card {
    background: rgba(17, 24, 39, 0.9);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.25rem 1.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.auth-brand .logo-circle {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #10b981);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #ffffff;
    box-shadow: 0 0 24px rgba(37, 99, 235, 0.4);
}

.auth-brand h2 {
    font-size: 1.4rem;
    margin-bottom: 0.25rem;
}

.auth-brand p {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    margin-bottom: 1.75rem;
}

.auth-form {
    text-align: left;
}

.auth-footer {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* ==========================================================================
   Dashboard Shell & Sidebar
   ========================================================================== */

.dashboard-app {
    display: flex;
    min-height: 100vh;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    z-index: 1000;
}

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

.sidebar {
    width: 270px;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1001;
    padding: 1.5rem 1.25rem;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.75rem;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-brand .logo-box {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #2563eb, #10b981);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
}

.brand-title {
    font-size: 1.2rem;
    line-height: 1.2;
}

.badge-role {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--emerald);
    background: rgba(16, 185, 129, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
}

.btn-close-sidebar {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.6rem;
    cursor: pointer;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.18s ease;
}

.nav-item i {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
}

.nav-item.active {
    color: #ffffff;
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.25), rgba(37, 99, 235, 0.05));
    border-left: 3px solid var(--blue);
}

.sidebar-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.admin-profile-pill {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    overflow: hidden;
}

.avatar-sm {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--emerald);
}

.admin-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.admin-email {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.admin-badge {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.btn-logout {
    background: none;
    border: none;
    color: var(--rose);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */

.main-content {
    margin-left: 270px;
    flex: 1;
    padding: 2rem;
    max-width: calc(100vw - 270px);
}

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 0.75rem;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-menu-toggle {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.view-title {
    font-size: 1.35rem;
    line-height: 1.2;
}

.view-subtitle {
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

.top-bar-actions {
    display: flex;
    gap: 0.5rem;
}

/* ==========================================================================
   KPI Ribbon Grid
   ========================================================================== */

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.kpi-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.125rem;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.icon-blue { background: rgba(59, 130, 246, 0.15); color: var(--blue); }
.icon-amber { background: rgba(245, 158, 11, 0.15); color: var(--amber); }
.icon-emerald { background: rgba(16, 185, 129, 0.15); color: var(--emerald); }
.icon-purple { background: rgba(139, 92, 246, 0.15); color: var(--purple); }

.kpi-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.kpi-value {
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1.2;
    margin: 0.125rem 0;
}

.kpi-hint {
    font-size: 0.725rem;
    color: var(--text-muted);
}

/* ==========================================================================
   Toolbar, Quick Chips & Search
   ========================================================================== */

.toolbar-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.search-box {
    position: relative;
    width: 100%;
}

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

.search-box input {
    padding-left: 2.6rem;
}

/* Mobile Quick Filter Chips (Horizontal Scrollable) */
.quick-status-chips {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.quick-status-chips::-webkit-scrollbar {
    display: none;
}

.chip-filter {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.4rem 0.875rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.15s ease;
}

.chip-filter:active {
    transform: scale(0.95);
}

.chip-filter.active {
    background: var(--blue);
    color: #ffffff;
    border-color: var(--blue);
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.4);
}

.filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-select {
    flex: 1;
    min-width: 140px;
}

/* View Header & Toggle */
.view-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.875rem;
    padding: 0 0.25rem;
}

.table-count {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.view-toggle-wrap {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 2px;
}

.btn-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    transition: all 0.15s ease;
}

.btn-toggle.active {
    background: var(--blue);
    color: #ffffff;
}

/* ==========================================================================
   MOBILE-FIRST STUDENT CARDS VIEW
   ========================================================================== */

.students-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.student-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.125rem;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    box-shadow: var(--shadow-subtle);
    transition: transform 0.18s, border-color 0.18s;
}

.student-card:active {
    transform: scale(0.99);
}

.card-top-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.card-student-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.card-student-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-student-name:hover {
    color: var(--blue);
}

.card-student-email {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-badges-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.pill-tag {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

/* Status Select on Card */
.card-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.625rem;
    gap: 0.5rem;
}

.card-status-select {
    background: transparent;
    border: none;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    outline: none;
    padding: 0;
    min-height: auto;
    width: auto;
}

/* Action Buttons Grid on Card (Thumb-Friendly) */
.card-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
}

.btn-card-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.625rem 0.5rem;
    min-height: 42px;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    user-select: none;
    transition: transform 0.12s;
}

.btn-card-action:active {
    transform: scale(0.96);
}

.btn-action-call {
    background: linear-gradient(135deg, #059669, #10b981);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-action-wa {
    background: #25d366;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.btn-action-note {
    background: rgba(245, 158, 11, 0.15);
    color: var(--amber);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.card-footer-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.725rem;
    color: var(--text-muted);
}

.card-notes-preview {
    font-size: 0.725rem;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.2);
    padding: 4px 8px;
    border-radius: 4px;
    border-left: 3px solid var(--amber);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================================================
   Table Presentation (Desktop Alternate)
   ========================================================================== */

.table-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.125rem;
    box-shadow: var(--shadow-subtle);
}

.table-header-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    text-align: left;
}

.data-table th {
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background-color: var(--bg-card-hover);
}

.loading-cell {
    text-align: center;
    padding: 3rem 1rem !important;
    color: var(--text-muted);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 0.75rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Badges */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
}

.status-new { background: rgba(59, 130, 246, 0.15); color: #93c5fd; }
.status-interested { background: rgba(245, 158, 11, 0.15); color: #fcd34d; }
.status-followup { background: rgba(139, 92, 246, 0.15); color: #c4b5fd; }
.status-enrolled { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.4); }
.status-callback { background: rgba(100, 116, 139, 0.2); color: #cbd5e1; }
.status-notinterested { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }

.badge-pro {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(5, 150, 105, 0.35));
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.4);
}

.badge-free {
    display: inline-flex;
    font-size: 0.7rem;
    font-weight: 500;
    padding: 2px 7px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

/* ==========================================================================
   Sales & Analytics Cards
   ========================================================================== */

.card-grid-two {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 1.25rem;
}

.metric-summary-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
}

.card-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.sales-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.sales-stat-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.875rem 0.5rem;
    text-align: center;
}

.stat-title {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: block;
}

.stat-number {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--emerald);
    margin-top: 0.25rem;
    display: block;
}

.pitch-list {
    list-style: none;
    margin-top: 0.875rem;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    font-size: 0.8125rem;
}

.pitch-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.analytics-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 1.25rem;
}

.distribution-bars {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.dist-bar-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.dist-bar-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
}

.dist-bar-track {
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
}

.dist-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.fill-blue { background: var(--blue); }
.fill-emerald { background: var(--emerald); }
.fill-amber { background: var(--amber); }
.fill-purple { background: var(--purple); }

/* ==========================================================================
   Mobile Bottom Navigation Bar
   ========================================================================== */

.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    z-index: 999;
    align-items: center;
    justify-content: space-around;
    padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav-item {
    background: none;
    border: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 0.65rem;
    font-weight: 600;
    cursor: pointer;
    flex: 1;
    height: 100%;
    transition: color 0.15s;
}

.bottom-nav-item i {
    font-size: 1.15rem;
}

.bottom-nav-item.active {
    color: var(--blue);
}

/* ==========================================================================
   Modals & Bottom-Sheet Behavior
   ========================================================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.modal-box {
    background: #111827;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    animation: modalScale 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-lg {
    max-width: 740px;
}

.modal-drag-handle {
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin: 8px auto 0;
}

@keyframes modalScale {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.125rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.modal-title-wrap i {
    font-size: 1.2rem;
}

.btn-close-modal {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.modal-body {
    padding: 1.25rem;
    max-height: 80vh;
    overflow-y: auto;
}

.quick-dial-banner {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dial-phone-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
}

.dial-actions {
    display: flex;
    gap: 0.4rem;
}

.template-chips {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: 0.25rem;
}

.template-chips .chip {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.35rem 0.65rem;
    border-radius: 20px;
    font-size: 0.725rem;
    cursor: pointer;
}

.template-chips .chip.active {
    background: var(--blue);
    color: #ffffff;
    border-color: var(--blue);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.625rem;
    margin-top: 1.25rem;
}

.detail-kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 0.5rem;
}

.detail-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.625rem;
    text-align: center;
}

.detail-box .label {
    font-size: 0.675rem;
    color: var(--text-muted);
    display: block;
}

.detail-box strong {
    font-size: 1rem;
    color: var(--text-primary);
    margin-top: 0.25rem;
    display: block;
}

/* ==========================================================================
   RESPONSIVE DESIGN BREAKPOINTS (MOBILE-FIRST)
   ========================================================================== */

@media (min-width: 993px) {
    .d-mobile {
        display: none !important;
    }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        max-width: 100vw;
        padding: 1rem 1rem 5.5rem 1rem; /* Safe padding for bottom nav */
    }

    .mobile-bottom-nav {
        display: flex;
    }

    .d-desktop {
        display: none !important;
    }

    .btn-icon-only-mobile {
        padding: 0.5rem;
        min-width: 38px;
        min-height: 38px;
    }

    .d-desktop-select {
        display: none;
    }

    /* Modal turns into native Slide-Up Bottom Sheet on phones */
    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .modal-box {
        max-width: 100%;
        border-radius: 20px 20px 0 0;
        border-bottom: none;
        max-height: 90vh;
        animation: sheetSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes sheetSlideUp {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }

    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .kpi-card {
        padding: 0.875rem;
    }

    .kpi-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    .kpi-value {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 0.875rem 0.875rem 5.5rem 0.875rem;
    }

    .students-cards-grid {
        grid-template-columns: 1fr;
    }

    .card-actions-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
}
