/* ============================================================
   CONTIZZE CONTABILIDADE — DESIGN SYSTEM v2
   Primary: #1a56db  Accent: #ff6b35  Dark: #0f172a
   ============================================================ */

/* ── TOKENS ── */
:root {
    --blue:          #1a56db;
    --blue-dark:     #1e3a8a;
    --blue-light:    #3b82f6;
    --blue-pale:     #dbeafe;
    --blue-xpale:    #eff6ff;
    --orange:        #ff6b35;
    --orange-dark:   #e05a2b;
    --orange-pale:   #fff3ee;
    --sidebar-bg:    #0d1f4e;
    --sidebar-hover: rgba(255,255,255,.07);
    --sidebar-active:#1a56db;
    --sidebar-w:     260px;
    --sidebar-col:   70px;
    --bg:            #f0f4fa;
    --surface:       #ffffff;
    --surface-2:     #f8fafc;
    --text:          #0f172a;
    --text-2:        #475569;
    --text-3:        #94a3b8;
    --border:        #e2e8f0;
    --r-sm:  8px;
    --r:     12px;
    --r-lg:  16px;
    --r-xl:  20px;
    --sh-sm: 0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
    --sh:    0 4px 16px rgba(15,23,42,.08);
    --sh-lg: 0 12px 32px rgba(15,23,42,.12);
    --sh-xl: 0 24px 48px rgba(15,23,42,.16);
    --t:     all .22s cubic-bezier(.4,0,.2,1);
    --t-fast:all .12s ease;
    --green: #10b981;
    --yellow:#f59e0b;
    --red:   #ef4444;
    --cyan:  #06b6d4;
    --wapp:  #25d366;
    --font:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 15px; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; padding: 0; margin: 0; }
img { max-width: 100%; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── PAGE LOADER ── */
#page-loader {
    position: fixed; top: 0; left: 0; right: 0;
    height: 3px; z-index: 9999;
    background: linear-gradient(90deg, var(--blue), var(--orange), var(--blue));
    background-size: 200% 100%;
    animation: loaderBar .6s ease forwards, loaderShine 1.2s linear infinite;
    transform-origin: left;
}
@keyframes loaderBar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes loaderShine { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── LAYOUT ── */
.layout-wrapper { display: flex; min-height: 100vh; }

/* ────────────────────────────────────────────────────────────
   SIDEBAR
   ──────────────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: var(--sidebar-bg);
    display: flex; flex-direction: column;
    position: fixed; top: 0; left: 0; bottom: 0;
    z-index: 200;
    transition: width .28s cubic-bezier(.4,0,.2,1);
    box-shadow: 4px 0 24px rgba(0,0,0,.18);
    overflow: hidden;
}

.sidebar-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.25rem 1rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,.07);
    min-height: 68px;
}

.logo-container { display: flex; align-items: center; gap: .75rem; overflow: hidden; }

.sidebar-logo {
    height: 36px; width: auto; object-fit: contain;
    filter: brightness(0) invert(1);
    flex-shrink: 0;
    transition: var(--t);
}

.sidebar-toggle-btn {
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.1);
    color: #94a3b8;
    width: 32px; height: 32px; border-radius: var(--r-sm);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0;
    transition: var(--t);
    font-size: .85rem;
}
.sidebar-toggle-btn:hover { background: rgba(255,255,255,.15); color: #fff; }

.sidebar-user {
    display: flex; align-items: center; gap: .75rem;
    padding: 1rem 1rem .85rem;
    border-bottom: 1px solid rgba(255,255,255,.06);
    overflow: hidden;
}

.user-avatar {
    width: 36px; height: 36px; border-radius: 10px;
    background: linear-gradient(135deg, var(--blue), var(--orange));
    color: #fff; font-weight: 700; font-size: .9rem;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; box-shadow: 0 2px 8px rgba(26,86,219,.4);
}

.user-info { overflow: hidden; }
.user-name { display: block; color: #e2e8f0; font-size: .83rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: .65rem; font-weight: 600; letter-spacing: .04em; padding: 2px 7px; border-radius: 99px; }
.badge-admin  { background: rgba(26,86,219,.3); color: #93c5fd; }
.badge-client { background: rgba(16,185,129,.25); color: #6ee7b7; }

.sidebar-nav { padding: .75rem 0; flex: 1; overflow-y: auto; overflow-x: hidden; }

.nav-section {
    font-size: .65rem; font-weight: 700; letter-spacing: .1em;
    text-transform: uppercase; color: rgba(148,163,184,.5);
    padding: .85rem 1.1rem .3rem;
    white-space: nowrap; overflow: hidden;
}

.nav-link {
    display: flex; align-items: center; gap: .85rem;
    padding: .62rem 1rem;
    color: #94a3b8;
    border-radius: var(--r-sm);
    margin: 1px .5rem;
    transition: var(--t);
    font-size: .83rem; font-weight: 500;
    white-space: nowrap; overflow: hidden;
    position: relative;
}
.nav-link i { font-size: .95rem; width: 20px; text-align: center; flex-shrink: 0; transition: var(--t); }
.nav-link span { overflow: hidden; text-overflow: ellipsis; }

.nav-link:hover {
    background: var(--sidebar-hover);
    color: #e2e8f0;
    transform: translateX(2px);
}
.nav-link:hover i { color: var(--blue-light); }

.nav-link.active {
    background: linear-gradient(135deg, rgba(26,86,219,.35), rgba(26,86,219,.15));
    color: #fff;
    box-shadow: inset 3px 0 0 var(--blue-light);
}
.nav-link.active i { color: var(--blue-light); }
.nav-link.active::after {
    content: ''; position: absolute; left: 0; top: 20%; bottom: 20%;
    width: 3px; background: var(--blue-light); border-radius: 0 3px 3px 0;
}

.logout-link:hover { background: rgba(239,68,68,.15) !important; color: #fca5a5 !important; }
.logout-link:hover i { color: #f87171 !important; }

.sidebar-footer { padding: .5rem .5rem .75rem; border-top: 1px solid rgba(255,255,255,.06); }

/* ── Sidebar collapsed ── */
.sidebar.collapsed { width: var(--sidebar-col); }
.sidebar.collapsed .nav-section,
.sidebar.collapsed .user-info,
.sidebar.collapsed .nav-link span { opacity: 0; width: 0; overflow: hidden; }
.sidebar.collapsed .nav-link { justify-content: center; gap: 0; padding: .65rem; }
.sidebar.collapsed .nav-link:hover { transform: none; }
.sidebar.collapsed .nav-link.active::after { display: none; }
.sidebar.collapsed .user-avatar { margin: 0 auto; }
.sidebar.collapsed .sidebar-logo { height: 26px; }
.sidebar.collapsed .sidebar-toggle-btn { margin: 0 auto; }
.sidebar.collapsed .logo-container { justify-content: center; }
.sidebar.collapsed .sidebar-user { justify-content: center; }

/* ────────────────────────────────────────────────────────────
   MAIN CONTENT
   ──────────────────────────────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1; min-width: 0;
    transition: margin-left .28s cubic-bezier(.4,0,.2,1);
    display: flex; flex-direction: column; min-height: 100vh;
}
.main-content.expanded { margin-left: var(--sidebar-col); }

/* ── Top Header ── */
.top-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 1.75rem;
    height: 62px;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 100;
    box-shadow: 0 1px 0 rgba(0,0,0,.05);
}

