/* ══════════════════════════════════════════════════════════════════════════════
   Zingoor CRM — Premium Design System
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── Design Tokens ────────────────────────────────────────────────────────── */
:root {
    /* Brand */
    --primary:      #F58220;
    --primary-h:    #E0740A;
    --primary-l:    #FF9F43;
    --primary-ghost:#FFF5EB;
    --primary-ring: rgba(245,130,32,.2);
    --magenta:      #E91E8C;
    --charcoal:     #1A1D21;
    --charcoal-l:   #23272B;

    /* Accent */
    --success:      #22C55E;
    --success-bg:   #F0FDF4;
    --danger:        #EF4444;
    --danger-bg:    #FEF2F2;
    --warning:      #F59E0B;
    --warning-bg:   #FFFBEB;
    --info:         #3B82F6;
    --info-bg:      #EFF6FF;
    --purple:       #8B5CF6;
    --teal:         #14B8A6;

    /* Neutral palette */
    --n-0:  #FFFFFF;
    --n-25: #FCFCFD;
    --n-50: #F8FAFC;
    --n-100:#F1F5F9;
    --n-150:#E8ECF1;
    --n-200:#E2E8F0;
    --n-300:#CBD5E1;
    --n-400:#94A3B8;
    --n-500:#64748B;
    --n-600:#475569;
    --n-700:#334155;
    --n-800:#1E293B;
    --n-900:#0F172A;

    /* Layout */
    --sidebar-w:    260px;
    --sidebar-collapsed: 68px;
    --header-h:     60px;
    --page-max:     1440px;

    /* Radii */
    --r-xs:  4px;
    --r-sm:  6px;
    --r:     8px;
    --r-md:  10px;
    --r-lg:  12px;
    --r-xl:  16px;
    --r-2xl: 20px;
    --r-full:9999px;

    /* Shadows */
    --sh-xs:  0 1px 2px rgba(0,0,0,.05);
    --sh-sm:  0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --sh:     0 2px 8px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.04);
    --sh-md:  0 4px 16px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
    --sh-lg:  0 8px 32px rgba(0,0,0,.10), 0 4px 8px rgba(0,0,0,.04);
    --sh-xl:  0 16px 48px rgba(0,0,0,.12);
    --sh-inner: inset 0 1px 2px rgba(0,0,0,.06);
    --sh-glow: 0 0 0 3px var(--primary-ring);
    --sh-card-hover: 0 8px 24px rgba(0,0,0,.08), 0 2px 8px rgba(0,0,0,.04);

    /* Transitions */
    --ease:  cubic-bezier(.4,0,.2,1);
    --ease-bounce: cubic-bezier(.34,1.56,.64,1);
    --t-fast: 120ms;
    --t:      200ms;
    --t-slow: 350ms;

    /* Typography */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

html {
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font);
    font-size: .9333rem;
    color: var(--n-800);
    background: var(--n-50);
    line-height: 1.6;
    overflow-x: hidden;
}

::selection { background: var(--primary-ring); color: var(--charcoal); }

a { color: var(--primary); text-decoration: none; transition: color var(--t) var(--ease); }
a:hover { color: var(--primary-h); }

img { max-width: 100%; }
hr { border: none; border-top: 1px solid var(--n-150); margin: 1.25rem 0; }

/* ══════════════════════════════════════════════════════════════════════════════
   LAYOUT
   ══════════════════════════════════════════════════════════════════════════════ */

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

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--charcoal);
    color: #fff;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 200;
    transition: transform var(--t-slow) var(--ease);
    display: flex;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.12) transparent;
}
.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 99px; }

.sidebar-logo {
    padding: 1.2rem 1.5rem;
    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: -.02em;
    color: #fff;
    display: flex;
    align-items: center;
    gap: .6rem;
    border-bottom: 1px solid rgba(255,255,255,.07);
    flex-shrink: 0;
}
.sidebar-logo span { color: var(--primary); }
.sidebar-logo:hover { text-decoration: none; }
.sidebar-logo-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px rgba(34,197,94,.5);
    animation: pulse-dot 2s ease infinite;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: .5; }
}

