/* ==========================================================================
   Vittal Hub — Design System
   Paleta alinhada à landing page vittalsystem.com.br
   ========================================================================== */
:root {
  --font: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --mint: #10E4A7; --mint-rgb: 16,228,167;
  --cyan: #2DD4FF; --cyan-rgb: 45,212,255;
  --violet: #8B7CFF; --violet-rgb: 139,124,255;
  --amber: #FFB443; --amber-rgb: 255,180,67;
  --red: #FF5E7A; --red-rgb: 255,94,122;
  --slate: #9AA4B6; --slate-rgb: 154,164,182;

  --radius: 16px; --radius-sm: 10px; --radius-xs: 7px;
  --sidebar-w: 264px; --sidebar-w-collapsed: 76px; --navbar-h: 66px;
  --ease: cubic-bezier(.22,.61,.36,1);
  --shadow: 0 18px 40px -20px rgba(0,0,0,.55);
}

:root, [data-theme="dark"] {
  color-scheme: dark;
  --bg: #06070A; --bg-soft: #0B0D13; --bg-elev: #0E1119; --bg-elev-2: #12161F; --bg-hover: rgba(255,255,255,.045);
  --line: rgba(255,255,255,.08); --line-strong: rgba(255,255,255,.15);
  --txt: #EAEEF5; --txt-2: #C3CAD6; --muted: #9AA4B6; --muted-2: #6B7486;
  --input-bg: #0B0E15; --grad: linear-gradient(100deg, var(--mint), var(--cyan) 55%, var(--violet));
  --sidebar-bg: #090B10; --navbar-bg: rgba(6,7,10,.78);
  --btn-primary-text: #04120E;
}
[data-theme="light"] {
  color-scheme: light;
  --bg: #F4F6FA; --bg-soft: #FFFFFF; --bg-elev: #FFFFFF; --bg-elev-2: #F7F9FC; --bg-hover: rgba(15,23,42,.04);
  --line: rgba(15,23,42,.08); --line-strong: rgba(15,23,42,.16);
  --txt: #0F172A; --txt-2: #334155; --muted: #64748B; --muted-2: #94A3B8;
  --input-bg: #FFFFFF; --sidebar-bg: #0B0D13; --navbar-bg: rgba(244,246,250,.82);
  --shadow: 0 18px 40px -24px rgba(15,23,42,.25);
  --mint: #0BBF8B; --cyan: #0EA5E9; --violet: #7C6BFF; --amber: #E8951B; --red: #E0364F;
  --btn-primary-text: #FFFFFF;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--txt); font-family: var(--font); font-size: 14.5px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4, h5 { margin: 0; letter-spacing: -.02em; line-height: 1.2; font-weight: 800; }
h1 { font-size: 1.55rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; } h4 { font-size: .95rem; }
p { margin: 0; }
small, .text-sm { font-size: .82rem; } .text-xs { font-size: .74rem; }
.muted { color: var(--muted); } .muted-2 { color: var(--muted-2); }
.mono { font-family: var(--mono); font-size: .86em; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.fw-600 { font-weight: 600; } .fw-700 { font-weight: 700; } .fw-800 { font-weight: 800; }
.nowrap { white-space: nowrap; } .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-right { text-align: right; } .text-center { text-align: center; }
.hidden { display: none !important; }
.c-mint { color: var(--mint); } .c-cyan { color: var(--cyan); } .c-violet { color: var(--violet); } .c-amber { color: var(--amber); } .c-red { color: var(--red); } .c-slate { color: var(--slate); }
[x-cloak] { display: none !important; }
::selection { background: rgba(var(--mint-rgb), .3); }
*::-webkit-scrollbar { width: 10px; height: 10px; } *::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }

/* ---------- Layout shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--sidebar-bg); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; z-index: 60; transition: width .25s var(--ease), transform .25s var(--ease); color: #EAEEF5;
}
.sidebar .brand { display: flex; align-items: center; gap: .7rem; height: var(--navbar-h); padding: 0 1.25rem; border-bottom: 1px solid rgba(255,255,255,.06); }
.sidebar .brand .logo { width: 36px; height: 36px; flex: 0 0 auto; border-radius: 11px; background: var(--grad); display: grid; place-items: center; color: #04120E; font-weight: 900; box-shadow: 0 10px 24px -10px rgba(16,228,167,.7); }
.sidebar .brand .name { font-weight: 800; font-size: 1.1rem; letter-spacing: -.03em; white-space: nowrap; }
.sidebar .brand .name span { color: #10E4A7; }
.sidebar .brand small { display: block; font-size: .68rem; color: #6B7486; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; margin-top: -2px; }
.sidebar nav { flex: 1; overflow-y: auto; padding: .9rem .75rem; }
.sidebar .nav-section { font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: #5C6577; font-weight: 700; padding: 1rem .75rem .45rem; white-space: nowrap; }
.sidebar .nav-link {
  display: flex; align-items: center; gap: .75rem; padding: .6rem .8rem; border-radius: var(--radius-sm); color: #A9B2C2; font-weight: 600; font-size: .9rem;
  transition: background .18s, color .18s; margin-bottom: 2px; white-space: nowrap; position: relative;
}
.sidebar .nav-link svg { width: 19px; height: 19px; flex: 0 0 auto; opacity: .85; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.05); color: #fff; }
.sidebar .nav-link.active { background: linear-gradient(90deg, rgba(16,228,167,.16), rgba(45,212,255,.06)); color: #fff; }
.sidebar .nav-link.active::before { content: ''; position: absolute; left: -.75rem; top: 20%; height: 60%; width: 3px; border-radius: 3px; background: var(--grad); }
.sidebar .nav-link .count { margin-left: auto; font-size: .7rem; font-weight: 800; background: rgba(255,255,255,.08); padding: .1rem .45rem; border-radius: 99px; color: #cfd6e2; }
.sidebar .nav-link.active .count { background: rgba(16,228,167,.25); color: #10E4A7; }
.sidebar-footer { padding: .9rem; border-top: 1px solid rgba(255,255,255,.06); }
.sidebar-footer .user { display: flex; align-items: center; gap: .7rem; padding: .5rem; border-radius: var(--radius-sm); }
.sidebar-footer .user .meta { min-width: 0; white-space: nowrap; }
.sidebar-footer .user .meta b { display: block; font-size: .86rem; overflow: hidden; text-overflow: ellipsis; }
.sidebar-footer .user .meta small { color: #6B7486; font-size: .72rem; }

.shell.collapsed .sidebar { width: var(--sidebar-w-collapsed); }
.shell.collapsed .sidebar .brand { padding: 0 1.2rem; justify-content: center; }
.shell.collapsed .sidebar .brand .name, .shell.collapsed .sidebar .nav-section, .shell.collapsed .nav-link span, .shell.collapsed .nav-link .count, .shell.collapsed .sidebar-footer .meta { display: none; }
.shell.collapsed .sidebar .nav-link { justify-content: center; padding: .7rem; }
.shell.collapsed .sidebar .nav-link::after { content: attr(data-tip); position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%); background: #12161F; color: #fff; padding: .35rem .6rem; border-radius: 8px; font-size: .78rem; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s; border: 1px solid var(--line-strong); }
.shell.collapsed .sidebar .nav-link:hover::after { opacity: 1; }
.shell.collapsed .sidebar-footer .user { justify-content: center; }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; transition: margin .25s var(--ease); display: flex; flex-direction: column; }
.shell.collapsed .main { margin-left: var(--sidebar-w-collapsed); }

.navbar {
  position: sticky; top: 0; z-index: 50; height: var(--navbar-h); display: flex; align-items: center; gap: 1rem; padding: 0 1.5rem;
  background: var(--navbar-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--line);
}
.navbar .icon-btn { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: transparent; border: 1px solid transparent; color: var(--txt-2); cursor: pointer; transition: all .18s; position: relative; }
.navbar .icon-btn:hover { background: var(--bg-hover); border-color: var(--line); color: var(--txt); }
.navbar .icon-btn svg { width: 19px; height: 19px; }
.navbar .icon-btn .dot { position: absolute; top: 9px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--bg); }
.navbar .search { flex: 1; max-width: 480px; position: relative; }
.navbar .search input { width: 100%; height: 42px; padding: 0 2.6rem 0 2.5rem; border-radius: 12px; background: var(--input-bg); border: 1px solid var(--line); color: var(--txt); font: inherit; font-size: .9rem; transition: border .18s, box-shadow .18s; }
.navbar .search input:focus { outline: none; border-color: rgba(var(--mint-rgb), .6); box-shadow: 0 0 0 4px rgba(var(--mint-rgb), .12); }
.navbar .search svg { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); }
.navbar .search kbd { position: absolute; right: .7rem; top: 50%; transform: translateY(-50%); font: 600 .68rem var(--mono); color: var(--muted-2); border: 1px solid var(--line); padding: .1rem .35rem; border-radius: 5px; }
.navbar .spacer { flex: 1; }
.navbar .breadcrumb { display: flex; align-items: center; gap: .45rem; font-size: .85rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
.navbar .breadcrumb a:hover { color: var(--txt); }
.navbar .breadcrumb .sep { opacity: .45; }
.navbar .breadcrumb .current { color: var(--txt); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .78rem; color: #04120E; background: var(--grad); flex: 0 0 auto; letter-spacing: .02em; }
.avatar.sm { width: 28px; height: 28px; font-size: .66rem; } .avatar.lg { width: 56px; height: 56px; font-size: 1.1rem; }
.avatar.slate { background: linear-gradient(120deg, #8a93a6, #5c6577); color: #fff; }
.avatar.violet { background: linear-gradient(120deg, var(--violet), var(--cyan)); color: #fff; }
.avatar.amber { background: linear-gradient(120deg, var(--amber), #ff7a5c); color: #1a1000; }
.avatar-stack { display: flex; } .avatar-stack .avatar { border: 2px solid var(--bg-elev); margin-left: -8px; } .avatar-stack .avatar:first-child { margin-left: 0; }

.content { padding: 1.6rem 1.5rem 3rem; max-width: 1560px; width: 100%; margin: 0 auto; }
.content > * + * { margin-top: 1.25rem; }

/* ---------- Page header ---------- */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.page-header .eyebrow { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--mint); font-weight: 800; margin-bottom: .25rem; }
.page-header p { color: var(--muted); margin-top: .3rem; max-width: 60ch; }
.page-header .actions { display: flex; gap: .55rem; align-items: center; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .6rem 1.05rem; border-radius: 11px; font: 700 .875rem var(--font); cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--bg-elev); color: var(--txt); transition: transform .18s var(--ease), box-shadow .18s, background .18s, border-color .18s; white-space: nowrap; line-height: 1.2; text-decoration: none;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { background: var(--bg-elev-2); transform: translateY(-1px); border-color: var(--line-strong); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn-primary { background: var(--grad); color: var(--btn-primary-text); border-color: transparent; box-shadow: 0 10px 24px -12px rgba(var(--mint-rgb), .7); }
[data-theme="light"] .btn-primary { background: linear-gradient(100deg, #0BBF8B, #0EA5E9); }
.btn-primary:hover { box-shadow: 0 14px 30px -12px rgba(var(--mint-rgb), .85); background: var(--grad); }
[data-theme="light"] .btn-primary:hover { background: linear-gradient(100deg, #0BBF8B, #0EA5E9); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--txt-2); }
.btn-ghost:hover { background: var(--bg-hover); border-color: transparent; }
.btn-outline { background: transparent; }
.btn-danger { background: rgba(var(--red-rgb), .12); border-color: rgba(var(--red-rgb), .35); color: var(--red); }
.btn-danger:hover { background: rgba(var(--red-rgb), .2); }
.btn-soft { background: rgba(var(--mint-rgb), .12); border-color: rgba(var(--mint-rgb), .3); color: var(--mint); }
.btn-soft:hover { background: rgba(var(--mint-rgb), .2); }
.btn-sm { padding: .4rem .75rem; font-size: .8rem; border-radius: 9px; } .btn-sm svg { width: 14px; height: 14px; }
.btn-xs { padding: .28rem .55rem; font-size: .74rem; border-radius: 8px; } .btn-xs svg { width: 13px; height: 13px; }
.btn-lg { padding: .8rem 1.4rem; font-size: .95rem; }
.btn-icon { padding: .5rem; width: 36px; height: 36px; }
.btn-icon.btn-sm { width: 30px; height: 30px; padding: .35rem; }
.btn-block { width: 100%; }
.btn-group { display: inline-flex; gap: .4rem; }

/* ---------- Cards ---------- */
.card { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--line); }
.card-header h3 { font-size: 1rem; } .card-header .sub { color: var(--muted); font-size: .82rem; margin-top: .15rem; font-weight: 500; }
.card-body { padding: 1.25rem; }
.card-body.tight { padding: .75rem 1rem; }
.card-footer { padding: .9rem 1.25rem; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: .55rem; align-items: center; flex-wrap: wrap; }
.card-footer.between { justify-content: space-between; }
.card.flush .card-body { padding: 0; }

/* ---------- Stats ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; }
.stat { position: relative; overflow: hidden; padding: 1.15rem 1.25rem; background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.stat::after { content: ''; position: absolute; inset: auto -30% -60% auto; width: 170px; height: 170px; border-radius: 50%; background: radial-gradient(circle, rgba(var(--accent-rgb, var(--mint-rgb)), .18), transparent 65%); pointer-events: none; }
.stat .label { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.stat .label .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(var(--accent-rgb, var(--mint-rgb)), .14); color: rgb(var(--accent-rgb, var(--mint-rgb))); }
.stat .label .ic svg { width: 17px; height: 17px; }
.stat .value { font-size: 1.7rem; font-weight: 800; letter-spacing: -.03em; margin-top: .55rem; line-height: 1.1; }
.stat .delta { display: inline-flex; align-items: center; gap: .3rem; margin-top: .45rem; font-size: .78rem; font-weight: 700; color: var(--muted); }
.stat .delta.up { color: var(--mint); } .stat .delta.down { color: var(--red); }
.stat .delta svg { width: 14px; height: 14px; }
.stat.mint { --accent-rgb: var(--mint-rgb); } .stat.cyan { --accent-rgb: var(--cyan-rgb); } .stat.violet { --accent-rgb: var(--violet-rgb); } .stat.amber { --accent-rgb: var(--amber-rgb); } .stat.red { --accent-rgb: var(--red-rgb); } .stat.slate { --accent-rgb: var(--slate-rgb); }

/* ---------- Grid helpers ---------- */
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid-main-3 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.span-2 { grid-column: span 2; }
.flex { display: flex; } .items-center { align-items: center; } .items-start { align-items: flex-start; } .justify-between { justify-content: space-between; } .justify-end { justify-content: flex-end; } .wrap { flex-wrap: wrap; }
.gap-1 { gap: .35rem; } .gap-2 { gap: .6rem; } .gap-3 { gap: 1rem; } .gap-4 { gap: 1.5rem; }
.stack > * + * { margin-top: 1rem; } .stack-sm > * + * { margin-top: .5rem; }
.mt-1 { margin-top: .35rem; } .mt-2 { margin-top: .6rem; } .mt-3 { margin-top: 1rem; } .mt-4 { margin-top: 1.5rem; } .mb-2 { margin-bottom: .6rem; } .mb-3 { margin-bottom: 1rem; } .ml-auto { margin-left: auto; }
.w-full { width: 100%; } .min-w-0 { min-width: 0; } .flex-1 { flex: 1; }

/* ---------- Badges & pills ---------- */
.badge { display: inline-flex; align-items: center; gap: .35rem; padding: .22rem .6rem; border-radius: 99px; font-size: .72rem; font-weight: 800; letter-spacing: .02em; white-space: nowrap; line-height: 1.3; border: 1px solid transparent; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge.no-dot::before { display: none; }
.badge-mint { background: rgba(var(--mint-rgb), .13); color: var(--mint); border-color: rgba(var(--mint-rgb), .25); }
.badge-cyan { background: rgba(var(--cyan-rgb), .13); color: var(--cyan); border-color: rgba(var(--cyan-rgb), .25); }
.badge-violet { background: rgba(var(--violet-rgb), .15); color: var(--violet); border-color: rgba(var(--violet-rgb), .28); }
.badge-amber { background: rgba(var(--amber-rgb), .14); color: var(--amber); border-color: rgba(var(--amber-rgb), .28); }
.badge-red { background: rgba(var(--red-rgb), .13); color: var(--red); border-color: rgba(var(--red-rgb), .28); }
.badge-slate { background: rgba(var(--slate-rgb), .14); color: var(--slate); border-color: rgba(var(--slate-rgb), .25); }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .6rem; border-radius: 8px; font-size: .76rem; font-weight: 700; background: var(--bg-elev-2); border: 1px solid var(--line); color: var(--txt-2); }
.chip svg { width: 13px; height: 13px; }
.tag-color { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table th { text-align: left; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 800; padding: .8rem 1rem; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--bg-elev-2); }
.table td { padding: .85rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: var(--bg-hover); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .row-link { font-weight: 700; color: var(--txt); }
.table .row-link:hover { color: var(--mint); }
.table td .sub { display: block; color: var(--muted); font-size: .78rem; margin-top: .1rem; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions .btn { opacity: .55; } .table tr:hover .actions .btn { opacity: 1; }
.table.compact th, .table.compact td { padding: .55rem .75rem; }
.table th a { display: inline-flex; align-items: center; gap: .25rem; color: inherit; } .table th a:hover { color: var(--txt); }

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 1.25rem; border-top: 1px solid var(--line); flex-wrap: wrap; font-size: .82rem; color: var(--muted); }
.pagination .pages { display: flex; gap: .3rem; }
.pagination .pages a, .pagination .pages span { min-width: 32px; height: 32px; display: inline-grid; place-items: center; padding: 0 .5rem; border-radius: 8px; border: 1px solid var(--line); font-weight: 700; color: var(--txt-2); }
.pagination .pages a:hover { background: var(--bg-hover); color: var(--txt); }
.pagination .pages .active { background: var(--grad); color: var(--btn-primary-text); border-color: transparent; }
.pagination .pages .disabled { opacity: .4; }

/* ---------- Filters ---------- */
.filters { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; padding: .9rem 1.25rem; border-bottom: 1px solid var(--line); }
.filters .input, .filters .select { height: 38px; font-size: .84rem; }
.filters .search-input { min-width: 240px; flex: 1; max-width: 360px; }
.filters .select { width: auto; min-width: 150px; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); padding: 0 1.25rem; overflow-x: auto; }
.tabs a, .tabs button { padding: .8rem .9rem; font-weight: 700; font-size: .85rem; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; background: none; border-top: 0; border-left: 0; border-right: 0; cursor: pointer; font-family: inherit; display: inline-flex; align-items: center; gap: .4rem; }
.tabs a:hover, .tabs button:hover { color: var(--txt); }
.tabs a.active, .tabs button.active { color: var(--txt); border-bottom-color: var(--mint); }
.tabs .count { font-size: .68rem; background: var(--bg-elev-2); border: 1px solid var(--line); border-radius: 99px; padding: .05rem .4rem; }
.segmented { display: inline-flex; background: var(--bg-elev-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.segmented a, .segmented button { padding: .38rem .75rem; border-radius: 8px; font-weight: 700; font-size: .8rem; color: var(--muted); background: none; border: 0; cursor: pointer; font-family: inherit; display: inline-flex; align-items: center; gap: .35rem; }
.segmented a svg, .segmented button svg { width: 14px; height: 14px; }
.segmented .active { background: var(--bg-elev); color: var(--txt); box-shadow: 0 2px 8px -2px rgba(0,0,0,.35); }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 1rem 1.1rem; }
.col-12 { grid-column: span 12; } .col-8 { grid-column: span 8; } .col-6 { grid-column: span 6; } .col-4 { grid-column: span 4; } .col-3 { grid-column: span 3; } .col-9 { grid-column: span 9; } .col-2 { grid-column: span 2; }
.field label { display: block; font-size: .8rem; font-weight: 700; color: var(--txt-2); margin-bottom: .38rem; }
.field label .req { color: var(--red); margin-left: 2px; }
.field .hint { display: block; font-size: .76rem; color: var(--muted); margin-top: .35rem; }
.field .error { display: block; font-size: .76rem; color: var(--red); margin-top: .35rem; font-weight: 600; }
.input, .select, .textarea {
  width: 100%; height: 42px; padding: 0 .9rem; border-radius: 11px; background: var(--input-bg); border: 1px solid var(--line-strong); color: var(--txt);
  font: inherit; font-size: .9rem; transition: border .18s, box-shadow .18s; -webkit-appearance: none; appearance: none;
}
.textarea { height: auto; min-height: 110px; padding: .7rem .9rem; resize: vertical; line-height: 1.5; }
.select { padding-right: 2.4rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239AA4B6' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .8rem center; cursor: pointer; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: rgba(var(--mint-rgb), .7); box-shadow: 0 0 0 4px rgba(var(--mint-rgb), .13); }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: rgba(var(--red-rgb), .7); }
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.input[type="date"], .input[type="datetime-local"], .input[type="month"] { color-scheme: dark; }
[data-theme="light"] .input[type="date"], [data-theme="light"] .input[type="datetime-local"], [data-theme="light"] .input[type="month"] { color-scheme: light; }
.input-group { position: relative; }
.input-group .prefix { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); font-size: .84rem; color: var(--muted); font-weight: 700; pointer-events: none; }
.input-group .input { padding-left: 2.5rem; }
.input-group .suffix { position: absolute; right: .85rem; top: 50%; transform: translateY(-50%); font-size: .8rem; color: var(--muted); font-weight: 700; pointer-events: none; }
.check { display: inline-flex; align-items: center; gap: .55rem; font-size: .88rem; font-weight: 600; cursor: pointer; color: var(--txt-2); }
.check input { width: 18px; height: 18px; accent-color: #10E4A7; cursor: pointer; margin: 0; }
.toggle { position: relative; width: 42px; height: 24px; border-radius: 99px; background: var(--line-strong); transition: background .2s; flex: 0 0 auto; }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.check input:checked + .toggle { background: var(--mint); } .check input:checked + .toggle::after { transform: translateX(18px); }
.check input.sr { position: absolute; opacity: 0; width: 0; height: 0; }
.form-section { padding-top: 1.25rem; margin-top: 1.25rem; border-top: 1px solid var(--line); }
.form-section h4 { display: flex; align-items: center; gap: .5rem; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 1rem; }
.form-section h4::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ---------- Alerts ---------- */
.alert { display: flex; gap: .75rem; align-items: flex-start; padding: .9rem 1.1rem; border-radius: 12px; border: 1px solid; font-size: .875rem; font-weight: 600; }
.alert svg { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px; }
.alert-success { background: rgba(var(--mint-rgb), .1); border-color: rgba(var(--mint-rgb), .3); color: var(--mint); }
.alert-danger { background: rgba(var(--red-rgb), .1); border-color: rgba(var(--red-rgb), .3); color: var(--red); }
.alert-warning { background: rgba(var(--amber-rgb), .1); border-color: rgba(var(--amber-rgb), .3); color: var(--amber); }
.alert-info { background: rgba(var(--cyan-rgb), .1); border-color: rgba(var(--cyan-rgb), .3); color: var(--cyan); }
.alert ul { margin: .25rem 0 0; padding-left: 1.1rem; font-weight: 500; }
.toast-wrap { position: fixed; top: 1rem; right: 1rem; z-index: 200; display: flex; flex-direction: column; gap: .5rem; max-width: 380px; }
.toast { display: flex; align-items: center; gap: .65rem; padding: .8rem 1rem; border-radius: 12px; background: var(--bg-elev); border: 1px solid var(--line-strong); box-shadow: var(--shadow); font-weight: 600; font-size: .86rem; animation: toast-in .35s var(--ease); }
.toast .ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: 0 0 auto; }
.toast.success .ic { background: rgba(var(--mint-rgb), .15); color: var(--mint); } .toast.error .ic { background: rgba(var(--red-rgb), .15); color: var(--red); }
.toast .ic svg { width: 15px; height: 15px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px) scale(.97); } to { opacity: 1; transform: none; } }

/* ---------- Dropdown & modal ---------- */
.dropdown { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px; background: var(--bg-elev); border: 1px solid var(--line-strong); border-radius: 13px; box-shadow: var(--shadow); padding: .4rem; z-index: 80; }
.menu.left { right: auto; left: 0; }
.menu a, .menu button { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .55rem .7rem; border-radius: 9px; font: 600 .86rem var(--font); color: var(--txt-2); background: none; border: 0; cursor: pointer; text-align: left; }
.menu a:hover, .menu button:hover { background: var(--bg-hover); color: var(--txt); }
.menu a svg, .menu button svg { width: 16px; height: 16px; opacity: .8; }
.menu .danger { color: var(--red); }
.menu .divider { height: 1px; background: var(--line); margin: .35rem 0; }
.menu .head { padding: .55rem .7rem .35rem; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 800; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(3,4,8,.65); backdrop-filter: blur(6px); z-index: 150; display: grid; place-items: center; padding: 1rem; overflow-y: auto; }
.modal { width: 100%; max-width: 560px; background: var(--bg-elev); border: 1px solid var(--line-strong); border-radius: 18px; box-shadow: 0 40px 80px -30px rgba(0,0,0,.7); animation: toast-in .25s var(--ease); }
.modal.lg { max-width: 820px; } .modal.xl { max-width: 1040px; }
.modal .card-header h3 { font-size: 1.05rem; }

/* ---------- Description lists ---------- */
.dl { display: grid; grid-template-columns: max-content 1fr; gap: .55rem 1.2rem; font-size: .875rem; }
.dl dt { color: var(--muted); font-weight: 600; } .dl dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.info-list { display: flex; flex-direction: column; gap: .7rem; }
.info-list .item { display: flex; gap: .7rem; align-items: flex-start; font-size: .875rem; }
.info-list .item svg { width: 16px; height: 16px; color: var(--muted); margin-top: 2px; flex: 0 0 auto; }
.info-list .item small { display: block; color: var(--muted); font-size: .74rem; }

/* ---------- Progress ---------- */
.progress { height: 8px; background: var(--bg-elev-2); border: 1px solid var(--line); border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--grad); border-radius: 99px; transition: width .4s var(--ease); }
.progress.amber > span { background: linear-gradient(90deg, var(--amber), #ff7a5c); } .progress.red > span { background: var(--red); } .progress.cyan > span { background: linear-gradient(90deg, var(--cyan), var(--violet)); }
.progress.sm { height: 5px; }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 1.7rem; }
.timeline::before { content: ''; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline .tl-item { position: relative; padding-bottom: 1.15rem; }
.timeline .tl-item:last-child { padding-bottom: 0; }
.timeline .tl-dot { position: absolute; left: -1.7rem; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--bg-elev-2); border: 1px solid var(--line-strong); display: grid; place-items: center; color: var(--muted); }
.timeline .tl-dot svg { width: 11px; height: 11px; }
.timeline .tl-dot.mint { color: var(--mint); border-color: rgba(var(--mint-rgb), .5); background: rgba(var(--mint-rgb), .12); }
.timeline .tl-dot.cyan { color: var(--cyan); border-color: rgba(var(--cyan-rgb), .5); background: rgba(var(--cyan-rgb), .12); }
.timeline .tl-dot.violet { color: var(--violet); border-color: rgba(var(--violet-rgb), .5); background: rgba(var(--violet-rgb), .12); }
.timeline .tl-dot.amber { color: var(--amber); border-color: rgba(var(--amber-rgb), .5); background: rgba(var(--amber-rgb), .12); }
.timeline .tl-head { display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; font-size: .82rem; }
.timeline .tl-head b { color: var(--txt); } .timeline .tl-head time { color: var(--muted-2); font-size: .75rem; margin-left: auto; }
.timeline .tl-body { font-size: .875rem; color: var(--txt-2); margin-top: .25rem; white-space: pre-line; }

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 1fr); gap: 1rem; overflow-x: auto; padding-bottom: .75rem; align-items: start; }
.kanban-col { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100vh - 220px); }
.kanban-col .kb-head { display: flex; align-items: center; gap: .55rem; padding: .85rem 1rem; border-bottom: 1px solid var(--line); font-weight: 800; font-size: .84rem; position: sticky; top: 0; background: inherit; border-radius: var(--radius) var(--radius) 0 0; }
.kanban-col .kb-head .dot { width: 9px; height: 9px; border-radius: 50%; }
.kanban-col .kb-head .count { margin-left: auto; font-size: .72rem; color: var(--muted); background: var(--bg-elev-2); padding: .1rem .5rem; border-radius: 99px; border: 1px solid var(--line); }
.kanban-col .kb-head .sum { font-size: .72rem; color: var(--muted); font-weight: 700; }
.kanban-col .kb-body { padding: .7rem; display: flex; flex-direction: column; gap: .6rem; overflow-y: auto; min-height: 120px; flex: 1; }
.kanban-col .kb-body.drag-over { background: rgba(var(--mint-rgb), .05); outline: 2px dashed rgba(var(--mint-rgb), .35); outline-offset: -6px; border-radius: 12px; }
.kb-card { background: var(--bg-elev); border: 1px solid var(--line); border-radius: 12px; padding: .8rem .9rem; cursor: grab; transition: transform .15s, border-color .15s, box-shadow .15s; }
.kb-card:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--shadow); }
.kb-card.dragging { opacity: .5; }
.kb-card .kb-title { font-weight: 700; font-size: .88rem; line-height: 1.35; }
.kb-card .kb-title a:hover { color: var(--mint); }
.kb-card .kb-meta { display: flex; align-items: center; gap: .5rem; margin-top: .55rem; font-size: .76rem; color: var(--muted); flex-wrap: wrap; }
.kb-card .kb-foot { display: flex; align-items: center; justify-content: space-between; margin-top: .6rem; gap: .5rem; }
.kb-card .kb-value { font-weight: 800; font-size: .9rem; color: var(--txt); }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 3rem 1.5rem; color: var(--muted); }
.empty .ic { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 1rem; display: grid; place-items: center; background: var(--bg-elev-2); border: 1px solid var(--line); color: var(--muted); }
.empty .ic svg { width: 24px; height: 24px; }
.empty h4 { color: var(--txt); margin-bottom: .3rem; }
.empty p { max-width: 42ch; margin: 0 auto; font-size: .875rem; }
.empty .btn { margin-top: 1rem; }