.header-left { display: flex; align-items: center; gap: 1rem; }

.page-title {
    font-size: 1.15rem; font-weight: 700;
    color: var(--text); letter-spacing: -.3px;
}

.mobile-toggle {
    display: none; background: none; border: none;
    color: var(--text-2); font-size: 1.1rem; cursor: pointer;
    padding: .4rem; border-radius: var(--r-sm);
}
.mobile-toggle:hover { background: var(--bg); }

.header-right { display: flex; align-items: center; gap: 1rem; }

.header-date {
    display: flex; align-items: center; gap: .5rem;
    font-size: .78rem; color: var(--text-3); font-weight: 500;
}
.header-date i { color: var(--blue); }

/* ── Content Area ── */
.content-area {
    padding: 1.75rem;
    animation: fadeUp .3s ease;
    flex: 1;
}
@keyframes fadeUp { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:none; } }

/* ── Alerts ── */
.alerts-container { margin-bottom: 1.25rem; }
.alert {
    border: none; border-radius: var(--r);
    padding: .85rem 1.1rem; font-size: .83rem;
    box-shadow: var(--sh-sm);
    animation: slideDown .2s ease;
}
@keyframes slideDown { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:none; } }
.alert-success { background: #ecfdf5; color: #065f46; }
.alert-danger   { background: #fef2f2; color: #991b1b; }
.alert-warning  { background: #fffbeb; color: #92400e; }
.alert-info     { background: #eff6ff; color: #1e40af; }

/* ────────────────────────────────────────────────────────────
   TOAST NOTIFICATIONS
   ──────────────────────────────────────────────────────────── */
#toast-container {
    position: fixed; bottom: 1.5rem; right: 1.5rem;
    z-index: 9998; display: flex; flex-direction: column; gap: .6rem;
    pointer-events: none;
}
.toast-item {
    background: var(--text);
    color: #f8fafc;
    padding: .75rem 1.1rem .75rem .9rem;
    border-radius: var(--r);
    font-size: .83rem; font-weight: 500;
    box-shadow: var(--sh-lg);
    display: flex; align-items: center; gap: .65rem;
    pointer-events: all;
    animation: toastIn .25s cubic-bezier(.34,1.56,.64,1);
    max-width: 320px;
    border-left: 3px solid var(--blue);
}
.toast-item.toast-success { border-color: var(--green); }
.toast-item.toast-danger  { border-color: var(--red); }
.toast-item.toast-warning { border-color: var(--yellow); }
.toast-item.toast-out { animation: toastOut .2s ease forwards; }
@keyframes toastIn  { from { opacity:0; transform:translateX(20px) scale(.95); } to { opacity:1; transform:none; } }
@keyframes toastOut { from { opacity:1; transform:none; } to { opacity:0; transform:translateX(20px); } }

/* ────────────────────────────────────────────────────────────
   SECTION HEADER
   ──────────────────────────────────────────────────────────── */
.section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1.25rem;
}
.section-title {
    font-size: 1.05rem; font-weight: 700; color: var(--text);
    display: flex; align-items: center; gap: .5rem;
}
.section-title i { color: var(--blue); }

/* ────────────────────────────────────────────────────────────
   STATS CARDS
   ──────────────────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.1rem;
    margin-bottom: 1.75rem;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--r-lg);
    padding: 1.4rem 1.5rem;
    display: flex; align-items: center; gap: 1.1rem;
    box-shadow: var(--sh-sm);
    border: 1px solid var(--border);
    transition: var(--t);
    position: relative; overflow: hidden;
    cursor: default;
}
.stat-card::before {
    content: ''; position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--sh-lg); }

.stat-blue::before  { background: linear-gradient(90deg, var(--blue), var(--blue-light)); }
.stat-orange::before{ background: linear-gradient(90deg, var(--orange), #fb923c); }
.stat-warning::before { background: linear-gradient(90deg, var(--yellow), #fbbf24); }
.stat-success::before { background: linear-gradient(90deg, var(--green), #34d399); }

.stat-icon {
    width: 52px; height: 52px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; flex-shrink: 0;
}
.stat-blue   .stat-icon { background: var(--blue-pale); color: var(--blue); }
.stat-orange .stat-icon { background: var(--orange-pale); color: var(--orange); }
.stat-warning .stat-icon { background: #fef3c7; color: var(--yellow); }
.stat-success .stat-icon { background: #d1fae5; color: var(--green); }

.stat-info { display: flex; flex-direction: column; gap: .1rem; }
.stat-value { font-size: 1.8rem; font-weight: 800; color: var(--text); line-height: 1; letter-spacing: -1px; }
.stat-label { font-size: .75rem; font-weight: 500; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }

/* ────────────────────────────────────────────────────────────
   KANBAN BOARD
   ──────────────────────────────────────────────────────────── */
.kanban-board {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem; margin-bottom: 2rem;
}

.kanban-column {
    background: var(--surface-2);
    border-radius: var(--r-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--sh-sm);
}

.kanban-header {
    padding: .85rem 1.1rem;
    display: flex; align-items: center; justify-content: space-between;
    font-weight: 700; font-size: .83rem; letter-spacing: .02em;
}
.kanban-todo  { background: linear-gradient(135deg, #f0f4fa, #e8eef8); color: var(--text-2); border-bottom: 2px solid #94a3b8; }
.kanban-doing { background: linear-gradient(135deg, #eff6ff, #dbeafe); color: var(--blue-dark); border-bottom: 2px solid var(--blue); }
.kanban-done  { background: linear-gradient(135deg, #ecfdf5, #d1fae5); color: #065f46; border-bottom: 2px solid var(--green); }

.kanban-count {
    background: rgba(255,255,255,.7);
    backdrop-filter: blur(4px);
    padding: 2px 9px; border-radius: 99px;
    font-size: .72rem; font-weight: 700;
}

.kanban-cards { padding: .75rem; display: flex; flex-direction: column; gap: .6rem; min-height: 80px; }

.kanban-card {
    background: var(--surface);
    border-radius: var(--r);
    padding: .9rem 1rem;
    box-shadow: var(--sh-sm);
    border: 1px solid var(--border);
    transition: var(--t);
    cursor: pointer;
}
.kanban-card:hover { transform: translateY(-2px); box-shadow: var(--sh); border-color: #c7d7fd; }

.card-overdue { border-left: 3px solid var(--red); }
.card-done    { opacity: .75; }

.card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }

.priority-badge {
    font-size: .65rem; font-weight: 700; letter-spacing: .04em;
    padding: 2px 8px; border-radius: 99px; text-transform: uppercase;
}
.priority-low    { background: #d1fae5; color: #065f46; }
.priority-normal { background: var(--blue-pale); color: var(--blue-dark); }
.priority-high   { background: #fee2e2; color: #991b1b; }
.priority-done   { background: #f1f5f9; color: var(--text-3); }

.card-delete {
    background: none; border: none; color: var(--text-3);
    width: 22px; height: 22px; border-radius: 5px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: .7rem; transition: var(--t-fast);
}
.card-delete:hover { background: #fee2e2; color: var(--red); }

.card-title { font-size: .85rem; font-weight: 600; color: var(--text); margin-bottom: .35rem; line-height: 1.3; }
.card-desc  { font-size: .75rem; color: var(--text-2); margin-bottom: .4rem; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.card-client {
    display: inline-flex; align-items: center; gap: .3rem;
    font-size: .72rem; color: var(--blue); font-weight: 500;
    background: var(--blue-xpale); padding: 2px 8px; border-radius: 99px;
    margin-bottom: .35rem;
}

.card-date { font-size: .72rem; color: var(--text-3); display: flex; align-items: center; gap: .3rem; margin-bottom: .5rem; }

.card-actions { display: flex; gap: .4rem; padding-top: .4rem; border-top: 1px solid var(--border); }

.btn-move {
    flex: 1; padding: .3rem .5rem;
    border: 1px solid var(--border); background: var(--surface-2);
    border-radius: var(--r-sm); font-size: .72rem; font-weight: 600;
    cursor: pointer; color: var(--text-2); transition: var(--t-fast);
    display: flex; align-items: center; justify-content: center; gap: .3rem;
}
.btn-move:hover { background: var(--blue-pale); border-color: var(--blue-light); color: var(--blue-dark); }
.btn-back:hover { background: #f1f5f9 !important; border-color: #94a3b8 !important; color: var(--text-2) !important; }
.btn-done:hover { background: #d1fae5 !important; border-color: var(--green) !important; color: #065f46 !important; }

.kanban-empty { text-align: center; padding: 1.5rem 1rem; color: var(--text-3); font-size: .78rem; }

/* ────────────────────────────────────────────────────────────
   BUTTONS
   ──────────────────────────────────────────────────────────── */
.btn { border-radius: var(--r-sm); font-weight: 600; font-size: .82rem; transition: var(--t); position: relative; overflow: hidden; }
.btn::after { content: ''; position: absolute; inset: 0; background: rgba(255,255,255,0); transition: var(--t-fast); }
.btn:hover::after { background: rgba(255,255,255,.1); }
.btn:active { transform: scale(.97); }

.btn-primary-custom {
    background: linear-gradient(135deg, var(--blue), #2563eb);
    color: #fff; border: none;
    padding: .55rem 1.2rem;
    box-shadow: 0 2px 8px rgba(26,86,219,.3);
}
.btn-primary-custom:hover { background: linear-gradient(135deg, #1545c0, var(--blue)); box-shadow: 0 4px 16px rgba(26,86,219,.4); color: #fff; transform: translateY(-1px); }

.btn-outline-custom {
    border: 1.5px solid var(--blue); color: var(--blue);
    background: transparent; padding: .5rem 1.1rem;
}
.btn-outline-custom:hover { background: var(--blue-pale); color: var(--blue-dark); }

.btn-danger-custom {
    background: #fee2e2; color: var(--red);
    border: 1.5px solid #fecaca;
    padding: .3rem .6rem;
}
.btn-danger-custom:hover { background: var(--red); color: #fff; border-color: var(--red); }

.btn-whatsapp {
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: #fff; border: none;
    padding: .7rem 1.2rem; font-size: .88rem;
    box-shadow: 0 2px 10px rgba(37,211,102,.3);
}
.btn-whatsapp:hover { background: linear-gradient(135deg, #20b958, #0e6b61); box-shadow: 0 4px 18px rgba(37,211,102,.4); color: #fff; transform: translateY(-1px); }

/* ────────────────────────────────────────────────────────────
   CARDS (generic)
   ──────────────────────────────────────────────────────────── */
.form-card {
    background: var(--surface); border-radius: var(--r-lg);
    box-shadow: var(--sh); border: 1px solid var(--border);
    overflow: hidden;
}
.form-card-header {
    background: linear-gradient(135deg, var(--blue), var(--blue-dark));
    color: #fff; padding: 1rem 1.5rem;
    font-weight: 700; font-size: .92rem;
    display: flex; align-items: center; gap: .6rem;
}
.form-card-body { padding: 1.5rem; }

/* ── Form controls ── */
.form-label { font-size: .8rem; font-weight: 600; color: var(--text-2); margin-bottom: .3rem; display: block; }
.form-control {
    border: 1.5px solid var(--border); border-radius: var(--r-sm);
    padding: .55rem .85rem; font-size: .84rem; font-family: var(--font);
    color: var(--text); background: var(--surface);
    transition: var(--t); width: 100%;
}
.form-control:focus {
    outline: none; border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(26,86,219,.12);
    background: var(--surface);
}
.form-control::placeholder { color: var(--text-3); }
select.form-control { cursor: pointer; }

.char-count { font-size: .72rem; color: var(--text-3); text-align: right; margin-top: .3rem; }

/* ────────────────────────────────────────────────────────────
   CLIENTS GRID
   ──────────────────────────────────────────────────────────── */
.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.client-card {
    background: var(--surface);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-sm);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: var(--t);
}
.client-card:hover { transform: translateY(-3px); box-shadow: var(--sh-lg); border-color: #c7d7fd; }

.client-card-header {
    height: 70px;
    background: linear-gradient(135deg, var(--blue-dark), var(--blue));
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 1.1rem;
    position: relative;
}
.client-inactive { background: linear-gradient(135deg, #475569, #64748b) !important; }

.client-avatar {
    width: 44px; height: 44px; border-radius: 12px;
    background: rgba(255,255,255,.25);
    backdrop-filter: blur(8px);
    color: #fff; font-weight: 800; font-size: 1.1rem;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid rgba(255,255,255,.3);
}

.client-badge { font-size: .65rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; text-transform: uppercase; letter-spacing: .05em; }
.badge-active   { background: rgba(16,185,129,.25); color: #6ee7b7; border: 1px solid rgba(16,185,129,.3); }
.badge-inactive { background: rgba(255,255,255,.15); color: rgba(255,255,255,.7); }

.client-card-body { padding: 1rem 1.1rem .75rem; }
.client-name    { font-size: .95rem; font-weight: 700; color: var(--text); margin-bottom: .2rem; }
.client-company { font-size: .75rem; color: var(--text-3); margin-bottom: .5rem; }
.client-info    { display: flex; flex-direction: column; gap: .2rem; font-size: .73rem; color: var(--text-2); }
.client-info i  { color: var(--blue); width: 14px; }
.client-since   { font-size: .68rem; color: var(--text-3); margin-top: .5rem; }

.client-card-footer {
    padding: .75rem 1.1rem;
    border-top: 1px solid var(--border);
    display: flex; gap: .5rem;
    background: var(--surface-2);
}

/* ────────────────────────────────────────────────────────────
   TABLE
   ──────────────────────────────────────────────────────────── */
.table-card {
    background: var(--surface);
    border-radius: var(--r-lg);
    box-shadow: var(--sh);
    border: 1px solid var(--border);
    overflow: hidden;
}

.table-header-info {
    padding: .75rem 1.25rem;
    font-size: .78rem; color: var(--text-2); font-weight: 600;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}

.table-custom { width: 100%; border-collapse: collapse; }
.table-custom thead tr {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-bottom: 2px solid var(--border);
}
.table-custom th {
    padding: .75rem 1.1rem; font-size: .73rem; font-weight: 700;
    color: var(--text-2); text-transform: uppercase; letter-spacing: .06em;
    white-space: nowrap;
}
.table-custom td {
    padding: .72rem 1.1rem; font-size: .82rem; color: var(--text);
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.table-custom tbody tr { transition: var(--t-fast); }
.table-custom tbody tr:hover { background: var(--blue-xpale); }
.table-custom tbody tr:last-child td { border-bottom: none; }

.badge-category {
    background: var(--blue-pale); color: var(--blue-dark);
    font-size: .7rem; font-weight: 700; padding: 3px 10px;
    border-radius: 99px; letter-spacing: .03em;
}

.btn-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: var(--r-sm);
    background: var(--blue-xpale); color: var(--blue);
    border: none; cursor: pointer; transition: var(--t-fast);
    font-size: .8rem;
}
.btn-icon:hover { background: var(--blue-pale); transform: scale(1.1); color: var(--blue-dark); }
.btn-icon-danger { background: #fee2e2; color: var(--red); }
.btn-icon-danger:hover { background: #fecaca; color: #b91c1c; }

/* ────────────────────────────────────────────────────────────
   CLIENT INFO BAR
   ──────────────────────────────────────────────────────────── */
.client-info-bar {
    background: linear-gradient(135deg, var(--blue-dark), var(--blue));
    border-radius: var(--r-lg);
    padding: 1.25rem 1.5rem;
    display: flex; align-items: center; gap: 1.1rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px rgba(26,86,219,.25);
}

.client-info-avatar {
    width: 52px; height: 52px; border-radius: 14px;
    background: rgba(255,255,255,.2);
    backdrop-filter: blur(8px);
    color: #fff; font-weight: 800; font-size: 1.3rem;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; border: 2px solid rgba(255,255,255,.3);
}

.client-info-details { flex: 1; }
.client-info-details h2 { color: #fff; font-size: 1.1rem; font-weight: 700; margin-bottom: .25rem; }
.client-meta { display: flex; flex-wrap: wrap; gap: .5rem .9rem; }
.client-meta span { font-size: .75rem; color: rgba(255,255,255,.75); display: flex; align-items: center; gap: .3rem; }
.client-meta i { color: rgba(255,255,255,.9); }

.client-info-actions { display: flex; gap: .5rem; flex-shrink: 0; }

/* ────────────────────────────────────────────────────────────
   UPLOAD CARD
   ──────────────────────────────────────────────────────────── */
.upload-card {
    background: var(--surface);
    border-radius: var(--r-lg);
    padding: 1.3rem 1.5rem;
    margin-bottom: 1.25rem;
    border: 1px solid var(--border);
    box-shadow: var(--sh-sm);
}
.upload-title { font-size: .88rem; font-weight: 700; color: var(--text); margin-bottom: 1rem; display: flex; align-items: center; gap: .5rem; }
.upload-title i { color: var(--blue); }

/* ────────────────────────────────────────────────────────────
   FILTERS BAR
   ──────────────────────────────────────────────────────────── */
.filters-bar {
    background: var(--surface);
    border-radius: var(--r); padding: .85rem 1.1rem;
    margin-bottom: 1.1rem; border: 1px solid var(--border);
    box-shadow: var(--sh-sm);
}
.filters-form { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
.filter-group { display: flex; flex-direction: column; gap: .2rem; }
.filter-group label { font-size: .72rem; font-weight: 600; color: var(--text-2); }
.filter-group select, .filter-group input {
    border: 1.5px solid var(--border); border-radius: var(--r-sm);
    padding: .4rem .75rem; font-size: .8rem; font-family: var(--font);
    color: var(--text); background: var(--surface-2);
    transition: var(--t); cursor: pointer;
}
.filter-group select:focus, .filter-group input:focus {
    outline: none; border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(26,86,219,.1);
}

/* ────────────────────────────────────────────────────────────
   SEARCH BAR
   ──────────────────────────────────────────────────────────── */
.search-bar { max-width: 420px; }
.input-group-custom { position: relative; }
.input-icon { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: .85rem; pointer-events: none; }
.custom-input { padding-left: 2.5rem !important; }

/* ────────────────────────────────────────────────────────────
   MODAL
   ──────────────────────────────────────────────────────────── */
.modal-custom {
    border: none; border-radius: var(--r-xl);
    box-shadow: var(--sh-xl); overflow: hidden;
}
.modal-header-custom {
    background: linear-gradient(135deg, var(--blue), var(--blue-dark));
    color: #fff; border: none; padding: 1.1rem 1.5rem;
}
.modal-header-custom .modal-title { font-size: .95rem; font-weight: 700; }
.modal-body { padding: 1.4rem 1.5rem; }
.modal-footer { border-top: 1px solid var(--border); padding: 1rem 1.5rem; background: var(--surface-2); }
.modal.fade .modal-dialog { transition: transform .25s cubic-bezier(.34,1.56,.64,1); }
.modal.fade:not(.show) .modal-dialog { transform: scale(.94) translateY(-10px); }

/* ────────────────────────────────────────────────────────────
   EMPTY STATE
   ──────────────────────────────────────────────────────────── */
.empty-state {
    text-align: center; padding: 3.5rem 2rem;
    display: flex; flex-direction: column; align-items: center; gap: .75rem;
}
.empty-state i { font-size: 2.8rem; color: #cbd5e1; }
.empty-state p { color: var(--text-3); font-size: .88rem; }

/* ────────────────────────────────────────────────────────────
   WHATSAPP PAGE — redesign
   ──────────────────────────────────────────────────────────── */
.wapp-layout {
    display: grid;
    grid-template-columns: 280px 1fr 300px;
    gap: 1.1rem;
    height: calc(100vh - 62px - 3.5rem);
    min-height: 580px;
}

/* ── Sidebar clientes ── */
.wapp-sidebar {
    background: var(--surface);
    border-radius: var(--r-lg);
    border: 1px solid var(--border);
    box-shadow: var(--sh-sm);
    display: flex; flex-direction: column;
    overflow: hidden;
}
.wapp-sidebar-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: .9rem 1rem;
    background: linear-gradient(135deg, #075e54, #128c7e);
    color: #fff; font-size: .85rem; font-weight: 700;
    flex-shrink: 0;
}
.wapp-status-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: #94a3b8; border: 2px solid rgba(255,255,255,.4);
    transition: var(--t);
}
.wapp-status-dot.dot-online  { background: #4ade80; }
.wapp-status-dot.dot-offline { background: #f87171; }

.wapp-search-wrap {
    position: relative; padding: .6rem .75rem;
    border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.wapp-search-icon { position: absolute; left: 1.2rem; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: .8rem; }
.wapp-search-input {
    width: 100%; padding: .45rem .75rem .45rem 2.1rem;
    border: 1.5px solid var(--border); border-radius: 99px;
    font-size: .8rem; font-family: var(--font); color: var(--text);
    background: var(--surface-2); outline: none; transition: var(--t);
}
.wapp-search-input:focus { border-color: var(--wapp); box-shadow: 0 0 0 3px rgba(37,211,102,.1); }

.wapp-client-list { flex: 1; overflow-y: auto; }

.wapp-client-item {
    display: flex; align-items: center; gap: .75rem;
    padding: .75rem 1rem; cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: var(--t-fast); position: relative;
}
.wapp-client-item:hover { background: #f0fdf4; }
.wapp-client-item.active { background: #dcfce7; }
.wapp-client-item.active::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0;
    width: 3px; background: var(--wapp); border-radius: 0 3px 3px 0;
}

.wapp-client-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: linear-gradient(135deg, #075e54, #128c7e);
    color: #fff; font-weight: 700; font-size: .9rem;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; overflow: hidden; position: relative;
}
.wapp-avatar-letter { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.wapp-avatar-img { display: none; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; position: absolute; inset: 0; }

.wapp-client-meta { flex: 1; min-width: 0; }
.wapp-client-name { display: block; font-size: .82rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wapp-client-phone { font-size: .72rem; color: var(--text-3); }
.wapp-chevron { color: var(--text-3); font-size: .7rem; flex-shrink: 0; }

.wapp-empty-list { padding: 2rem; text-align: center; color: var(--text-3); font-size: .82rem; }
.wapp-empty-list i { font-size: 2rem; display: block; margin-bottom: .5rem; }

/* ── Composer ── */
.wapp-composer {
    background: var(--surface);
    border-radius: var(--r-lg);
    border: 1px solid var(--border);
    box-shadow: var(--sh-sm);
    display: flex; flex-direction: column;
    overflow: hidden;
}
.wapp-composer-header {
    background: linear-gradient(135deg, #075e54, #128c7e);
    padding: .85rem 1.1rem; flex-shrink: 0;
}
.wapp-selected-client { display: flex; align-items: center; gap: .75rem; }
.wapp-selected-avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: rgba(255,255,255,.2); border: 2px solid rgba(255,255,255,.3);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 1rem; flex-shrink: 0; overflow: hidden;
}
.wapp-selected-name { color: #fff; font-weight: 700; font-size: .88rem; }
.wapp-selected-phone { color: rgba(255,255,255,.7); font-size: .74rem; }

.wapp-templates-bar {
    display: flex; align-items: center; flex-wrap: wrap; gap: .4rem;
    padding: .65rem 1rem; border-bottom: 1px solid var(--border);
    background: var(--surface-2); flex-shrink: 0;
}
.wapp-templates-label { font-size: .72rem; font-weight: 600; color: var(--text-3); white-space: nowrap; }
.wapp-tpl-btn {
    background: var(--surface); border: 1.5px solid var(--border);
    border-radius: 99px; padding: .25rem .75rem;
    font-size: .73rem; font-weight: 600; cursor: pointer;
    color: var(--text-2); transition: var(--t-fast);
}
.wapp-tpl-btn:hover { border-color: var(--wapp); color: #075e54; background: #f0fdf4; }

.wapp-message-wrap { flex: 1; display: flex; flex-direction: column; padding: 1rem; gap: .4rem; }
.wapp-textarea {
    flex: 1; border: 1.5px solid var(--border); border-radius: var(--r);
    padding: .75rem; font-size: .84rem; font-family: var(--font);
    color: var(--text); resize: none; outline: none; transition: var(--t);
    line-height: 1.6;
}
.wapp-textarea:focus { border-color: var(--wapp); box-shadow: 0 0 0 3px rgba(37,211,102,.1); }
.wapp-char-count { font-size: .7rem; color: var(--text-3); text-align: right; }

.wapp-attach-area { padding: 0 1rem; flex-shrink: 0; }
.wapp-dropzone {
    border: 2px dashed var(--border); border-radius: var(--r);
    padding: .75rem 1rem; text-align: center;
    font-size: .8rem; color: var(--text-3);
    transition: var(--t); background: var(--surface-2);
}
.wapp-dropzone.dragover { border-color: var(--wapp); background: #f0fdf4; color: #075e54; }
.wapp-attach-icon { margin-right: .4rem; }
.wapp-browse-btn {
    background: none; border: none; color: var(--wapp);
    font-weight: 600; cursor: pointer; padding: 0; font-size: .8rem;
    text-decoration: underline; font-family: var(--font);
}

.wapp-file-preview {
    display: none; align-items: center; gap: .75rem;
    background: #f0fdf4; border: 1.5px solid #bbf7d0;
    border-radius: var(--r); padding: .65rem .9rem;
}
.wapp-file-info { display: flex; align-items: center; gap: .6rem; flex: 1; min-width: 0; }
.wapp-file-icon { font-size: 1.3rem; color: #075e54; flex-shrink: 0; }
.wapp-file-name { font-size: .82rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wapp-file-size { font-size: .7rem; color: var(--text-3); }
.wapp-remove-btn {
    background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.2);
    color: var(--red); border-radius: var(--r-sm);
    width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0; transition: var(--t-fast); font-size: .75rem;
}
.wapp-remove-btn:hover { background: var(--red); color: #fff; }

.wapp-send-area {
    padding: .85rem 1rem; border-top: 1px solid var(--border);
    display: flex; flex-direction: column; gap: .5rem; flex-shrink: 0;
}
.wapp-send-btn {
    display: flex; align-items: center; justify-content: center; gap: .6rem;
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: #fff; border: none; border-radius: var(--r);
    padding: .75rem 1.5rem; font-size: .9rem; font-weight: 700;
    cursor: pointer; transition: var(--t);
    box-shadow: 0 2px 12px rgba(37,211,102,.3);
}
.wapp-send-btn:hover { background: linear-gradient(135deg, #20b958, #0e6b61); transform: translateY(-1px); box-shadow: 0 4px 18px rgba(37,211,102,.4); }
.wapp-send-btn:disabled { opacity: .65; transform: none; cursor: not-allowed; }
.wapp-send-btn i { font-size: 1.1rem; }

/* ── Coluna direita ── */
.wapp-right { display: flex; flex-direction: column; gap: 1rem; overflow-y: auto; }

.wapp-preview-card {
    background: #e5ddd5;
    border-radius: var(--r-lg); overflow: hidden;
    box-shadow: var(--sh); border: 1px solid var(--border);
    flex-shrink: 0;
}
.wapp-preview-header {
    background: #075e54;
    padding: .75rem 1rem;
    display: flex; align-items: center; gap: .75rem;
}
.wapp-preview-avatar-wrap { position: relative; flex-shrink: 0; }
.wapp-preview-avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: rgba(255,255,255,.2);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: .95rem; overflow: hidden;
}
.wapp-preview-status-ring {
    width: 11px; height: 11px; background: #4ade80;
    border: 2px solid #075e54; border-radius: 50%;
    position: absolute; bottom: 0; right: 0;
}
.wapp-preview-name { color: #fff; font-size: .85rem; font-weight: 700; }
.wapp-preview-online { color: rgba(255,255,255,.6); font-size: .72rem; }

.wapp-preview-chat { padding: .85rem; min-height: 140px; }
.wapp-preview-date {
    text-align: center; font-size: .68rem; color: #666;
    background: rgba(255,255,255,.6); border-radius: 99px;
    padding: 2px 10px; display: inline-block;
    margin: 0 auto .65rem; width: fit-content;
    display: flex; margin: 0 auto .65rem;
}
.wapp-bubble-wrap { display: flex; justify-content: flex-end; }
.wapp-bubble {
    background: #dcf8c6;
    border-radius: 10px 0 10px 10px;
    padding: .6rem .85rem;
    max-width: 88%; box-shadow: 0 1px 3px rgba(0,0,0,.1);
}
.wapp-bubble-text { font-size: .8rem; color: #111; white-space: pre-wrap; margin: 0; line-height: 1.5; }
.wapp-bubble-file {
    display: none; align-items: center; gap: .4rem;
    background: rgba(0,0,0,.06); border-radius: var(--r-sm);
    padding: .4rem .6rem; margin-top: .4rem;
    font-size: .75rem; color: #333;
}
.wapp-bubble-time { font-size: .65rem; color: #999; float: right; margin-top: .25rem; margin-left: .5rem; }
.wapp-bubble-time i { color: #4fc3f7; }

.wapp-status-card {
    background: var(--surface); border-radius: var(--r-lg);
    border: 1px solid var(--border); overflow: hidden; box-shadow: var(--sh-sm);
    flex-shrink: 0;
}
.wapp-card-header {
    background: linear-gradient(135deg, #1e293b, #334155);
    color: #e2e8f0; padding: .7rem 1rem;
    font-size: .8rem; font-weight: 700;
    display: flex; align-items: center;
}
.wapp-refresh-btn {
    margin-left: auto; background: rgba(255,255,255,.1); border: none;
    color: #e2e8f0; width: 26px; height: 26px; border-radius: 6px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    font-size: .75rem; transition: var(--t-fast);
}
.wapp-refresh-btn:hover { background: rgba(255,255,255,.2); }
.wapp-card-body { padding: .85rem 1rem; font-size: .82rem; }
.wapp-status-ok      { color: var(--green); font-weight: 600; }
.wapp-status-err     { color: var(--red);   font-weight: 600; }
.wapp-status-checking { color: var(--text-3); }

.wapp-qr-btn {
    width: 100%; padding: .55rem;
    background: var(--surface-2); border: 1.5px solid var(--border);
    border-radius: var(--r-sm); font-size: .8rem; font-weight: 600;
    color: var(--text-2); cursor: pointer; transition: var(--t-fast);
    display: flex; align-items: center; justify-content: center;
}
.wapp-qr-btn:hover { border-color: var(--wapp); color: #075e54; background: #f0fdf4; }

@media (max-width: 1200px) {
    .wapp-layout { grid-template-columns: 240px 1fr; }
    .wapp-right { display: none; }
}
@media (max-width: 768px) {
    .wapp-layout { grid-template-columns: 1fr; height: auto; }
    .wapp-sidebar { max-height: 220px; }
}

/* ────────────────────────────────────────────────────────────
   LOGIN PAGE
   ──────────────────────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    background: url('/static/img/bg-login.jpg') center center / cover no-repeat;
    display: flex; align-items: center; justify-content: center;
    padding: 1.5rem; position: relative; overflow: hidden;
}
.login-page::before {
    content: ''; position: absolute; inset: 0;
    background: rgba(10,20,60,.42);
    z-index: 0;
}

.login-container { position: relative; z-index: 10; width: 100%; max-width: 420px; }

.login-card {
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(20px);
    border-radius: var(--r-xl);
    padding: 2.5rem 2.25rem;
    box-shadow: 0 32px 64px rgba(0,0,0,.28), 0 0 0 1px rgba(255,255,255,.5);
    animation: fadeUp .4s cubic-bezier(.34,1.2,.64,1);
}

.login-header { text-align: center; margin-bottom: 1.75rem; }

.login-logo { width: 120px; height: auto; display: block; margin: 0 auto .9rem; filter: drop-shadow(0 4px 12px rgba(0,0,0,.12)); }

.login-subtitle { color: var(--text-3); font-size: .84rem; margin: 0; font-weight: 500; }

.login-tabs {
    display: grid; grid-template-columns: 1fr 1fr;
    background: var(--surface-2); border-radius: var(--r-sm);
    padding: 3px; gap: 3px; margin-bottom: 1.4rem;
    border: 1px solid var(--border);
}
.tab-btn {
    padding: .55rem; border: none; border-radius: 7px;
    font-size: .8rem; font-weight: 600; cursor: pointer;
    background: transparent; color: var(--text-3);
    transition: var(--t); display: flex; align-items: center; justify-content: center; gap: .4rem;
}
.tab-btn.active { background: var(--surface); color: var(--blue); box-shadow: var(--sh-sm); }

.form-group { margin-bottom: 1.1rem; }

.input-group-custom { position: relative; }
.input-icon { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: .85rem; pointer-events: none; z-index: 2; }
.custom-input { padding-left: 2.65rem !important; }

.toggle-password {
    position: absolute; right: .75rem; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: var(--text-3);
    cursor: pointer; padding: .2rem; z-index: 2;
    font-size: .85rem; transition: var(--t-fast);
}
.toggle-password:hover { color: var(--blue); }

.form-check-custom {
    display: flex; align-items: center; gap: .5rem;
    margin-bottom: 1.25rem;
}
.form-check-custom input { width: 15px; height: 15px; accent-color: var(--blue); cursor: pointer; }
.form-check-custom label { font-size: .8rem; color: var(--text-2); cursor: pointer; }

.btn-login {
    width: 100%; padding: .75rem;
    background: linear-gradient(135deg, var(--blue), #2563eb);
    color: #fff; border: none;
    border-radius: var(--r-sm); font-weight: 700; font-size: .9rem;
    cursor: pointer; transition: var(--t);
    box-shadow: 0 4px 16px rgba(26,86,219,.35);
    display: flex; align-items: center; justify-content: center; gap: .5rem;
}
.btn-login:hover { background: linear-gradient(135deg, #1545c0, var(--blue)); transform: translateY(-1px); box-shadow: 0 6px 24px rgba(26,86,219,.45); }
.btn-login:active { transform: scale(.98); }
.btn-login.btn-admin { background: linear-gradient(135deg, #0d1f4e, var(--blue-dark)); }
.btn-login.btn-admin:hover { background: linear-gradient(135deg, #091840, #162c6a); }

.login-footer { text-align: center; margin-top: 1.5rem; }
.login-footer p { font-size: .72rem; color: var(--text-3); margin-top: .5rem; }

.cotacao-rodape {
    position: fixed; bottom: 0; left: 0; right: 0;
    display: flex; align-items: center; justify-content: center;
    gap: .75rem; flex-wrap: wrap;
    background: rgba(10, 20, 60, .55);
    backdrop-filter: blur(8px);
    padding: .55rem 1rem;
    z-index: 20;
}
.cotacao-item {
    display: flex; align-items: center; gap: .35rem;
    font-size: .78rem; color: rgba(255,255,255,.85);
}
.cotacao-item i { color: #93c5fd; font-size: .72rem; }
.cotacao-label { font-weight: 500; }
.cotacao-valor { font-weight: 700; color: #fff; }
.cotacao-sep { color: rgba(255,255,255,.3); }
.cotacao-hora { font-size: .65rem; color: rgba(255,255,255,.45); margin-left: .2rem; }

/* ────────────────────────────────────────────────────────────
   CALENDAR WIDGET
   ──────────────────────────────────────────────────────────── */
.calendar-widget {
    background: var(--surface);
    border-radius: var(--r-lg);
    box-shadow: var(--sh);
    margin-bottom: 1.5rem;
    overflow: hidden;
    border: 1px solid var(--border);
}
.calendar-widget-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: .9rem 1.25rem;
    background: linear-gradient(135deg, var(--blue), var(--blue-dark));
    color: white;
}
.calendar-widget-header h3 { font-size: .92rem; font-weight: 700; margin: 0; }
.calendar-toggle-btn {
    background: rgba(255,255,255,.15); border: none; color: white;
    width: 28px; height: 28px; border-radius: 7px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: var(--t-fast); font-size: .8rem;
}
.calendar-toggle-btn:hover { background: rgba(255,255,255,.28); }
.calendar-body { padding: 1rem; }
.calendar-body.collapsed { display: none; }

/* FullCalendar overrides */
.fc { font-family: var(--font); font-size: .82rem; }
.fc .fc-toolbar-title { font-size: .98rem; font-weight: 700; color: var(--text); }
.fc .fc-button-primary { background: var(--blue); border-color: var(--blue); font-size: .75rem; padding: .25rem .6rem; border-radius: var(--r-sm); }
.fc .fc-button-primary:hover, .fc .fc-button-primary:not(:disabled):active { background: var(--blue-dark); border-color: var(--blue-dark); }
.fc .fc-daygrid-day:hover { background: var(--blue-xpale); cursor: pointer; }
.fc .fc-event { border-radius: 4px; font-size: .7rem; padding: 1px 4px; border: none; cursor: pointer; font-weight: 600; }
.fc-event-priority-high   { background: #ef4444 !important; }
.fc-event-priority-normal { background: var(--blue) !important; }
.fc-event-priority-low    { background: var(--green) !important; }
.fc-event-priority-done   { background: #94a3b8 !important; }
.fc .fc-day-today { background: var(--blue-xpale) !important; }
.fc .fc-col-header-cell { background: #f8fafc; font-weight: 700; color: var(--text-2); font-size: .75rem; }
.fc .fc-daygrid-day-number { color: var(--text); font-weight: 600; font-size: .8rem; }

/* ────────────────────────────────────────────────────────────
   SIDEBAR LOGO
   ──────────────────────────────────────────────────────────── */
.sidebar-logo { height: 36px; width: auto; object-fit: contain; filter: brightness(0) invert(1); flex-shrink: 0; transition: var(--t); }
.sidebar.collapsed .sidebar-logo { height: 26px; }

/* ────────────────────────────────────────────────────────────
   RESPONSIVE
   ──────────────────────────────────────────────────────────── */
@media (max-width: 1200px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .kanban-board { grid-template-columns: 1fr; }
}

@media (max-width: 992px) {
    .clients-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); z-index: 1000; width: var(--sidebar-w) !important; }
    .sidebar.mobile-open { transform: translateX(0); box-shadow: var(--sh-xl); }
    .main-content { margin-left: 0 !important; }
    .mobile-toggle { display: flex; }
    .content-area { padding: 1.1rem; }
    .top-header { padding: 0 1rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: .75rem; }
    .login-card { padding: 1.75rem 1.25rem; }
    .filters-form { gap: .5rem; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .clients-grid { grid-template-columns: 1fr; }
    .kanban-board { gap: .75rem; }
    .stat-value { font-size: 1.5rem; }
}

/* ────────────────────────────────────────────────────────────
   UTILITIES
   ──────────────────────────────────────────────────────────── */
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.me-1 { margin-right: .25rem !important; }
.me-2 { margin-right: .5rem !important; }
.ms-auto { margin-left: auto !important; }
.gap-2 { gap: .5rem !important; }
.d-flex { display: flex !important; }
.align-items-center { align-items: center !important; }
.flex-grow-1 { flex-grow: 1 !important; }
.text-muted { color: var(--text-3) !important; }
.text-danger { color: var(--red) !important; }
.fw-semibold { font-weight: 600 !important; }
.small { font-size: .8rem !important; }
.w-100 { width: 100% !important; }
.rounded { border-radius: var(--r-sm) !important; }
.p-2 { padding: .5rem !important; }
.text-center { text-align: center !important; }

/* Sidebar overlay (mobile) */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 999; backdrop-filter: blur(2px); }
.sidebar-overlay.active { display: block; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.fa-spin { animation: spin 1s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* Badge utility */
.badge { display: inline-block; padding: 3px 9px; border-radius: 99px; font-size: .7rem; font-weight: 700; }

/* ── Profile picture avatar ── */
.client-avatar {
    overflow: hidden;
    position: relative;
}
.avatar-letter {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 1.1rem; color: #fff;
    transition: opacity .2s ease;
}
.avatar-img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: inherit;
    transition: opacity .3s ease;
}
