/* ============================================================
   Freelance Broadcast Gig Tracker — Main Stylesheet
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --sidebar-width: 240px;
    --topbar-height: 56px;
    --color-bg: #f0f2f5;
    --color-surface: #ffffff;
    --color-border: #e2e8f0;
    --color-primary: #2563eb;
    --color-primary-dark: #1d4ed8;
    --color-primary-light: #dbeafe;
    --color-text: #1e293b;
    --color-text-muted: #64748b;
    --color-danger: #dc2626;
    --color-danger-light: #fee2e2;
    --color-success: #16a34a;
    --color-success-light: #dcfce7;
    --color-warning: #d97706;
    --color-warning-light: #fef3c7;
    --color-info: #0891b2;
    --color-info-light: #cffafe;
    --color-sidebar-bg: #0f172a;
    --color-sidebar-text: #94a3b8;
    --color-sidebar-active: #ffffff;
    --color-sidebar-hover: #1e293b;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
    --transition: 150ms ease;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

html { font-size: 15px; }
body { font-family: var(--font); color: var(--color-text); background: var(--color-bg); line-height: 1.55; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
pre { white-space: pre-wrap; }

/* --- App Layout --- */
.app-wrapper { display: flex; min-height: 100vh; }

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--color-sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 200;
    overflow-y: auto;
    transition: transform var(--transition);
}
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 16px 12px;
    border-bottom: 1px solid rgba(255,255,255,.07);
}
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-weight: 700;
    font-size: .9rem;
    letter-spacing: .02em;
}
.sidebar-logo svg { color: var(--color-primary); flex-shrink: 0; }
.sidebar-close { display: none; background: none; border: none; color: var(--color-sidebar-text); font-size: 1.4rem; cursor: pointer; line-height: 1; }

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,.07);
}
.user-avatar {
    width: 34px; height: 34px;
    background: var(--color-primary);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: .85rem;
    flex-shrink: 0;
}
.user-info { overflow: hidden; }
.user-name { color: #fff; font-size: .82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { color: var(--color-sidebar-text); font-size: .73rem; }

.nav-list { list-style: none; padding: 10px 8px; flex: 1; }
.nav-list li { margin-bottom: 2px; }
.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 6px;
    color: var(--color-sidebar-text);
    font-size: .84rem;
    font-weight: 500;
    transition: background var(--transition), color var(--transition);
    text-decoration: none;
}
.nav-link:hover { background: var(--color-sidebar-hover); color: #fff; text-decoration: none; }
.nav-link.active { background: var(--color-primary); color: #fff; }
.nav-link svg { flex-shrink: 0; opacity: .8; }
.nav-link.active svg, .nav-link:hover svg { opacity: 1; }

.sidebar-footer { padding: 10px 8px 16px; border-top: 1px solid rgba(255,255,255,.07); }
.logout-link { color: #ef4444 !important; }
.logout-link:hover { background: rgba(239,68,68,.1) !important; color: #ef4444 !important; }

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

/* --- Topbar --- */
.topbar {
    height: var(--topbar-height);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.hamburger {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.hamburger span { display: block; width: 20px; height: 2px; background: var(--color-text); border-radius: 2px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

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

/* --- Page Content --- */
.page-content { padding: 24px; max-width: 1400px; }

/* --- Page Header --- */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.page-header h2 { font-size: 1.5rem; font-weight: 700; color: var(--color-text); line-height: 1.2; }
.page-subtitle { color: var(--color-text-muted); font-size: .9rem; margin-top: 2px; display: block; }
.header-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* --- Cards --- */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
}
.card-header h3 { font-size: .95rem; font-weight: 600; color: var(--color-text); }
.card-header h4 { font-size: .88rem; font-weight: 600; }
.card-link { font-size: .8rem; color: var(--color-primary); }
.card-body { padding: 20px; }
.card-body.p-0 { padding: 0; }
.card-footer { padding: 10px 20px; border-top: 1px solid var(--color-border); font-size: .82rem; background: var(--color-bg); }
.mb-4 { margin-bottom: 1.25rem; }
.mt-4 { margin-top: 1.25rem; }
.mt-3 { margin-top: .9rem; }
.mt-2 { margin-top: .5rem; }
.mb-1 { margin-bottom: .25rem; }

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: .84rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.btn-primary:hover { background: var(--color-primary-dark); border-color: var(--color-primary-dark); }
.btn-secondary { background: #fff; color: var(--color-text); border-color: var(--color-border); }
.btn-secondary:hover { background: var(--color-bg); }
.btn-ghost { background: transparent; color: var(--color-text-muted); border-color: transparent; }
.btn-ghost:hover { background: var(--color-bg); color: var(--color-text); }
.btn-danger { background: var(--color-danger); color: #fff; border-color: var(--color-danger); }
.btn-danger:hover { background: #b91c1c; }
.btn-danger-outline { background: transparent; color: var(--color-danger); border-color: var(--color-danger); }
.btn-danger-outline:hover { background: var(--color-danger-light); }
.btn-sm { padding: 5px 10px; font-size: .78rem; }
.btn-lg { padding: 10px 22px; font-size: .9rem; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px; height: 30px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    text-decoration: none;
}
.btn-icon:hover { background: var(--color-bg); color: var(--color-text); text-decoration: none; }
.btn-icon.text-danger { color: var(--color-danger); }
.btn-icon.text-danger:hover { background: var(--color-danger-light); }

/* --- Forms --- */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .83rem; font-weight: 600; color: var(--color-text); margin-bottom: 5px; }
.form-control {
    display: block;
    width: 100%;
    padding: 8px 12px;
    font-size: .84rem;
    color: var(--color-text);
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    transition: border-color var(--transition), box-shadow var(--transition);
    line-height: 1.5;
    font-family: var(--font);
}
.form-control:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-light); }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px; }
.form-control-color { padding: 4px 6px; height: 38px; cursor: pointer; }
.form-control-static { padding: 8px 0; font-size: .88rem; }
.form-check { display: flex; align-items: center; gap: 8px; }
.form-check input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--color-primary); }
.form-check label { margin-bottom: 0; font-weight: 400; cursor: pointer; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 0; }
.col-3 { flex: 0 0 calc(25% - 8px) !important; }
.col-4 { flex: 0 0 calc(33.33% - 8px) !important; }
.col-5 { flex: 0 0 calc(41.66% - 8px) !important; }
.col-6 { flex: 0 0 calc(50% - 8px) !important; }
.col-7 { flex: 0 0 calc(58.33% - 8px) !important; }
.col-8 { flex: 0 0 calc(66.66% - 8px) !important; }
.required { color: var(--color-danger); }
small a { font-size: .78rem; }
.form-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 20px 0; }
.section-title { font-size: .88rem; font-weight: 700; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 14px; }
.align-items-end { align-items: flex-end; }

/* --- Tables --- */
.table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.table th {
    text-align: left;
    padding: 10px 16px;
    background: var(--color-bg);
    border-bottom: 2px solid var(--color-border);
    font-size: .77rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--color-text-muted);
    white-space: nowrap;
}
.table td { padding: 11px 16px; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table-hover tbody tr:hover { background: #fafafa; }
.table tfoot td { padding: 10px 16px; border-top: 2px solid var(--color-border); background: var(--color-bg); }
.table-sm th, .table-sm td { padding: 8px 12px; }
.table-actions { width: 60px; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.fw-semibold { font-weight: 600; }
.fw-bold { font-weight: 700; }
.text-muted { color: var(--color-text-muted) !important; }
.text-danger { color: var(--color-danger) !important; }
.text-success { color: var(--color-success) !important; }
.ms-1 { margin-left: 4px; }

/* --- Alerts --- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: .84rem;
    margin-bottom: 16px;
    border: 1px solid transparent;
}
.alert-success { background: var(--color-success-light); color: #166534; border-color: #bbf7d0; }
.alert-danger { background: var(--color-danger-light); color: #991b1b; border-color: #fecaca; }
.alert-warning { background: var(--color-warning-light); color: #92400e; border-color: #fde68a; }
.alert-info { background: var(--color-info-light); color: #155e75; border-color: #a5f3fc; }

/* --- Badges --- */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 600;
    line-height: 1.6;
    white-space: nowrap;
}
.badge-success { background: var(--color-success-light); color: #166534; }
.badge-danger { background: var(--color-danger-light); color: #991b1b; }
.badge-warning { background: var(--color-warning-light); color: #92400e; }
.badge-info { background: var(--color-info-light); color: #155e75; }
.badge-secondary { background: #f1f5f9; color: #475569; }

/* --- Role & Tag Pills --- */
.role-pill, .tag-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 600;
    border: 1px solid transparent;
}
.role-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}
.tags-display, .tag-selector { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-check { cursor: pointer; }
.tag-check input[type="checkbox"] { display: none; }
.tag-check input:checked + .tag-label { opacity: 1; box-shadow: 0 0 0 2px currentColor; }
.tag-label { opacity: .65; transition: opacity var(--transition); display: inline-block; cursor: pointer; padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 600; border: 1px solid transparent; }
.tag-label:hover { opacity: .9; }

/* --- Stats Grid --- */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
}
.stat-card-lg { grid-column: span 2; }
.stat-icon {
    width: 46px; height: 46px;
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.stat-icon-green { background: var(--color-success-light); color: var(--color-success); }
.stat-icon-blue { background: var(--color-primary-light); color: var(--color-primary); }
.stat-icon-orange { background: var(--color-warning-light); color: var(--color-warning); }
.stat-icon-red { background: var(--color-danger-light); color: var(--color-danger); }
.stat-value { font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: .78rem; color: var(--color-text-muted); margin-top: 3px; }
.stat-inline { font-size: .9rem; color: var(--color-text-muted); }

/* --- Dashboard Grid --- */
.dashboard-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; }
.dashboard-grid .card:first-child { grid-column: 1; }

/* --- Event List Items --- */
.event-list { display: flex; flex-direction: column; }
.event-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--color-border);
    text-decoration: none;
    transition: background var(--transition);
}
.event-item:last-child { border-bottom: none; }
.event-item:hover { background: #fafafa; text-decoration: none; }
.event-date-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 40px;
    flex-shrink: 0;
    background: var(--color-primary-light);
    border-radius: var(--radius);
    padding: 4px 0;
}
.badge-month { font-size: .65rem; font-weight: 700; color: var(--color-primary); text-transform: uppercase; }
.badge-day { font-size: 1.1rem; font-weight: 700; color: var(--color-primary); line-height: 1.1; }
.event-details { flex: 1; min-width: 0; }
.event-name { font-weight: 600; font-size: .88rem; color: var(--color-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event-meta { font-size: .76rem; color: var(--color-text-muted); margin-top: 2px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.event-pay { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.pay-amount { font-weight: 700; font-size: .9rem; color: var(--color-text); }

/* --- Event Detail --- */
.event-detail-grid { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
.detail-main { min-width: 0; }
.detail-sidebar { min-width: 0; }
.detail-list { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; font-size: .85rem; }
.detail-list dt { font-weight: 600; color: var(--color-text-muted); white-space: nowrap; padding: 4px 0; }
.detail-list dd { padding: 4px 0; }
.pay-summary { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.pay-big { font-size: 2rem; font-weight: 700; color: var(--color-text); }
.pay-type { font-size: .82rem; color: var(--color-text-muted); }
.pay-details { font-size: .82rem; color: var(--color-text-muted); display: flex; flex-direction: column; gap: 2px; }
.expenses-row { display: flex; flex-wrap: wrap; gap: 12px; font-size: .84rem; }
.notes-pre { background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 12px; font-size: .82rem; font-family: var(--font); margin-bottom: 12px; }
.notes-text { font-size: .85rem; line-height: 1.7; margin-bottom: 12px; }
.travel-icons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.travel-badge { background: var(--color-info-light); color: var(--color-info); border-radius: 999px; padding: 2px 8px; font-size: .76rem; font-weight: 600; }
.contact-item { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--color-border); font-size: .84rem; }
.contact-item:last-child { border-bottom: none; margin-bottom: 0; }

/* --- Attachments --- */
.attachments-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.attachment-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--color-border); border-radius: var(--radius); }
.att-icon { font-size: 1.4rem; flex-shrink: 0; }
.att-info { flex: 1; min-width: 0; }
.att-name { font-size: .84rem; font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-meta { font-size: .75rem; color: var(--color-text-muted); }
.att-desc { font-size: .75rem; color: var(--color-text-muted); }
.upload-form .upload-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.upload-row .form-control { flex: 1; }

/* --- Bulk Tag Toolbar --- */
.bulk-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: var(--color-primary);
    color: #fff;
    padding: 8px 14px;
    border-radius: var(--radius);
    margin-bottom: 10px;
    animation: fadeIn .15s ease;
}
.bulk-count { font-weight: 600; font-size: .85rem; white-space: nowrap; }
.bulk-tags { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.bulk-toolbar .tag-label { border-color: rgba(255,255,255,.4); color: #fff; background: rgba(255,255,255,.15) !important; }
.bulk-toolbar .tag-check input:checked + .tag-label { background: rgba(255,255,255,.35) !important; box-shadow: 0 0 0 2px #fff; }
.bulk-toolbar .btn-ghost { color: #fff; border-color: rgba(255,255,255,.4); }
.bulk-toolbar .btn-ghost:hover { background: rgba(255,255,255,.15); }

/* --- Filter Bar --- */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filter-search { min-width: 180px; flex: 1; }
.filter-select { width: auto; min-width: 130px; }
.filter-date { width: 140px; }

/* --- Invoice event banner --- */
.invoice-event-banner {
    background: var(--color-primary-light);
    border: 1px solid #bfdbfe;
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 20px;
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: .88rem;
    flex-wrap: wrap;
}

/* --- Tabs --- */
.tabs { margin-bottom: 8px; }
.tab-nav { display: flex; gap: 4px; border-bottom: 2px solid var(--color-border); margin-bottom: 0; overflow-x: auto; }
.tab-btn {
    padding: 10px 16px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    font-size: .83rem;
    font-weight: 600;
    color: var(--color-text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: color var(--transition), border-color var(--transition);
}
.tab-btn:hover { color: var(--color-text); }
.tab-btn.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }
.tab-pane { display: none; padding-top: 20px; }
.tab-pane.active { display: block; }

/* --- Calendar --- */
.calendar-wrapper { overflow: hidden; }
.calendar-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.calendar-nav h3 { font-size: 1.2rem; font-weight: 700; flex: 1; text-align: center; }
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--color-surface);
    box-shadow: var(--shadow);
}
.cal-header {
    background: var(--color-bg);
    border-bottom: 2px solid var(--color-border);
    padding: 10px 8px;
    text-align: center;
    font-size: .73rem;
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
}
.cal-day {
    min-height: 110px;
    border-right: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    padding: 6px 6px 4px;
    vertical-align: top;
    position: relative;
}
.cal-day:nth-child(7n) { border-right: none; }
.cal-day-empty { background: #fafafa; }
.cal-today { background: #eff6ff; }
.cal-today .cal-day-num { background: var(--color-primary); color: #fff; border-radius: 50%; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.cal-day-num { font-size: .8rem; font-weight: 600; color: var(--color-text-muted); margin-bottom: 4px; display: inline-block; }
.cal-day-events { display: flex; flex-direction: column; gap: 2px; }
.cal-event {
    display: block;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: .69rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    opacity: .9;
    transition: opacity var(--transition);
}
.cal-event:hover { opacity: 1; text-decoration: none; }
.cal-more { font-size: .68rem; color: var(--color-text-muted); padding: 1px 4px; }
.calendar-legend { margin-top: 20px; }
.calendar-legend h4 { font-size: .88rem; font-weight: 700; margin-bottom: 10px; }
.legend-list { display: flex; flex-direction: column; gap: 4px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: .82rem; padding: 6px 10px; border-radius: var(--radius); text-decoration: none; color: var(--color-text); }
.legend-item:hover { background: var(--color-bg); text-decoration: none; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.legend-date { font-weight: 600; min-width: 50px; }
.legend-name { font-weight: 600; flex: 1; }
.legend-role, .legend-client { margin-left: 4px; }

/* --- Reports / Charts --- */
.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.bar-chart { display: flex; align-items: flex-end; gap: 6px; height: 220px; padding-bottom: 24px; position: relative; overflow-x: auto; min-width: 0; }
.bar-col { display: flex; flex-direction: column; align-items: center; flex: 1; min-width: 40px; }
.bar-amount { font-size: .65rem; color: var(--color-text-muted); margin-bottom: 4px; text-align: center; white-space: nowrap; overflow: hidden; max-width: 100%; }
.bar-wrap { width: 100%; display: flex; align-items: flex-end; justify-content: center; flex: 1; }
.bar-fill { width: 70%; background: var(--color-primary); border-radius: 4px 4px 0 0; min-height: 3px; transition: height .3s ease; }
.bar-label { font-size: .72rem; font-weight: 600; color: var(--color-text-muted); margin-top: 6px; text-align: center; }
.mini-bar-wrap { display: flex; align-items: center; gap: 8px; }
.mini-bar { height: 8px; border-radius: 4px; background: var(--color-primary); min-width: 3px; }
.mini-bar-wrap span { font-size: .78rem; color: var(--color-text-muted); white-space: nowrap; }
.year-picker { display: flex; align-items: center; gap: 10px; font-size: .84rem; }
.year-picker .form-control { width: auto; }

/* --- Settings --- */
.settings-grid { display: grid; grid-template-columns: 1fr; gap: 0; max-width: 800px; }
.tag-manage-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-manage-item { display: flex; align-items: center; gap: 6px; }
.add-tag-form { margin-top: 12px; }

/* --- Auth --- */
.auth-body { background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.auth-container { width: 100%; max-width: 420px; padding: 20px; }
.auth-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo svg { color: var(--color-primary); }
.auth-logo h1 { font-size: 1.3rem; font-weight: 700; margin-top: 10px; }
.auth-logo p { color: var(--color-text-muted); font-size: .85rem; margin-top: 4px; }
.auth-hint { text-align: center; margin-top: 16px; font-size: .78rem; color: var(--color-text-muted); }

/* --- Empty State --- */
.empty-state { text-align: center; padding: 48px 20px; color: var(--color-text-muted); }
.empty-state svg { margin-bottom: 12px; opacity: .4; }
.empty-state p { font-size: .9rem; }
.p-4 { padding: 20px; }

/* --- Error page --- */
.error-page { text-align: center; padding: 80px 20px; }
.error-code { font-size: 5rem; font-weight: 800; color: var(--color-primary); opacity: .3; line-height: 1; }

/* --- HR dividers --- */
hr { border: none; border-top: 1px solid var(--color-border); margin: 18px 0; }
h4, h5 { font-weight: 600; margin-bottom: 8px; }
h4 { font-size: .9rem; }
h5 { font-size: .84rem; }

/* --- Venue preview --- */
.venue-preview { background: var(--color-bg); border-radius: var(--radius); padding: 12px 14px; margin-top: 8px; font-size: .83rem; }

/* --- Scrollbars (webkit) --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1200px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .event-detail-grid { grid-template-columns: 1fr; }
    .detail-sidebar { order: -1; display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
}

@media (max-width: 900px) {
    .report-grid { grid-template-columns: 1fr; }
    .col-3, .col-4, .col-5, .col-6, .col-7, .col-8 { flex: 1 1 100% !important; }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 0 0 40px rgba(0,0,0,.4);
    }
    .sidebar-close { display: block; }
    .sidebar-overlay.open { display: block; }
    .main-content { margin-left: 0; }
    .hamburger { display: flex; }
    .page-content { padding: 16px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-value { font-size: 1.1rem; }
    .calendar-grid { font-size: .75rem; }
    .cal-day { min-height: 70px; }
    .cal-event { font-size: .62rem; }
    .detail-sidebar { display: flex; flex-direction: column; }
    .filter-bar { gap: 6px; }
    .filter-select, .filter-date { width: 100%; }
    .filter-search { min-width: unset; }
    .table { font-size: .78rem; }
    .table th, .table td { padding: 8px 10px; }
    .card-header { padding: 12px 14px; }
    .card-body { padding: 14px; }
    .form-row { flex-direction: column; gap: 0; }
    .tab-nav { gap: 0; }
    .tab-btn { padding: 8px 10px; font-size: .78rem; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; gap: 8px; }
    .header-actions { width: 100%; }
    .form-actions { flex-direction: column; align-items: stretch; }
    .form-actions .btn { width: 100%; justify-content: center; }
    .bar-chart { overflow-x: scroll; }
}
