/* RequestDesk prototype — design tokens & shared components (plain CSS; Tailwind handles utilities). */

:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f9fafc;
  --border: #e6e8ef;
  --border-strong: #d5d9e3;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef2ff;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .06);
  --shadow-lg: 0 12px 32px -8px rgba(15, 23, 42, .18);
}

html, body { background: var(--bg); color: var(--text); }
body { font-family: 'Inter', system-ui, sans-serif; font-feature-settings: 'cv11', 'ss01'; -webkit-font-smoothing: antialiased; }
[x-cloak] { display: none !important; }

/* ---- Shell ------------------------------------------------------------- */
.sidebar { background: #0f1222; color: #c7cbe0; }
.nav-link { display: flex; align-items: center; gap: .7rem; padding: .55rem .75rem; border-radius: 9px; font-size: .875rem; font-weight: 500; color: #a9aecb; transition: background .15s, color .15s; }
.nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-link.active { background: rgba(99, 102, 241, .18); color: #fff; box-shadow: inset 2px 0 0 #818cf8; }
.nav-link svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .9; }
.nav-count { margin-left: auto; font-size: .7rem; font-weight: 600; padding: .05rem .45rem; border-radius: 999px; background: rgba(255, 255, 255, .1); color: #e0e3f5; }
.nav-count.hot { background: #6366f1; color: #fff; }
.nav-section { font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: #5f6585; padding: 1rem .75rem .35rem; font-weight: 600; }

/* ---- Surfaces ---------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--border); }
.card-title { font-size: .9rem; font-weight: 600; }
.muted { color: var(--text-2); }
.subtle { color: var(--text-3); }

/* ---- Buttons ----------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; height: 2.15rem; padding: 0 .85rem; border-radius: 9px; font-size: .82rem; font-weight: 600; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); transition: all .15s; white-space: nowrap; cursor: pointer; }
.btn:hover { background: var(--surface-2); border-color: #c3c8d6; }
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-soft { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.btn-soft:hover { background: #e0e7ff; border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: #eef0f5; border-color: transparent; }
.btn-success { background: #059669; border-color: #059669; color: #fff; }
.btn-success:hover { background: #047857; }
.btn-whatsapp { background: #25d366; border-color: #25d366; color: #fff; }
.btn-whatsapp:hover { background: #1ebe5b; }
.btn-sm { height: 1.8rem; padding: 0 .6rem; font-size: .76rem; border-radius: 7px; }
.btn-icon { width: 2.15rem; padding: 0; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---- Badges / tags ----------------------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .5rem; border-radius: 999px; font-size: .72rem; font-weight: 600; line-height: 1.3rem; white-space: nowrap; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag { display: inline-flex; align-items: center; gap: .2rem; padding: 0 .35rem; border-radius: 5px; font-size: .64rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; line-height: 1.1rem; }
.tone-slate   { background: #f1f5f9; color: #475569; }
.tone-zinc    { background: #f4f4f5; color: #71717a; }
.tone-sky     { background: #e0f2fe; color: #0369a1; }
.tone-indigo  { background: #e0e7ff; color: #4338ca; }
.tone-violet  { background: #ede9fe; color: #6d28d9; }
.tone-amber   { background: #fef3c7; color: #b45309; }
.tone-teal    { background: #ccfbf1; color: #0f766e; }
.tone-emerald { background: #d1fae5; color: #047857; }
.tone-rose    { background: #ffe4e6; color: #be123c; }
.tone-ai      { background: linear-gradient(90deg, #ede9fe, #e0e7ff); color: #5b21b6; }
.tone-manual  { background: #fff7ed; color: #c2410c; }
.tone-whatsapp{ background: #dcfce7; color: #15803d; }

/* ---- Pills (date ranges, filters) -------------------------------------- */
.pills { display: inline-flex; flex-wrap: wrap; gap: .25rem; padding: .25rem; background: #eceef4; border-radius: 999px; }
.pill { padding: .32rem .8rem; border-radius: 999px; font-size: .78rem; font-weight: 600; color: var(--text-2); cursor: pointer; transition: all .15s; }
.pill:hover { color: var(--text); }
.pill.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ---- Tables ------------------------------------------------------------ */
.table { width: 100%; font-size: .84rem; border-collapse: separate; border-spacing: 0; }
.table th { text-align: left; font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); padding: .65rem 1.1rem; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: .75rem 1.1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: #fafbfe; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pill { white-space: nowrap; }

/* ---- Forms ------------------------------------------------------------- */
.input, .select, .textarea { width: 100%; height: 2.25rem; padding: 0 .75rem; border: 1px solid var(--border-strong); border-radius: 9px; background: var(--surface); font-size: .85rem; color: var(--text); outline: none; transition: border .15s, box-shadow .15s; }
.textarea { height: auto; padding: .6rem .75rem; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: #a5b4fc; box-shadow: 0 0 0 3px rgba(99, 102, 241, .15); }
.label { display: block; font-size: .75rem; font-weight: 600; color: var(--text-2); margin-bottom: .3rem; }

/* ---- Misc -------------------------------------------------------------- */
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; font-weight: 700; font-size: .7rem; color: #fff; flex-shrink: 0; }
.kpi-value { font-size: 1.65rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.divider { height: 1px; background: var(--border); }
.scroll-thin::-webkit-scrollbar { width: 8px; height: 8px; }
.scroll-thin::-webkit-scrollbar-thumb { background: #d6dae4; border-radius: 8px; }
.confidence { height: 5px; border-radius: 999px; background: #eceef4; overflow: hidden; }
.confidence > span { display: block; height: 100%; border-radius: 999px; }

.toast-enter { animation: toastIn .25s ease-out; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.table-tight th, .table-tight td { padding-left: .7rem; padding-right: .7rem; }
.table-tight th:first-child, .table-tight td:first-child { padding-left: 1.1rem; }
.pills { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