.sidebar-nav { padding: .5rem 0; flex: 1; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .65rem 1.35rem;
    color: rgba(255,255,255,.55);
    font-size: .83rem;
    font-weight: 500;
    letter-spacing: -.005em;
    transition: all var(--t) var(--ease);
    border-left: 3px solid transparent;
    position: relative;
}
.sidebar-nav a:hover {
    color: rgba(255,255,255,.92);
    background: rgba(255,255,255,.06);
    text-decoration: none;
}
.sidebar-nav a.active {
    color: #fff;
    background: rgba(245,130,32,.12);
    border-left-color: var(--primary);
    font-weight: 600;
}
.sidebar-nav a.active .nav-icon { color: var(--primary); }

.nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    transition: transform var(--t) var(--ease-bounce);
}
.sidebar-nav a:hover .nav-icon { transform: scale(1.12); }

.sidebar-section {
    font-size: .65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: rgba(255,255,255,.25);
    padding: 1.5rem 1.5rem .5rem;
}
.sidebar-footer {
    padding: .75rem 1rem;
    border-top: 1px solid rgba(255,255,255,.07);
    flex-shrink: 0;
}

/* ── Main Content Area ────────────────────────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--n-50);
}

/* ── Top Bar ──────────────────────────────────────────────────────────────── */
.topbar {
    height: var(--header-h);
    background: var(--n-0);
    border-bottom: 1px solid var(--n-150);
    display: flex;
    align-items: center;
    padding: 0 1.75rem;
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 1rem;
    backdrop-filter: blur(12px);
    background: rgba(255,255,255,.88);
}
.topbar-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--n-800);
    letter-spacing: -.015em;
}
.topbar-spacer { flex: 1; }
.topbar-user {
    display: flex;
    align-items: center;
    gap: .65rem;
    font-size: .82rem;
    font-weight: 500;
    color: var(--n-600);
    padding: .35rem .5rem .35rem .75rem;
    border-radius: var(--r-full);
    transition: background var(--t) var(--ease);
    cursor: default;
}
.topbar-user:hover { background: var(--n-100); }

.topbar-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-l));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .02em;
    box-shadow: 0 2px 6px rgba(245,130,32,.25);
}

.topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .82rem;
    color: var(--n-400);
}
.topbar-breadcrumb a { color: var(--n-500); }
.topbar-breadcrumb a:hover { color: var(--primary); }
.topbar-breadcrumb-sep { color: var(--n-300); }

/* ── Page Content ─────────────────────────────────────────────────────────── */
.page-content {
    padding: 1.75rem;
    flex: 1;
    max-width: var(--page-max);
    width: 100%;
}

.page-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
}
.page-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--n-900);
    letter-spacing: -.025em;
    line-height: 1.2;
}
.page-header .spacer { flex: 1; }

/* ══════════════════════════════════════════════════════════════════════════════
   COMPONENTS
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── Cards ────────────────────────────────────────────────────────────────── */
.card {
    background: var(--n-0);
    border: 1px solid var(--n-150);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-xs);
    transition: box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
}
.card:hover { box-shadow: var(--sh-sm); }
.card-header {
    padding: .85rem 1.25rem;
    border-bottom: 1px solid var(--n-100);
    font-weight: 700;
    font-size: .88rem;
    color: var(--n-800);
    display: flex;
    align-items: center;
    gap: .75rem;
    background: var(--n-25);
    border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.card-body { padding: 1.25rem; }
.card-footer {
    padding: .75rem 1.25rem;
    border-top: 1px solid var(--n-100);
    background: var(--n-25);
    border-radius: 0 0 var(--r-lg) var(--r-lg);
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .55rem 1.3rem;
    font-size: .82rem;
    font-weight: 600;
    border: 1.5px solid transparent;
    border-radius: var(--r);
    cursor: pointer;
    transition: all var(--t) var(--ease);
    text-decoration: none !important;
    white-space: nowrap;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}
.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(255,255,255,.12), transparent);
    pointer-events: none;
    border-radius: inherit;
}
.btn:active { transform: scale(.97); }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #E8750F);
    color: #fff;
    border-color: var(--primary-h);
    box-shadow: 0 1px 3px rgba(245,130,32,.25), inset 0 1px 0 rgba(255,255,255,.15);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #E8750F, var(--primary));
    box-shadow: 0 3px 10px rgba(245,130,32,.3), inset 0 1px 0 rgba(255,255,255,.15);
    color: #fff;
}