/* ---------- Misc lists ---------- */
.list { display: flex; flex-direction: column; }
.list .li { display: flex; align-items: center; gap: .8rem; padding: .8rem 1.25rem; border-bottom: 1px solid var(--line); font-size: .875rem; }
.list .li:last-child { border-bottom: 0; }
.list .li:hover { background: var(--bg-hover); }
.list .li .grow { flex: 1; min-width: 0; }
.list .li .grow b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .li .grow small { color: var(--muted); }
.li-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 auto; background: var(--bg-elev-2); border: 1px solid var(--line); color: var(--muted); }
.li-icon svg { width: 17px; height: 17px; }
.li-icon.mint { background: rgba(var(--mint-rgb), .12); color: var(--mint); border-color: rgba(var(--mint-rgb), .25); }
.li-icon.cyan { background: rgba(var(--cyan-rgb), .12); color: var(--cyan); border-color: rgba(var(--cyan-rgb), .25); }
.li-icon.violet { background: rgba(var(--violet-rgb), .12); color: var(--violet); border-color: rgba(var(--violet-rgb), .25); }
.li-icon.amber { background: rgba(var(--amber-rgb), .12); color: var(--amber); border-color: rgba(var(--amber-rgb), .25); }
.li-icon.red { background: rgba(var(--red-rgb), .12); color: var(--red); border-color: rgba(var(--red-rgb), .25); }

