:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --success: #14b88b;
    --success-hover: #109877;
    --danger: #e53e3e;
    --warning: #f59e0b;
    --bg: #f5f7fa;
    --surface: #fff;
    --border: #e2e8f0;
    --text: #2d3a4a;
    --text-muted: #667085;
    --text-light: #64748b;
    --sidebar-bg: linear-gradient(180deg, #23272f 0%, #222a35 100%);
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Saira', 'Segoe UI', Arial, sans-serif;
    font-weight: 400;
}
h1, h2, .h1, .h2 {
    font-family: 'Syne', 'Segoe UI', Arial, sans-serif;
    font-weight: 700;
    letter-spacing: -0.01em;
}
h3, h4, h5, h6, .h3, .h4, .h5, .h6 {
    font-family: 'Jura', 'Segoe UI', Arial, sans-serif;
    font-weight: 600;
}
a { color: var(--primary); text-decoration: none; transition: color 0.18s; }
a:hover { color: var(--primary-hover); text-decoration: underline; }

/* --- SIDEBAR --- */
.bg-dark {
    background: linear-gradient(180deg, #23272f 0%, #222a35 100%) !important;
    color: #fff !important;
    border-right: 1px solid #252a32;
}
.bg-dark .nav-link {
    color: #c3c8d2 !important;
    border-radius: 0.5rem;
    transition: background 0.18s, color 0.18s;
    padding: 0.62rem 1rem;
    margin-bottom: 4px;
    font-size: 0.92rem;
}
.bg-dark .nav-link.active, .bg-dark .nav-link:hover {
    background: #2563eb !important;
    color: #fff !important;
    font-weight: 600;
    box-shadow: 0 2px 8px 0 rgba(37,99,235,0.13);
}
.bg-dark .nav-link i { width: 20px; text-align: center; margin-right: 8px; }
.bg-dark hr { border-top: 1px solid #353d48; }

/* --- CARDS --- */
.card {
    border-radius: 1.1rem;
    border: none;
    box-shadow: 0 3px 18px 0 rgba(40,50,60,0.07);
    background: #fff;
    transition: box-shadow 0.22s;
}

/* --- TABLE --- */
.table {
    background: #fff;
    border-radius: 0.8rem;
    overflow: hidden;
    font-size: 0.95rem;
}
/* Override Bootstrap 5 cell background — allow inline status colors on cells */
.table > :not(caption) > * > * { box-shadow: none !important; }
.table th, .table td {
    border-color: var(--border);
    padding: 0.6rem 0.75rem;
    vertical-align: middle;
}
.table th { white-space: nowrap; font-weight: 600; font-size: 0.88rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
td { word-break: break-word; overflow-wrap: anywhere; }

/* --- BUTTONS --- */
.btn { border-radius: 0.5rem; font-size: 0.95rem; transition: box-shadow 0.18s, background 0.18s; }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-sm { font-size: 0.88rem; padding: 0.3em 0.85em; border-radius: 0.4rem; }

/* --- FORMS --- */
.form-control {
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    background: #f9fbfd;
    font-size: 0.95rem;
}
.form-control:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 2px rgba(37,99,235,0.07);
}
.form-select { border-radius: 0.5rem; border: 1px solid var(--border); font-size: 0.95rem; }
.form-label { font-weight: 700; color: #374151; font-size: 0.9rem; }

/* --- PAGINATION --- */
.pagination .page-link {
    color: var(--primary);
    border-radius: 0.35rem;
    border: 1px solid var(--border);
    margin: 0 2px;
    font-size: 0.9rem;
}
.pagination .page-item.active .page-link, .pagination .page-link:hover {
    background: var(--primary); color: #fff; border-color: var(--primary);
}

/* --- STATUS BADGES --- */
.status-badge {
    display: inline-block;
    padding: 0.2em 0.65em;
    font-size: 0.85rem;
    border-radius: 0.35em;
    font-weight: 500;
}

/* Sprint statuses */
.status-1 { background: #e0f2fe; color: #0369a1; }
.status-2 { background: #e5eefd; color: #2563eb; }
.status-3 { background: #fef3c7; color: #92400e; }
.status-4 { background: #fce7f3; color: #be185d; }
.status-5 { background: #ffeaea; color: #e53e3e; }
.status-6 { background: #d1fae5; color: #065f46; }
.status-7 { background: #f1f5f9; color: #64748b; }

/* Copywriting task statuses */
.ct-status-1  { background: #e0f2fe; color: #0369a1; }
.ct-status-2  { background: #e5eefd; color: #2563eb; }
.ct-status-3  { background: #fef3c7; color: #92400e; }
.ct-status-4  { background: #dbeafe; color: #1d4ed8; }
.ct-status-5  { background: #fce7f3; color: #be185d; }
.ct-status-6  { background: #ede9fe; color: #6d28d9; }
.ct-status-7  { background: #e0e7ff; color: #4338ca; }
.ct-status-8  { background: #ffeaea; color: #e53e3e; }
.ct-status-9  { background: #fef3c7; color: #b45309; }
.ct-status-10 { background: #d1fae5; color: #065f46; }
.ct-status-11 { background: #ecfdf5; color: #047857; }

/* --- SIDEBAR PROFILE --- */
.sidebar-profile {
    display: flex; align-items: center; gap: 10px;
    padding: 0.75rem 0.85rem; margin: 0.5rem 0.65rem;
    border-radius: 0.65rem;
    background: linear-gradient(135deg, #f0f4fa 0%, #e8edf5 100%);
    border: 1px solid #dde4ee;
}
.sidebar-profile .profile-avatar-placeholder {
    width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 0.85rem; font-weight: 700; flex-shrink: 0;
}
.sidebar-profile .profile-info { flex: 1; min-width: 0; }
.sidebar-profile .profile-name {
    font-size: 0.8rem; font-weight: 600; color: #1e293b;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-profile .profile-role {
    display: inline-block; font-size: 0.6rem; font-weight: 700;
    text-transform: uppercase; padding: 0.1rem 0.4rem; border-radius: 0.25rem;
}
.sidebar-profile .profile-email {
    font-size: 0.68rem; color: #64748b;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-profile .logout-btn {
    width: 28px; height: 28px; border-radius: 0.4rem;
    color: #64748b; background: rgba(255,255,255,0.7); border: 1px solid #dde4ee;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; text-decoration: none; font-size: 0.9rem;
}
.sidebar-profile .logout-btn:hover { color: #fff; background: #e53e3e; border-color: #e53e3e; }

/* --- EMPTY STATE --- */
.empty-state { text-align: center; padding: 3rem 1.5rem; color: var(--text-muted); }
.empty-state-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.4; }
.empty-state-title { font-size: 1.1rem; font-weight: 600; color: var(--text); margin-bottom: 0.5rem; }

/* --- TABLE RESPONSIVE --- */
.card-body { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (min-width: 992px) { .card-body { overflow-x: visible; } }
.table-scroll-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Sticky filter card */
.filter-card-sticky {
    position: sticky; top: 0; z-index: 20;
    background: var(--bg); padding-bottom: 4px;
}

.table-scroll-wrapper .table thead th {
    position: sticky; top: 0; z-index: 10;
    background: #f8fafc; box-shadow: inset 0 -1px 0 var(--border);
}
.table-hover > tbody > tr:hover > * { background-color: rgba(37, 99, 235, 0.035) !important; }

/* --- MOBILE --- */
@media (max-width: 991px) {
    .main-content-area { padding: 1rem !important; }
    .sidebar { display: none; }
    .sidebar.show { display: flex !important; }
}

/* --- TOAST --- */
.toast-container { position: fixed; top: 80px; right: 1rem; z-index: 9999; max-width: 400px; }

/* --- LOGIN PAGE --- */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}
.login-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 1rem;
    padding: 2.5rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

/* --- SLIDE-OVER --- */
.slide-over-backdrop {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.18); z-index: 1050; cursor: pointer;
}
.slide-over-backdrop.show { display: block; }
.slide-over-panel {
    position: fixed; top: 0; right: -480px; width: 460px; max-width: 90vw;
    height: 100vh; background: #fff; z-index: 1051;
    box-shadow: -4px 0 24px rgba(0,0,0,0.12);
    transition: right 0.28s ease;
    display: flex; flex-direction: column;
}
.slide-over-panel.open { right: 0; }
.slide-over-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.25rem; border-bottom: 1px solid #e2e8f0;
}
.slide-over-body { flex: 1; overflow-y: auto; padding: 1.25rem; }
.slide-over-footer { border-top: 1px solid #e2e8f0; padding: 0.75rem 1.25rem; }

/* --- MULTI-SELECT FILTER --- */
.mf-wrap { position: relative; width: 100%; }
.mf-toggle { text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mf-menu {
    display: none; position: absolute; z-index: 1050; top: 100%; left: 0; right: 0;
    background: #fff; border: 1px solid var(--border); border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1); max-height: 250px; overflow-y: auto; padding: 0.25rem 0;
    margin-top: 2px;
}
.mf-menu.show { display: block; }
.mf-menu label {
    display: block; padding: 0.3rem 0.75rem; cursor: pointer; font-size: 0.88rem;
    white-space: nowrap; margin: 0;
}
.mf-menu label:hover { background: #f3f6fa; }
.mf-menu input[type="checkbox"] { margin-right: 0.4rem; vertical-align: middle; }

/* --- FOCUS VISIBLE --- */
a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--primary); outline-offset: 2px;
}