.btn-success { background: var(--success); color: #fff; box-shadow: 0 1px 3px rgba(34,197,94,.2); }
.btn-success:hover { background: #16A34A; color: #fff; }
.btn-danger  { background: var(--danger); color: #fff; box-shadow: 0 1px 3px rgba(239,68,68,.2); }
.btn-danger:hover  { background: #DC2626; color: #fff; }
.btn-info    { background: var(--info); color: #fff; }

.btn-outline {
    background: var(--n-0);
    color: var(--n-700);
    border-color: var(--n-200);
    box-shadow: var(--sh-xs);
}
.btn-outline::after { display: none; }
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-ghost);
    box-shadow: 0 0 0 3px rgba(245,130,32,.08);
}

.btn-ghost {
    background: transparent;
    color: var(--n-600);
    border: none;
    box-shadow: none;
}
.btn-ghost::after { display: none; }
.btn-ghost:hover { background: var(--n-100); color: var(--n-800); }

.btn-sm { padding: .35rem .85rem; font-size: .76rem; border-radius: var(--r-sm); }
.btn-lg { padding: .7rem 1.75rem; font-size: .9rem; border-radius: var(--r-md); }
.btn-icon { padding: .5rem; width: 36px; height: 36px; }
.btn-icon.btn-sm { width: 30px; height: 30px; padding: .3rem; }

/* ── Forms ─────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }
.form-label {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    color: var(--n-600);
    margin-bottom: .35rem;
    letter-spacing: -.005em;
}
.form-control {
    width: 100%;
    padding: .55rem .85rem;
    font-size: .88rem;
    border: 1.5px solid var(--n-200);
    border-radius: var(--r);
    background: var(--n-0);
    color: var(--n-800);
    transition: all var(--t) var(--ease);
    font-family: inherit;
    box-shadow: var(--sh-inner);
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--sh-glow), var(--sh-inner);
}
.form-control::placeholder { color: var(--n-400); }
.form-control:hover:not(:focus) { border-color: var(--n-300); }
.form-control.is-invalid { border-color: var(--danger); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(239,68,68,.15); }

.form-error { font-size: .76rem; color: var(--danger); margin-top: .3rem; display: flex; align-items: center; gap: .3rem; }
.form-help  { font-size: .76rem; color: var(--n-400); margin-top: .3rem; }

textarea.form-control { resize: vertical; min-height: 90px; line-height: 1.6; }
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394A3B8'%3E%3Cpath d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .75rem center;
    padding-right: 2.25rem;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

.form-check { display: flex; align-items: center; gap: .5rem; }
.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 18px; height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}
.form-check label { cursor: pointer; font-size: .85rem; color: var(--n-700); }

.form-switch {
    position: relative;
    display: inline-block;
    width: 42px; height: 24px;
}
.form-switch input { opacity: 0; width: 0; height: 0; }
.form-switch .slider {
    position: absolute; inset: 0;
    background: var(--n-300);
    border-radius: var(--r-full);
    cursor: pointer;
    transition: var(--t) var(--ease);
}
.form-switch .slider::before {
    content: '';
    position: absolute;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #fff;
    left: 3px; bottom: 3px;
    box-shadow: var(--sh-sm);
    transition: var(--t) var(--ease);
}
.form-switch input:checked + .slider { background: var(--primary); }
.form-switch input:checked + .slider::before { transform: translateX(18px); }

/* ── Tables ────────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
    padding: .65rem 1rem;
    text-align: left;
    font-weight: 700;
    color: var(--n-500);
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    border-bottom: 2px solid var(--n-150);
    background: var(--n-25);
    white-space: nowrap;
    position: sticky;
    top: 0;
}
td {
    padding: .65rem 1rem;
    text-align: left;
    font-size: .85rem;
    border-bottom: 1px solid var(--n-100);
    color: var(--n-700);
    vertical-align: middle;
}
tr { transition: background var(--t-fast) var(--ease); }
tr:hover td { background: var(--n-50); }
tr.task-done { opacity: .55; }
tr.task-done:hover { opacity: .75; }

/* ── Alerts ────────────────────────────────────────────────────────────────── */
.alert {
    padding: .85rem 1.1rem;
    border-radius: var(--r-md);
    font-size: .84rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: .6rem;
    border-left: 4px solid;
    animation: slideDown .3s var(--ease) both;
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

.alert-success { background: var(--success-bg); color: #166534; border-left-color: var(--success); }
.alert-error   { background: var(--danger-bg);  color: #991B1B; border-left-color: var(--danger); }
.alert-warning { background: var(--warning-bg); color: #92400E; border-left-color: var(--warning); }
.alert-info    { background: var(--info-bg);    color: #1E40AF; border-left-color: var(--info); }

/* ── Badges ────────────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .2rem .6rem;
    font-size: .7rem;
    font-weight: 700;
    border-radius: var(--r-full);
    line-height: 1.4;
    letter-spacing: .01em;
    white-space: nowrap;
}
.badge-green  { background: #DCFCE7; color: #15803D; }
.badge-red    { background: #FEE2E2; color: #B91C1C; }
.badge-yellow { background: #FEF3C7; color: #A16207; }
.badge-blue   { background: #DBEAFE; color: #1D4ED8; }
.badge-gray   { background: var(--n-100); color: var(--n-600); }
.badge-purple { background: #EDE9FE; color: #7C3AED; }
.badge-orange { background: var(--primary-ghost); color: var(--primary-h); }
.badge-teal   { background: #CCFBF1; color: #0D9488; }

.badge-dot::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* ── Stat Cards (Dashboard) ───────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.1rem;
    margin-bottom: 1.75rem;
}
.stat-card {
    background: var(--n-0);
    border: 1px solid var(--n-150);
    border-radius: var(--r-lg);
    padding: 1.35rem 1.4rem;
    position: relative;
    overflow: hidden;
    transition: all var(--t) var(--ease);
}
.stat-card:hover {
    box-shadow: var(--sh-md);
    border-color: var(--n-200);
    transform: translateY(-2px);
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--primary);
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    opacity: 0;
    transition: opacity var(--t) var(--ease);
}
.stat-card:hover::before { opacity: 1; }

.stat-icon {
    width: 40px; height: 40px;
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    margin-bottom: .85rem;
}
.stat-icon-orange { background: var(--primary-ghost); color: var(--primary); }
.stat-icon-blue   { background: #DBEAFE; color: var(--info); }
.stat-icon-green  { background: #DCFCE7; color: var(--success); }
.stat-icon-red    { background: #FEE2E2; color: var(--danger); }
.stat-icon-purple { background: #EDE9FE; color: var(--purple); }

.stat-label {
    font-size: .72rem;
    font-weight: 700;
    color: var(--n-400);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: .3rem;
}
.stat-value {
    font-size: 1.85rem;
    font-weight: 900;
    color: var(--n-900);
    letter-spacing: -.03em;
    line-height: 1;
}
.stat-sub {
    font-size: .76rem;
    color: var(--n-500);
    margin-top: .35rem;
    display: flex;
    align-items: center;
    gap: .35rem;
}
.stat-trend-up { color: var(--success); font-weight: 700; }
.stat-trend-down { color: var(--danger); font-weight: 700; }

/* ── Kanban Board ─────────────────────────────────────────────────────────── */
.kanban-board {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    min-height: calc(100vh - 200px);
    scroll-behavior: smooth;
}
.kanban-board::-webkit-scrollbar { height: 8px; }
.kanban-board::-webkit-scrollbar-thumb { background: var(--n-300); border-radius: 99px; }

.kanban-column {
    min-width: 290px;
    max-width: 320px;
    flex-shrink: 0;
    background: var(--n-100);
    border-radius: var(--r-lg);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--n-150);
}
.kanban-column-header {
    padding: .85rem 1rem;
    display: flex;
    align-items: center;
    gap: .6rem;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    background: var(--n-0);
    border-bottom: 1px solid var(--n-150);
    position: relative;
}
.kanban-column-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.kanban-column-title { font-weight: 800; font-size: .82rem; color: var(--n-800); letter-spacing: -.01em; }
.kanban-column-count {
    background: var(--n-100);
    color: var(--n-500);
    font-size: .68rem;
    font-weight: 800;
    padding: .15rem .5rem;
    border-radius: var(--r-full);
    min-width: 20px;
    text-align: center;
}

.kanban-cards {
    flex: 1;
    padding: .5rem;
    overflow-y: auto;
    min-height: 100px;
    transition: background var(--t) var(--ease);
}
.kanban-cards.drag-over {
    background: rgba(245,130,32,.06);
    border-radius: 0 0 var(--r-lg) var(--r-lg);
}

.kanban-card {
    background: var(--n-0);
    border: 1px solid var(--n-200);
    border-radius: var(--r-md);
    padding: .85rem;
    margin-bottom: .5rem;
    cursor: grab;
    transition: all var(--t) var(--ease);
    position: relative;
    box-shadow: var(--sh-xs);
}
.kanban-card:hover {
    box-shadow: var(--sh-md);
    border-color: var(--n-300);
    transform: translateY(-1px);
}
.kanban-card.dragging {
    opacity: .6;
    transform: rotate(2deg) scale(1.02);
    box-shadow: var(--sh-lg);
}
.kanban-card:active { cursor: grabbing; }

.kanban-card-priority {
    position: absolute;
    top: 0; left: 0;
    width: 4px;
    height: 100%;
    border-radius: var(--r-md) 0 0 var(--r-md);
}
.kanban-card-title {
    display: block;
    font-size: .84rem;
    font-weight: 600;
    color: var(--n-800);
    margin-left: 8px;
    margin-bottom: .35rem;
    line-height: 1.45;
    letter-spacing: -.01em;
}
.kanban-card-title:hover { color: var(--primary); text-decoration: none; }
.kanban-card-project {
    font-size: .72rem;
    color: var(--n-400);
    margin-left: 8px;
    margin-bottom: .35rem;
}
.kanban-card-meta {
    display: flex;
    align-items: center;
    gap: .4rem;
    margin-left: 8px;
    font-size: .7rem;
    color: var(--n-500);
}
.kanban-card-due {
    padding: .12rem .4rem;
    background: var(--n-100);
    border-radius: var(--r-xs);
    font-weight: 600;
}
.kanban-card-due.overdue {
    background: var(--danger-bg);
    color: #B91C1C;
}
.kanban-card-check {
    padding: .12rem .4rem;
    background: var(--n-100);
    border-radius: var(--r-xs);
    font-weight: 600;
}
.kanban-avatar {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-l));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .58rem;
    font-weight: 800;
    border: 2px solid var(--n-0);
    margin-left: -6px;
}
.kanban-avatar:first-child { margin-left: 0; }

/* ── Progress Bar ─────────────────────────────────────────────────────────── */
.progress {
    height: 6px;
    background: var(--n-150);
    border-radius: var(--r-full);
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    border-radius: var(--r-full);
    background: linear-gradient(90deg, var(--primary), var(--primary-l));
    transition: width .6s var(--ease);
}
.progress-bar.success { background: linear-gradient(90deg, var(--success), #34D399); }

/* ── Toggle button for done/undone ────────────────────────────────────────── */
.task-done-toggle {
    width: 22px; height: 22px;
    border-radius: 50%;
    border: 2px solid var(--n-300);
    background: var(--n-0);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all var(--t) var(--ease);
    flex-shrink: 0;
}
.task-done-toggle:hover {
    border-color: var(--success);
    background: rgba(34,197,94,.08);
    transform: scale(1.12);
}
.task-done-toggle.is-done {
    border-color: var(--success);
    background: var(--success);
}
.task-done-toggle.is-done::after {
    content: '✓';
    color: #fff;
    font-size: 11px;
    font-weight: 800;
}

/* ── Empty State ──────────────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3.5rem 2rem;
}
.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: .5;
}
.empty-state-title {
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--n-700);
    margin-bottom: .35rem;
}
.empty-state-desc {
    font-size: .85rem;
    color: var(--n-400);
    max-width: 340px;
    margin: 0 auto .75rem;
    line-height: 1.6;
}

/* ── Pill Tabs ────────────────────────────────────────────────────────────── */
.pill-tabs {
    display: inline-flex;
    gap: .25rem;
    background: var(--n-100);
    padding: .25rem;
    border-radius: var(--r);
}
.pill-tab {
    padding: .4rem .9rem;
    font-size: .78rem;
    font-weight: 600;
    color: var(--n-500);
    border-radius: var(--r-sm);
    transition: all var(--t) var(--ease);
    border: none;
    background: transparent;
    cursor: pointer;
    text-decoration: none !important;
}
.pill-tab:hover { color: var(--n-700); background: rgba(255,255,255,.5); }
.pill-tab.active {
    color: var(--n-800);
    background: var(--n-0);
    box-shadow: var(--sh-sm);
}

/* ── Tooltips ─────────────────────────────────────────────────────────────── */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: var(--n-800);
    color: #fff;
    font-size: .7rem;
    font-weight: 600;
    padding: .35rem .6rem;
    border-radius: var(--r-sm);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all var(--t-fast) var(--ease);
    z-index: 300;
}
[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Dropdown / Popover ───────────────────────────────────────────────────── */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: var(--n-0);
    border: 1px solid var(--n-150);
    border-radius: var(--r-md);
    box-shadow: var(--sh-lg);
    min-width: 180px;
    padding: .35rem;
    z-index: 250;
    opacity: 0;
    transform: translateY(-4px) scale(.97);
    pointer-events: none;
    transition: all var(--t-fast) var(--ease);
}
.dropdown.open .dropdown-menu {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
.dropdown-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem .75rem;
    font-size: .82rem;
    color: var(--n-700);
    border-radius: var(--r-sm);
    transition: background var(--t-fast) var(--ease);
}
.dropdown-item:hover {
    background: var(--n-100);
    text-decoration: none;
}
.dropdown-divider { height: 1px; background: var(--n-100); margin: .25rem 0; }

/* ── Tags Input ───────────────────────────────────────────────────────────── */
.tag {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .2rem .5rem;
    font-size: .72rem;
    font-weight: 600;
    border-radius: var(--r-sm);
    background: var(--n-100);
    color: var(--n-600);
}
.tag-remove {
    cursor: pointer;
    font-size: .8rem;
    color: var(--n-400);
    transition: color var(--t-fast);
}
.tag-remove:hover { color: var(--danger); }

/* ══════════════════════════════════════════════════════════════════════════════
   AUTH PAGES
   ══════════════════════════════════════════════════════════════════════════════ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse at 20% 80%, rgba(245,130,32,.06) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(233,30,140,.04) 0%, transparent 60%),
        var(--n-50);
    padding: 1.5rem;
}
.auth-card {
    background: var(--n-0);
    border: 1px solid var(--n-150);
    border-radius: var(--r-xl);
    box-shadow: var(--sh-lg);
    width: 100%;
    max-width: 440px;
    padding: 2.75rem 2.25rem;
    position: relative;
    overflow: hidden;
}
.auth-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--magenta));
}
.auth-logo {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--n-900);
    margin-bottom: .5rem;
    letter-spacing: -.03em;
}
.auth-logo span { color: var(--primary); }
.auth-tagline {
    text-align: center;
    font-size: .78rem;
    color: var(--n-400);
    margin-bottom: 2.25rem;
}
.auth-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--n-900);
    margin-bottom: .3rem;
    letter-spacing: -.02em;
}
.auth-subtitle {
    font-size: .84rem;
    color: var(--n-400);
    margin-bottom: 1.75rem;
    line-height: 1.5;
}
.auth-divider {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 1.75rem 0;
    font-size: .76rem;
    color: var(--n-400);
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--n-200);
}

/* ══════════════════════════════════════════════════════════════════════════════
   UTILITIES
   ══════════════════════════════════════════════════════════════════════════════ */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--n-400); }
.text-sm     { font-size: .8rem; }
.text-xs     { font-size: .72rem; }
.text-success{ color: var(--success); }
.text-danger { color: var(--danger); }
.text-primary{ color: var(--primary); }

.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }

.mt-1  { margin-top: .5rem; }
.mt-2  { margin-top: 1rem; }
.mt-3  { margin-top: 1.5rem; }
.mt-4  { margin-top: 2rem; }
.mb-1  { margin-bottom: .5rem; }
.mb-2  { margin-bottom: 1rem; }
.mb-3  { margin-bottom: 1.5rem; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }

.flex       { display: flex; }
.inline-flex { display: inline-flex; }
.flex-wrap  { flex-wrap: wrap; }
.items-center   { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }

.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 1024px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ── Skeleton Loading ─────────────────────────────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg, var(--n-100) 25%, var(--n-150) 50%, var(--n-100) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease infinite;
    border-radius: var(--r-sm);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Scroll Shadows ───────────────────────────────────────────────────────── */
.scroll-shadow-y {
    overflow-y: auto;
    background: linear-gradient(var(--n-0) 30%, rgba(255,255,255,0)),
                linear-gradient(rgba(255,255,255,0), var(--n-0) 70%) 0 100%,
                linear-gradient(rgba(0,0,0,.04), rgba(0,0,0,0)),
                linear-gradient(rgba(0,0,0,0), rgba(0,0,0,.04)) 0 100%;
    background-repeat: no-repeat;
    background-size: 100% 40px, 100% 40px, 100% 12px, 100% 12px;
    background-attachment: local, local, scroll, scroll;
}

/* ── Focus Ring (for keyboard navigation) ─────────────────────────────────── */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════════════════════ */
.sidebar-toggle {
    display: none;
    cursor: pointer;
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--n-600);
    padding: .25rem;
    border-radius: var(--r-sm);
    transition: background var(--t-fast);
}
.sidebar-toggle:hover { background: var(--n-100); }

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--sh-xl);
    }
    .main-content { margin-left: 0; }
    .sidebar-toggle { display: flex; align-items: center; justify-content: center; }
    .page-content { padding: 1rem; }
    .page-header h1 { font-size: 1.2rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .kanban-board { min-height: auto; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .auth-card { padding: 2rem 1.5rem; }
}

/* ── Dark scrollbar on content ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--n-300); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--n-400); border: 2px solid transparent; background-clip: padding-box; }

/* ── Print Styles ─────────────────────────────────────────────────────────── */
@media print {
    .sidebar, .topbar, .sidebar-toggle { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .page-content { padding: 0 !important; }
    .btn, .alert { box-shadow: none !important; }
}
