/**
 * Global CRM — Stylesheet
 * (c) southlab.eu
 */

/* ── Variables ────────────────────────────────────── */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --purple: #8b5cf6;
    --purple-light: #ede9fe;

    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --sidebar-active: #2563eb;
    --sidebar-text: #94a3b8;
    --sidebar-width: 260px;

    --bg: #f1f5f9;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(0,0,0,.08);
    --shadow-lg: 0 4px 12px rgba(0,0,0,.1);
}

/* ── Reset ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { overflow-x: hidden; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text); font-size: .9rem; line-height: 1.5; overflow-x: hidden; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ── Sidebar ──────────────────────────────────────── */
.sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: var(--sidebar-width); background: var(--sidebar-bg);
    color: var(--sidebar-text); display: flex; flex-direction: column;
    z-index: 100; overflow-y: auto; overflow-x: hidden;
    transition: transform .3s ease, width .25s ease;
}

/* Desktop-only icon-only collapse (mobile uses translateX off-screen instead). */
.sidebar-collapse-btn {
    position: absolute; top: 12px; right: 8px;
    background: rgba(255,255,255,.06); border: none;
    color: #cbd5e1; cursor: pointer;
    width: 24px; height: 24px; border-radius: 50%;
    font-size: .9rem; line-height: 1; padding: 0;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, transform .25s;
    z-index: 2;
}
.sidebar-collapse-btn:hover { background: rgba(255,255,255,.14); color: #fff; }
@media (max-width: 768px) { .sidebar-collapse-btn { display: none; } }

@media (min-width: 769px) {
    html.sidebar-collapsed .sidebar,
    body.sidebar-collapsed .sidebar { width: 64px; }
    html.sidebar-collapsed .main-content,
    body.sidebar-collapsed .main-content { margin-left: 64px; }

    /* Hide every text label, keep icons visible */
    body.sidebar-collapsed .sidebar-brand-text,
    body.sidebar-collapsed .sidebar-title,
    body.sidebar-collapsed .sidebar-subtitle,
    body.sidebar-collapsed .nav-section-label,
    body.sidebar-collapsed .nav-label,
    body.sidebar-collapsed .sidebar-user-info { display: none; }

    body.sidebar-collapsed .sidebar-brand { padding: 1rem .4rem; justify-content: center; }
    body.sidebar-collapsed .nav-item { padding: .65rem 0; justify-content: center; gap: 0; }
    body.sidebar-collapsed .nav-icon { width: auto; font-size: 1.15rem; }
    body.sidebar-collapsed .sidebar-user { justify-content: center; padding: .6rem 0; }
    body.sidebar-collapsed .sidebar-collapse-btn { transform: rotate(180deg); }

    /* Hover tooltip: shows the original label to the right of the icon */
    body.sidebar-collapsed .nav-item { position: relative; }
    body.sidebar-collapsed .nav-item:hover::after {
        content: attr(data-label);
        position: absolute; left: calc(100% + 6px); top: 50%; transform: translateY(-50%);
        background: #0f172a; color: #fff;
        padding: 4px 10px; border-radius: 6px; font-size: .78rem;
        white-space: nowrap; z-index: 200; pointer-events: none;
        box-shadow: 0 4px 12px rgba(0,0,0,.35);
    }
}

.sidebar-brand {
    display: flex; align-items: center; gap: .8rem;
    padding: 1.2rem 1rem; border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-logo { font-size: 1.8rem; flex-shrink: 0; line-height: 1; }
.sidebar-title { color: #fff; font-weight: 700; font-size: 1.05rem; }
.sidebar-subtitle { font-size: .7rem; color: #64748b; }

.topbar-search { flex: 1; display: flex; justify-content: center; position: relative; margin: 0; }
.topbar-search form { width: 100%; max-width: 380px; }
.topbar-search-input {
    padding: .45rem .8rem; font-size: .85rem; width: 100%;
    border: 1px solid var(--border); border-radius: 8px;
    background: #f8fafc; color: var(--text);
    outline: none; transition: border-color .2s, background .2s;
}
.topbar-search-input::placeholder { color: #94a3b8; }
.topbar-search-input:focus { border-color: var(--primary); background: #fff; }

.live-search-results {
    display: none; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: 420px; margin-top: .3rem;
    background: #fff; border: 1px solid var(--border); border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12); z-index: 200; overflow: hidden;
}
.ls-item {
    display: block; padding: .55rem .8rem; text-decoration: none; color: var(--text);
    border-bottom: 1px solid #f1f5f9; transition: background .1s;
}
.ls-item:last-child { border-bottom: none; }
.ls-item:hover, .ls-item.ls-active { background: #f0f7ff; }
.ls-name { font-size: .85rem; font-weight: 600; }
.ls-meta { font-size: .73rem; color: var(--text-light); margin-top: .15rem; }
.ls-empty { padding: .8rem; text-align: center; font-size: .82rem; color: var(--text-light); }

@media (max-width:600px) {
    .topbar-search form { max-width: 100%; }
    .topbar-search { order: 10; flex-basis: 100%; }
    .live-search-results { max-width: 100%; left: 0; transform: none; }
}

.sidebar-nav { flex: 1; padding: .8rem 0; }
.nav-section-label {
    font-size: .65rem; font-weight: 700; letter-spacing: .08em;
    color: #475569; padding: 1rem 1.2rem .4rem; text-transform: uppercase;
}
.nav-item {
    display: flex; align-items: center; gap: .7rem;
    padding: .6rem 1.2rem; color: var(--sidebar-text);
    font-size: .85rem; transition: all .15s; text-decoration: none;
    border-left: 3px solid transparent; margin: 1px 0;
}
.nav-item:hover { background: var(--sidebar-hover); color: #e2e8f0; text-decoration: none; }
.nav-item.active { background: rgba(37,99,235,.15); color: #60a5fa; border-left-color: var(--primary); font-weight: 600; }
.nav-icon { font-size: 1rem; width: 1.4rem; text-align: center; }

.sidebar-user {
    display: flex; align-items: center; gap: .6rem;
    padding: 1rem; border-top: 1px solid rgba(255,255,255,.08);
    margin-top: auto;
}
.sidebar-avatar { width: 34px; height: 34px; border-radius: 50%; }
.sidebar-avatar-placeholder {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--primary); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .85rem; flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { color: #e2e8f0; font-size: .8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-logout {
    color: #64748b; font-size: 1.2rem; padding: .3rem;
    text-decoration: none; transition: color .15s;
}
.sidebar-logout:hover { color: var(--danger); text-decoration: none; }

/* ── Main Content ─────────────────────────────────── */
.main-content { margin-left: var(--sidebar-width); min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
    background: var(--card-bg); border-bottom: 1px solid var(--border);
    padding: .8rem 1.5rem; display: flex; align-items: center; gap: 1rem;
    position: sticky; top: 0; z-index: 50; flex-wrap: wrap;
}
.sidebar-toggle { display: none; background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--text); flex-shrink: 0; }
.page-title { font-size: 1.15rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }
.topbar-profile-link { color: var(--text-light); font-size: .82rem; }

.container { padding: 1.5rem; flex: 1; max-width: 1400px; width: 100%; }

footer {
    padding: 1rem 1.5rem; text-align: center;
    font-size: .75rem; color: var(--text-light);
    border-top: 1px solid var(--border);
}
footer a { color: var(--primary); }

.sidebar-backdrop {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.5); z-index: 99;
}

/* ── Cards ────────────────────────────────────────── */
.card {
    background: var(--card-bg); border-radius: var(--radius);
    border: 1px solid var(--border); box-shadow: var(--shadow);
    padding: 1.2rem; margin-bottom: 1rem;
}
.card-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1rem; padding-bottom: .8rem;
    border-bottom: 1px solid var(--border);
}
.card-header h2, .card-header h3 { font-size: 1rem; font-weight: 700; }

/* ── Stat Cards ───────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card {
    background: var(--card-bg); border-radius: var(--radius);
    border: 1px solid var(--border); box-shadow: var(--shadow);
    padding: 1.2rem; display: flex; align-items: center; gap: 1rem;
}
.stat-icon { font-size: 2rem; width: 50px; height: 50px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.stat-number { font-size: 1.5rem; font-weight: 800; color: var(--text); }
.stat-label { font-size: .78rem; color: var(--text-light); }

/* ── Grid Layouts ─────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.grid-sidebar { display: grid; grid-template-columns: 380px 1fr; gap: 1.2rem; }

/* ── Tables ───────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .6rem .8rem; text-align: left; border-bottom: 1px solid var(--border); font-size: .84rem; }
th { background: #f8fafc; font-weight: 600; color: var(--text-light); font-size: .76rem; text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
tr:hover { background: #f8fafc; }

/* ── Forms ────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 600; font-size: .82rem; margin-bottom: .3rem; color: var(--text); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="tel"], input[type="date"], input[type="url"],
select, textarea {
    width: 100%; padding: .55rem .75rem; border: 1px solid var(--border);
    border-radius: 8px; font-size: .88rem; background: #fff;
    transition: border-color .15s;
    font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
textarea { resize: vertical; min-height: 80px; }

/* ── Buttons ──────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .5rem 1rem; border: none; border-radius: 8px;
    font-size: .84rem; font-weight: 600; cursor: pointer;
    text-decoration: none; transition: all .15s;
    font-family: inherit;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-secondary { background: #e2e8f0; color: var(--text); }
.btn-secondary:hover { background: #cbd5e1; color: var(--text); }
.btn-sm { padding: .3rem .7rem; font-size: .78rem; }
.btn-xs { padding: .2rem .5rem; font-size: .72rem; }

.btn-group { display: flex; gap: .4rem; flex-wrap: wrap; }

/* ── Badges ───────────────────────────────────────── */
.badge {
    display: inline-flex; align-items: center;
    padding: .15rem .55rem; border-radius: 50px;
    font-size: .7rem; font-weight: 600; letter-spacing: .02em;
}
.badge-blue { background: var(--primary-light); color: var(--primary); }
.badge-green { background: var(--success-light); color: #065f46; }
.badge-yellow { background: var(--warning-light); color: #92400e; }
.badge-red { background: var(--danger-light); color: #991b1b; }
.badge-purple { background: var(--purple-light); color: #5b21b6; }
.badge-gray { background: #f1f5f9; color: #475569; }

/* Status badges */
.status-badge {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .2rem .6rem; border-radius: 50px;
    font-size: .72rem; font-weight: 600;
}
.status-inquiry { background: #dbeafe; color: #1d4ed8; }
.status-application_review { background: #fef3c7; color: #92400e; }
.status-offer_letter { background: #ede9fe; color: #5b21b6; }
.status-visa_processing { background: #fff7ed; color: #9a3412; }
.status-visa_granted { background: #d1fae5; color: #065f46; }

/* ── Alerts ───────────────────────────────────────── */
.alert {
    padding: .75rem 1rem; border-radius: 8px;
    margin-bottom: 1rem; font-size: .85rem;
    border: 1px solid transparent;
}
.alert-success { background: var(--success-light); color: #065f46; border-color: #a7f3d0; }
.alert-error { background: var(--danger-light); color: #991b1b; border-color: #fecaca; }
.alert-warning { background: var(--warning-light); color: #92400e; border-color: #fde68a; }
.alert-info { background: var(--primary-light); color: #1e40af; border-color: #bfdbfe; }

/* ── Filters / Toolbar ────────────────────────────── */
.filters {
    display: flex; align-items: center; gap: .8rem;
    margin-bottom: 1rem; flex-wrap: wrap;
}
.filters input, .filters select {
    width: auto; min-width: 140px;
    padding: .4rem .6rem; font-size: .82rem;
}
.filters .search-input { min-width: 200px; }

/* ── Comments ─────────────────────────────────────── */
.comment-list { list-style: none; }
.comment-item {
    padding: .8rem 0; border-bottom: 1px solid var(--border);
}
.comment-item:last-child { border-bottom: none; }
.comment-meta { font-size: .75rem; color: var(--text-light); margin-bottom: .3rem; }
.comment-meta strong { color: var(--text); }
.comment-text { font-size: .85rem; }

/* ── Timeline ─────────────────────────────────────── */
.timeline { list-style: none; position: relative; padding-left: 1.5rem; }
.timeline::before {
    content: ''; position: absolute; left: .5rem; top: 0; bottom: 0;
    width: 2px; background: var(--border);
}
.timeline-item { position: relative; padding-bottom: 1rem; }
.timeline-item::before {
    content: ''; position: absolute; left: -1.15rem; top: .3rem;
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--primary); border: 2px solid #fff;
    box-shadow: 0 0 0 2px var(--primary-light);
}
.timeline-date { font-size: .72rem; color: var(--text-light); }
.timeline-content { font-size: .82rem; }

/* ── Document List ────────────────────────────────── */
.doc-list { list-style: none; }
.doc-item {
    display: flex; align-items: center; gap: .8rem;
    padding: .6rem 0; border-bottom: 1px solid var(--border);
}
.doc-item:last-child { border-bottom: none; }
.doc-icon { font-size: 1.3rem; }
.doc-info { flex: 1; }
.doc-name { font-weight: 600; font-size: .84rem; }
.doc-meta { font-size: .72rem; color: var(--text-light); }

/* ── Tabs ─────────────────────────────────────────── */
.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 1rem; }
.tab-btn {
    padding: .6rem 1.2rem; font-size: .84rem; font-weight: 600;
    color: var(--text-light); background: none; border: none;
    cursor: pointer; border-bottom: 2px solid transparent;
    margin-bottom: -2px; transition: all .15s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Detail Header ────────────────────────────────── */
.detail-header {
    display: flex; align-items: center; gap: 1rem;
    margin-bottom: 1.5rem;
}
.detail-header .back-link { color: var(--text-light); font-size: 1.2rem; }
.detail-info h2 { font-size: 1.1rem; font-weight: 700; }
.detail-info p { font-size: .82rem; color: var(--text-light); }

/* ── Info Grid ────────────────────────────────────── */
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .8rem; }
.info-item label { display: block; font-size: .72rem; color: var(--text-light); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.info-item .info-value { font-size: .88rem; font-weight: 500; }

/* ── Pagination ───────────────────────────────────── */
.pagination { display: flex; align-items: center; gap: .3rem; margin-top: 1rem; justify-content: center; }
.pagination a, .pagination span {
    padding: .4rem .7rem; border-radius: 6px;
    font-size: .82rem; font-weight: 500;
    border: 1px solid var(--border);
}
.pagination a { color: var(--text); background: #fff; }
.pagination a:hover { background: var(--primary-light); text-decoration: none; }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Empty State ──────────────────────────────────── */
.empty-state {
    text-align: center; padding: 3rem 1rem; color: var(--text-light);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: .5rem; }
.empty-state p { font-size: .9rem; }

/* ── Login Page ───────────────────────────────────── */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg); }
.login-card {
    width: 100%; max-width: 400px;
    background: var(--card-bg); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); border: 1px solid var(--border);
    overflow: hidden;
}
.login-header {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: #fff; padding: 2rem; text-align: center;
}
.login-header h1 { font-size: 1.5rem; margin-bottom: .3rem; }
.login-header p { color: #94a3b8; font-size: .85rem; }
.login-body { padding: 2rem; }
.login-body .form-group { margin-bottom: 1.2rem; }
.google-btn {
    display: flex; align-items: center; justify-content: center; gap: .6rem;
    width: 100%; padding: .7rem; border: 2px solid #e2e8f0; border-radius: 8px;
    background: #fff; color: #1e293b; font-size: .92rem; font-weight: 600;
    cursor: pointer; text-decoration: none; transition: all .15s;
}
.google-btn:hover { border-color: #4285f4; background: #f8fafc; text-decoration: none; }
.separator { display: flex; align-items: center; gap: .8rem; margin: 1.2rem 0; color: #94a3b8; font-size: .82rem; }
.separator::before, .separator::after { content: ''; flex: 1; height: 1px; background: #e2e8f0; }

/* ── Bar Chart (CSS only) ─────────────────────────── */
.chart-bar-group { margin-bottom: .6rem; }
.chart-bar-label { font-size: .78rem; color: var(--text); margin-bottom: .2rem; display: flex; justify-content: space-between; }
.chart-bar-track { height: 22px; background: #f1f5f9; border-radius: 4px; overflow: hidden; }
.chart-bar-fill { height: 100%; border-radius: 4px; min-width: 2px; transition: width .5s ease; display: flex; align-items: center; padding-left: .4rem; font-size: .68rem; color: #fff; font-weight: 600; }

/* ── Payment Tracking ─────────────────────────────── */
.payment-section .card-header { margin-bottom: .8rem; }
.payment-block {
    background: #f8fafc; border-radius: 8px;
    padding: 1rem; border: 1px solid var(--border);
}
.payment-block-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: .8rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border);
}
.payment-block-header h4 { font-size: .9rem; font-weight: 700; }
.payment-stage-note {
    font-size: .7rem; color: var(--text-light); background: #e2e8f0;
    padding: .15rem .5rem; border-radius: 50px; font-weight: 600;
}
.payment-info-row { margin-bottom: .8rem; }
.payment-disabled-note {
    background: var(--warning-light); color: #92400e;
    padding: .6rem .8rem; border-radius: 6px; font-size: .82rem;
    margin-bottom: .8rem; border: 1px solid #fde68a;
}
.receipt-info {
    display: flex; align-items: center; gap: .5rem;
    margin-top: .4rem; font-size: .78rem; color: var(--text-light);
}
.financial-summary {
    background: #f8fafc; border-radius: 8px;
    padding: 1rem; border: 1px solid var(--border);
}
.financial-summary .card-header { margin-bottom: .6rem; padding-bottom: .5rem; }
.financial-summary .card-header h4 { font-size: .88rem; }
.summary-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem;
}
.summary-item {
    text-align: center; padding: .6rem;
    background: #fff; border-radius: 6px; border: 1px solid var(--border);
}
.summary-label { display: block; font-size: .7rem; color: var(--text-light); text-transform: uppercase; font-weight: 600; letter-spacing: .03em; }
.summary-value { display: block; font-size: 1.1rem; font-weight: 800; margin-top: .2rem; }
.summary-paid .summary-value { color: var(--success); }
.summary-remaining .summary-value { color: var(--warning); }
.summary-cleared .summary-value { color: var(--success); }
.payment-progress-bar {
    height: 8px; background: #e2e8f0; border-radius: 4px; overflow: hidden;
}
.payment-progress-fill {
    height: 100%; background: linear-gradient(90deg, var(--success), #34d399);
    border-radius: 4px; transition: width .5s ease; min-width: 0;
}

/* ── Notification Bell ────────────────────────────── */
.notif-bell {
    position: relative; background: none; border: none;
    font-size: 1.25rem; cursor: pointer; padding: .3rem .5rem;
    color: var(--text); border-radius: 8px; transition: background .15s;
    line-height: 1;
}
.notif-bell:hover { background: var(--border); }

.notif-badge {
    position: absolute; top: 0; right: 0;
    background: var(--danger); color: #fff;
    font-size: .6rem; font-weight: 700;
    min-width: 16px; height: 16px;
    border-radius: 50px; display: flex;
    align-items: center; justify-content: center;
    padding: 0 4px; line-height: 1;
    transform: translate(40%, -30%);
    pointer-events: none;
}

.notif-dropdown {
    position: absolute; top: 100%; right: 0;
    width: 360px; max-height: 440px;
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-lg);
    z-index: 200; overflow: hidden;
    display: flex; flex-direction: column;
}
.notif-dropdown-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: .7rem 1rem; border-bottom: 1px solid var(--border);
    font-size: .85rem;
}
.notif-list {
    overflow-y: auto; flex: 1; max-height: 380px;
}

.notif-item {
    display: flex; align-items: flex-start; gap: .6rem;
    padding: .7rem 1rem; cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background .1s; font-size: .82rem;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: #f8fafc; }
.notif-item.unread { background: var(--primary-light); }
.notif-item.unread:hover { background: #c7d9f7; }

.notif-type-icon {
    font-size: 1.1rem; flex-shrink: 0;
    width: 28px; height: 28px; display: flex;
    align-items: center; justify-content: center;
    background: #f1f5f9; border-radius: 50%;
}
.notif-item.unread .notif-type-icon { background: #bfdbfe; }

.notif-item-body { flex: 1; min-width: 0; }
.notif-item-title {
    font-weight: 600; font-size: .82rem;
    color: var(--text); line-height: 1.3;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.notif-item-msg {
    font-size: .76rem; color: var(--text-light);
    margin-top: .1rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.notif-item-time {
    font-size: .68rem; color: var(--text-light); margin-top: .2rem;
}

.notif-empty {
    padding: 2rem 1rem; text-align: center;
    color: var(--text-light); font-size: .85rem;
}

@media (max-width: 480px) {
    .notif-dropdown { width: calc(100vw - 1.5rem); right: -10px; max-width: 360px; }
}

@media (max-width: 360px) {
    .notif-dropdown { position: fixed; left: .5rem; right: .5rem; width: auto; top: 3.5rem; }
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 1024px) {
    .grid-sidebar { grid-template-columns: 1fr; }
    .grid-2 { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .sidebar-backdrop.show { display: block; }
    .main-content { margin-left: 0; }
    .sidebar-toggle { display: block; }
    .topbar { padding: .6rem 1rem; gap: .5rem; }
    .topbar-profile-link { display: none; }
    .page-title { font-size: 1rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: 1fr; }
    .grid-sidebar { grid-template-columns: 1fr; }
    .summary-grid { grid-template-columns: 1fr 1fr; }
    .filters { flex-direction: column; align-items: stretch; }
    .filters input, .filters select { width: 100%; min-width: unset !important; }
    .card { padding: .9rem; }
    .card-header { flex-wrap: wrap; gap: .5rem; }
    .detail-header { flex-wrap: wrap; }
    /* Modal adjustments */
    .modal-body, [id$="Modal"] > div > div { max-width: 100% !important; }
    [id$="Modal"] > div { padding: 10px !important; }
    /* Inline flex stat cards */
    .inline-stats-row > div { min-width: calc(50% - .5rem) !important; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .summary-grid { grid-template-columns: 1fr; }
    .container { padding: .75rem; }
    .topbar { padding: .5rem .75rem; }
    .page-title { font-size: .9rem; max-width: 120px; }
    .stat-card { padding: .8rem; gap: .6rem; }
    .stat-number { font-size: 1.2rem; }
    .stat-icon { width: 40px; height: 40px; font-size: 1.5rem; }
    .notif-dropdown { width: calc(100vw - 1.5rem); right: -10px; max-width: 360px; }
    .btn { padding: .4rem .7rem; font-size: .8rem; }
    .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .tab-btn { white-space: nowrap; padding: .5rem .8rem; font-size: .78rem; }
    th, td { padding: .4rem .5rem; font-size: .78rem; }
    .pagination { flex-wrap: wrap; }
    /* Modal full width on phones */
    [id$="Modal"] form { padding: 14px !important; }
    [id$="Modal"] .card-header, [id$="Modal"] > div > div > div:first-child { padding: 12px 14px !important; }
    /* Inline flex stat cards stack */
    .inline-stats-row > div { min-width: 100% !important; flex-basis: 100% !important; }
}

/* ── Calendar ──────────────────────────────────────────── */
.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    gap: .5rem;
}
.calendar-nav h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    text-align: center;
}
.calendar-wrapper {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 1.5rem;
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-collapse: collapse;
}
.calendar-header {
    background: var(--primary);
    color: white;
    padding: .65rem .5rem;
    text-align: center;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.calendar-day {
    background: white;
    min-height: 100px;
    padding: .5rem;
    font-size: .75rem;
    cursor: pointer;
    transition: background .15s;
    position: relative;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.calendar-day:nth-child(7n) {
    border-right: none;
}
.calendar-day:hover {
    background: #f0f9ff;
}
.calendar-day.today {
    background: #eff6ff;
    box-shadow: inset 0 0 0 2px var(--primary);
}
.calendar-day.other-month {
    background: #f9fafb;
}
.calendar-day.other-month .calendar-day-number {
    color: #cbd5e1;
}
.calendar-day-number {
    font-weight: 700;
    margin-bottom: .35rem;
    font-size: .85rem;
    color: var(--text);
}
.calendar-event {
    display: block;
    padding: 2px 5px;
    margin-bottom: 2px;
    border-radius: 4px;
    font-size: .68rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    color: white;
}
.calendar-event:hover {
    opacity: .85;
}
.calendar-event.type-interview { background: #8b5cf6; }
.calendar-event.type-meeting { background: #3b82f6; }
.calendar-event.type-follow_up { background: #f59e0b; }
.calendar-event.type-orientation { background: #10b981; }
.calendar-event.type-other { background: #6b7280; }
.calendar-more {
    font-size: .65rem;
    color: var(--primary);
    font-weight: 600;
    padding: 2px 4px;
}
/* Day view */
.day-appointment {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--border);
    align-items: flex-start;
}
.day-appointment:last-child {
    border-bottom: none;
}
.day-appt-time {
    font-weight: 700;
    font-size: .85rem;
    min-width: 110px;
    color: var(--primary);
    white-space: nowrap;
}
.day-appt-details {
    flex: 1;
}
.day-appt-title {
    font-weight: 700;
    font-size: .95rem;
    margin-bottom: .3rem;
}
.day-appt-meta {
    font-size: .78rem;
    color: var(--text-light);
    line-height: 1.5;
}
@media (max-width: 768px) {
    .calendar-day { min-height: 60px; padding: .3rem; }
    .calendar-event { font-size: .6rem; padding: 1px 3px; }
    .calendar-day-number { font-size: .72rem; }
    .calendar-header { padding: .4rem .2rem; font-size: .65rem; }
    .calendar-nav h2 { font-size: 1rem; }
    .day-appointment { flex-direction: column; gap: .4rem; }
    .day-appt-time { min-width: auto; }
}