.divider { height: 1px; background: var(--line); margin: 1rem 0; }
.kv { display: flex; justify-content: space-between; gap: 1rem; font-size: .875rem; padding: .5rem 0; border-bottom: 1px dashed var(--line); }
.kv:last-child { border-bottom: 0; } .kv span:first-child { color: var(--muted); } .kv b { font-variant-numeric: tabular-nums; }
.kv.total { border-top: 1px solid var(--line-strong); border-bottom: 0; margin-top: .3rem; padding-top: .7rem; font-size: 1rem; }
.hero-card { position: relative; overflow: hidden; background: linear-gradient(135deg, rgba(var(--mint-rgb), .14), rgba(var(--violet-rgb), .12) 60%, transparent); border: 1px solid rgba(var(--mint-rgb), .25); }
.hero-card::after { content: ''; position: absolute; right: -80px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(var(--cyan-rgb), .22), transparent 65%); }
.chart-box { position: relative; height: 280px; }
.chart-box.sm { height: 200px; }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .78rem; color: var(--muted); font-weight: 600; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.sla { font-size: .72rem; font-weight: 700; } .sla.ok { color: var(--mint); } .sla.warn { color: var(--amber); } .sla.bad { color: var(--red); }
.note-box { background: var(--bg-elev-2); border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1rem; font-size: .875rem; white-space: pre-line; color: var(--txt-2); }
.reply { display: flex; gap: .8rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.reply:last-child { border-bottom: 0; }
.reply.internal { background: rgba(var(--amber-rgb), .06); }
.reply .body { flex: 1; min-width: 0; } .reply .body .head { display: flex; gap: .5rem; align-items: center; font-size: .8rem; flex-wrap: wrap; } .reply .body .head time { color: var(--muted-2); margin-left: auto; }
.reply .body .text { margin-top: .4rem; white-space: pre-line; font-size: .875rem; color: var(--txt-2); }
.print-only { display: none; }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth .side { position: relative; overflow: hidden; background: #06070A; color: #EAEEF5; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; }
.auth .side::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 20% 20%, rgba(16,228,167,.22), transparent 45%), radial-gradient(circle at 80% 70%, rgba(139,124,255,.22), transparent 45%), radial-gradient(circle at 60% 30%, rgba(45,212,255,.12), transparent 40%); }
.auth .side > * { position: relative; }
.auth .side h1 { font-size: clamp(2rem, 3.6vw, 3rem); line-height: 1.1; margin-top: 1rem; max-width: 16ch; }
.auth .side .feature-list { display: grid; gap: .8rem; margin-top: 2rem; }
.auth .side .feature-list div { display: flex; gap: .7rem; align-items: center; font-weight: 600; color: #C3CAD6; }
.auth .side .feature-list svg { width: 18px; height: 18px; color: #10E4A7; }
.auth .form { display: grid; place-items: center; padding: 2rem; background: var(--bg); }
.auth .form .box { width: 100%; max-width: 420px; }
.auth .form .box h2 { font-size: 1.6rem; } .auth .form .box p { color: var(--muted); margin-top: .3rem; }
.auth .form .field { margin-top: 1rem; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main, .grid-main-3 { grid-template-columns: minmax(0, 1fr); }
  .col-3, .col-4 { grid-column: span 6; } .col-2 { grid-column: span 4; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); width: var(--sidebar-w) !important; }
  .shell.mobile-open .sidebar { transform: none; box-shadow: 0 0 0 100vw rgba(0,0,0,.5); }
  .shell.collapsed .sidebar .brand .name, .shell.collapsed .sidebar .nav-section, .shell.collapsed .nav-link span, .shell.collapsed .nav-link .count, .shell.collapsed .sidebar-footer .meta { display: block; }
  .shell.collapsed .nav-link span { display: inline; }
  .shell.collapsed .sidebar .nav-link { justify-content: flex-start; padding: .6rem .8rem; }
  .shell.collapsed .sidebar .nav-link::after { display: none; }
  .main, .shell.collapsed .main { margin-left: 0; }
  .navbar { padding: 0 1rem; } .navbar .breadcrumb { display: none; } .navbar .search { max-width: none; }
  .content { padding: 1.1rem 1rem 3rem; }
  .auth { grid-template-columns: 1fr; } .auth .side { display: none; }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .col-3, .col-4, .col-6, .col-8, .col-9, .col-2 { grid-column: span 12; }
  .span-2 { grid-column: span 1; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat .value { font-size: 1.35rem; }
  .page-header .actions { width: 100%; }
  .navbar .search { display: none; }
  .filters .search-input { min-width: 0; max-width: none; width: 100%; }
}
@media print {
  .sidebar, .navbar, .no-print { display: none !important; }
  .main { margin: 0 !important; } body { background: #fff; color: #000; }
  .card { box-shadow: none; border-color: #ddd; } .print-only { display: block; }
}

/* ---------- Chat WhatsApp ---------- */
.chat { display: grid; grid-template-columns: 340px minmax(0, 1fr); height: calc(100vh - var(--navbar-h) - 3.2rem); min-height: 520px; background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.chat.with-side { grid-template-columns: 340px minmax(0, 1fr) 300px; }
.chat-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.chat-list .head { padding: .9rem 1rem .6rem; border-bottom: 1px solid var(--line); }
.chat-list .head .input { height: 38px; font-size: .85rem; }
.chat-list .items { overflow-y: auto; flex: 1; }
.conv { display: flex; gap: .7rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line); align-items: flex-start; transition: background .15s; }
.conv:hover { background: var(--bg-hover); }
.conv.active { background: linear-gradient(90deg, rgba(var(--mint-rgb), .12), transparent); box-shadow: inset 3px 0 0 var(--mint); }
.conv .grow { flex: 1; min-width: 0; }
.conv .row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.conv .name { font-weight: 700; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv .time { font-size: .7rem; color: var(--muted-2); white-space: nowrap; }
.conv .preview { font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: .15rem; }
.conv .unread { min-width: 20px; height: 20px; border-radius: 99px; background: var(--mint); color: #04120E; font-size: .68rem; font-weight: 800; display: grid; place-items: center; padding: 0 .35rem; }
.conv .client { font-size: .7rem; color: var(--cyan); font-weight: 700; }
.chat-main { display: flex; flex-direction: column; min-height: 0; background: var(--bg-soft); }
.chat-head { display: flex; align-items: center; gap: .8rem; padding: .75rem 1.1rem; border-bottom: 1px solid var(--line); background: var(--bg-elev); }
.chat-head .who b { display: block; font-size: .95rem; } .chat-head .who small { color: var(--muted); }
.chat-body { flex: 1; overflow-y: auto; padding: 1.2rem 1.2rem .6rem; display: flex; flex-direction: column; gap: .35rem; background-image: radial-gradient(rgba(255,255,255,.025) 1px, transparent 1px); background-size: 22px 22px; }
.day-sep { align-self: center; font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--bg-elev); border: 1px solid var(--line); padding: .25rem .7rem; border-radius: 99px; margin: .6rem 0; }
.bubble { max-width: min(72%, 560px); padding: .55rem .8rem .35rem; border-radius: 14px; font-size: .9rem; line-height: 1.45; position: relative; white-space: pre-line; overflow-wrap: anywhere; }
.bubble.in { align-self: flex-start; background: var(--bg-elev); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble.out { align-self: flex-end; background: rgba(var(--mint-rgb), .16); border: 1px solid rgba(var(--mint-rgb), .3); border-bottom-right-radius: 4px; }
[data-theme="light"] .bubble.out { background: #DCFCE7; border-color: #BBF7D0; }
.bubble.template { border-style: dashed; }
.bubble .meta { display: flex; justify-content: flex-end; align-items: center; gap: .3rem; font-size: .66rem; color: var(--muted-2); margin-top: .2rem; white-space: nowrap; }
.bubble .meta .ticks { font-weight: 800; } .bubble .meta .ticks.read { color: var(--cyan); } .bubble .meta .failed { color: var(--red); font-weight: 700; }
.bubble .agent { font-size: .66rem; font-weight: 800; color: var(--mint); margin-bottom: .15rem; }
.bubble img { max-width: 320px; border-radius: 10px; margin: .2rem 0; }
.bubble audio { width: 260px; max-width: 100%; }
.bubble .doc { display: inline-flex; gap: .5rem; align-items: center; background: var(--bg-elev-2); border: 1px solid var(--line); padding: .5rem .7rem; border-radius: 10px; font-weight: 700; font-size: .82rem; }
.chat-compose { padding: .8rem 1rem; border-top: 1px solid var(--line); background: var(--bg-elev); }
.chat-compose .box { display: flex; gap: .6rem; align-items: flex-end; }
.chat-compose textarea { flex: 1; min-height: 44px; max-height: 160px; height: 44px; padding: .65rem .9rem; resize: none; }
.chat-compose .warn { display: flex; gap: .5rem; align-items: center; font-size: .8rem; color: var(--amber); font-weight: 600; margin-bottom: .5rem; }
.chat-side { border-left: 1px solid var(--line); overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 1rem; font-size: .85rem; }
.chat-side h4 { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: .5rem; }
.chat-side .select, .chat-side .input { height: 36px; font-size: .82rem; }
.chat-empty { display: grid; place-items: center; height: 100%; }
@media (max-width: 1100px) { .chat.with-side { grid-template-columns: 300px minmax(0, 1fr); } .chat-side { display: none; } }
@media (max-width: 800px) { .chat, .chat.with-side { grid-template-columns: 1fr; height: auto; min-height: 70vh; } .chat-list { max-height: 45vh; } .chat.has-conv .chat-list { display: none; } .chat-body { min-height: 50vh; } }

/* ---------- Módulo Produtos: seletor de cor (chips) e cartões de produto ---------- */
.color-picker { display: flex; gap: .5rem; flex-wrap: wrap; }
.color-picker label { cursor: pointer; position: relative; }
.color-picker input { position: absolute; opacity: 0; width: 0; height: 0; }
.color-picker .swatch { width: 32px; height: 32px; border-radius: 10px; border: 2px solid transparent; display: grid; place-items: center; color: #0B0F14; transition: transform .15s, border-color .15s; }
.color-picker .swatch svg { width: 15px; height: 15px; opacity: 0; }
.color-picker input:checked + .swatch { border-color: var(--txt); transform: scale(1.1); }
.color-picker input:checked + .swatch svg { opacity: 1; }
.color-picker input:focus-visible + .swatch { outline: 2px solid var(--line-strong); outline-offset: 2px; }
.product-card .plan-row { display: flex; align-items: center; gap: .8rem; padding: .7rem 1.25rem; border-top: 1px solid var(--line); font-size: .85rem; flex-wrap: wrap; }
.product-card .plan-row .grow { flex: 1; min-width: 0; }
.product-card .plan-row small { color: var(--muted); display: block; }
.product-card .plan-row.inactive .grow { opacity: .55; }

/* ---------- Módulo Projetos / Tarefas / Horas (adições) ---------- */
.ring { --p: 0; --c: var(--mint); width: 54px; height: 54px; border-radius: 50%; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--bg-elev-2) 0); display: grid; place-items: center; flex: 0 0 auto; }
.ring::after { content: attr(data-label); width: 42px; height: 42px; border-radius: 50%; background: var(--bg-elev); display: grid; place-items: center; font-size: .72rem; font-weight: 800; color: var(--txt); }
.ring.amber { --c: var(--amber); } .ring.red { --c: var(--red); } .ring.cyan { --c: var(--cyan); }
.project-card { display: flex; flex-direction: column; gap: .8rem; padding: 1.1rem 1.25rem; }
.project-card .pc-title { font-weight: 800; font-size: .95rem; line-height: 1.3; }
.project-card .pc-title a:hover { color: var(--mint); }
.project-card .pc-meta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-size: .78rem; color: var(--muted); }
.table tr.group-row td { background: var(--bg-elev-2); font-weight: 800; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: .55rem 1rem; }
.table tr.group-row:hover { background: transparent; }
.kb-card .kb-meta .chip { font-size: .68rem; padding: .15rem .45rem; }
.line-through { text-decoration: line-through; }

/* chat: abas da lista compactas para caber em 340px */
.chat-tabs { width: 100%; display: flex; }
.chat-tabs a { flex: 1 1 0; min-width: 0; justify-content: center; padding: .35rem .25rem; font-size: .72rem; white-space: nowrap; gap: .25rem; }

/* ---------- Chat: respostas, anexos, áudio ---------- */
.bubble { position: relative; }
.bubble .reply-btn { position: absolute; top: 4px; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg-elev); color: var(--muted); display: grid; place-items: center; opacity: 0; transition: opacity .15s; cursor: pointer; }
.bubble.in .reply-btn { right: -30px; } .bubble.out .reply-btn { left: -30px; }
.bubble:hover .reply-btn { opacity: 1; } .bubble .reply-btn:hover { color: var(--txt); }
.bubble.flash { box-shadow: 0 0 0 3px rgba(var(--cyan-rgb), .5); }
.bubble.sticker { background: transparent; border: 0; padding: 0; }
.bubble .txt { white-space: pre-line; }
.quote { display: block; border-left: 3px solid var(--cyan); background: rgba(0,0,0,.08); border-radius: 8px; padding: .35rem .6rem; margin: 0 0 .4rem; font-size: .78rem; color: var(--txt-2); text-decoration: none; }
[data-theme="light"] .quote { background: rgba(15,23,42,.06); }
.quote.out { border-left-color: var(--mint); }
.quote b { display: block; font-size: .7rem; color: var(--cyan); margin-bottom: .1rem; } .quote.out b { color: var(--mint); }
.quote .q-body { display: flex; gap: .4rem; align-items: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 420px; }
.quote .q-body img { width: 34px; height: 34px; object-fit: cover; border-radius: 6px; margin: 0; }
.compose-quote, .compose-file, .compose-rec { display: flex; align-items: center; gap: .6rem; padding: .5rem .6rem; margin-bottom: .5rem; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-elev-2); font-size: .85rem; }
.compose-file img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }
.compose-rec { color: var(--red); font-weight: 700; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); animation: rec-blink 1s infinite; }
@keyframes rec-blink { 50% { opacity: .25; } }
.chat-body.drop-target { outline: 2px dashed rgba(var(--mint-rgb), .6); outline-offset: -8px; }
.drop-hint { position: sticky; bottom: 0; align-self: center; display: flex; gap: .5rem; align-items: center; background: var(--bg-elev); border: 1px solid rgba(var(--mint-rgb), .5); color: var(--mint); font-weight: 700; padding: .5rem .9rem; border-radius: 99px; }
.bubble .doc svg:last-child { color: var(--muted); }