/* Deskora platform UI (admin console, company Account pages, website forms). Compact by design: small headers,
   dense tables (30px rows), tight grid. Prefix dk- so it never collides with the company app's styles. */
:root {
    --dk-bg: #f4f6f9; --dk-panel: #ffffff; --dk-line: #e3e8ef; --dk-line2: #eef1f5;
    --dk-ink: #1b2533; --dk-ink2: #3d4b5c; --dk-muted: #6b7686; --dk-faint: #98a2b3;
    --dk-pri: #0b4f9c; --dk-pri2: #1677d2; --dk-pri-soft: #e8f0fb; --dk-pri-ink: #0a3f7d;
    --dk-ok: #12805c; --dk-ok-soft: #e3f5ec; --dk-warn: #a35f00; --dk-warn-soft: #fff4dc;
    --dk-bad: #c0352b; --dk-bad-soft: #fde9e7; --dk-info-soft: #e7f1fd;
    --dk-r: 8px; --dk-r-sm: 6px; --dk-shadow: 0 1px 2px rgba(16, 24, 40, .05); --dk-shadow-lg: 0 12px 32px rgba(16, 24, 40, .14);
    --dk-font: "Inter", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
}
.dk, .dk * { box-sizing: border-box; }
body.dk { margin: 0; background: var(--dk-bg); color: var(--dk-ink); font: 13px/1.45 var(--dk-font); -webkit-font-smoothing: antialiased; }
.dk a { color: var(--dk-pri2); text-decoration: none; } .dk a:hover { text-decoration: underline; }
.dk h1, .dk h2, .dk h3, .dk h4 { margin: 0; color: var(--dk-ink); letter-spacing: -.01em; }

/* ---------- shell: slim sidebar + 48px top bar ---------- */
.dk-shell { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: 100vh; }
.dk-side { background: #0f1b2d; color: #c5cfdc; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.dk-brand { display: flex; align-items: center; gap: 9px; padding: 12px 14px; color: #fff; font-weight: 650; font-size: 14px; }
.dk-brand img { width: 26px; height: 26px; border-radius: 6px; } .dk-brand small { display: block; font-weight: 500; font-size: 10.5px; color: #8fa0b6; letter-spacing: .04em; text-transform: uppercase; }
.dk-nav { padding: 4px 8px 16px; }
.dk-nav .sec { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: #6f8098; padding: 12px 8px 4px; }
.dk-nav a { display: flex; align-items: center; gap: 9px; padding: 6px 9px; border-radius: 6px; color: #c5cfdc; font-weight: 500; }
.dk-nav a i { font-size: 16px; opacity: .85; } .dk-nav a:hover { background: #18273d; color: #fff; text-decoration: none; }
.dk-nav a.on { background: #1d3557; color: #fff; } .dk-nav a .n { margin-left: auto; background: #2f6fd0; color: #fff; font-size: 10.5px; padding: 0 6px; border-radius: 999px; font-weight: 650; }
.dk-side .foot { margin-top: auto; padding: 10px 14px; font-size: 11.5px; color: #8fa0b6; border-top: 1px solid #1c2a40; }
.dk-main { min-width: 0; display: flex; flex-direction: column; }
.dk-top { height: 48px; background: var(--dk-panel); border-bottom: 1px solid var(--dk-line); display: flex; align-items: center; gap: 12px; padding: 0 18px; position: sticky; top: 0; z-index: 20; }
.dk-top .crumbs { color: var(--dk-muted); font-size: 12.5px; } .dk-top .crumbs b { color: var(--dk-ink); font-weight: 600; }
.dk-top .sp { flex: 1; }
.dk-top .me { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--dk-ink2); }
.dk-av { width: 26px; height: 26px; border-radius: 50%; background: var(--dk-pri-soft); color: var(--dk-pri); display: inline-grid; place-items: center; font-weight: 700; font-size: 11px; }
.dk-content { padding: 14px 18px 28px; }

/* ---------- page head (small) ---------- */
.dk-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.dk-head h1 { font-size: 16px; font-weight: 650; } .dk-head .sub { color: var(--dk-muted); font-size: 12.5px; }
.dk-head .sp { flex: 1; } .dk-head .acts { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- grid ---------- */
.dk-grid { display: grid; gap: 10px; } .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .g6 { grid-template-columns: repeat(6, minmax(0, 1fr)); } .g-side { grid-template-columns: minmax(0, 1fr) 320px; }
.span2 { grid-column: span 2; } .span3 { grid-column: span 3; } .full { grid-column: 1 / -1; }
@media (max-width: 1100px) { .g4, .g6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-side { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .g2, .g3, .g4, .g6 { grid-template-columns: 1fr; } .span2, .span3 { grid-column: auto; } }

/* ---------- cards ---------- */
.dk-card { background: var(--dk-panel); border: 1px solid var(--dk-line); border-radius: var(--dk-r); box-shadow: var(--dk-shadow); min-width: 0; }
.dk-card > .hd { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--dk-line2); }
.dk-card > .hd h3 { font-size: 13px; font-weight: 650; } .dk-card > .hd .sp { flex: 1; } .dk-card > .hd .muted { font-size: 12px; }
.dk-card > .bd { padding: 10px 12px; } .dk-card > .bd.flush { padding: 0; } .dk-card > .ft { padding: 8px 12px; border-top: 1px solid var(--dk-line2); display: flex; gap: 6px; justify-content: flex-end; }

/* ---------- KPI tiles ---------- */
.dk-kpi { background: var(--dk-panel); border: 1px solid var(--dk-line); border-radius: var(--dk-r); padding: 9px 12px; box-shadow: var(--dk-shadow); }
.dk-kpi .l { font-size: 11px; color: var(--dk-muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.dk-kpi .v { font-size: 19px; font-weight: 700; margin-top: 2px; letter-spacing: -.02em; } .dk-kpi .s { font-size: 11.5px; color: var(--dk-muted); }
.dk-kpi.ok .v { color: var(--dk-ok); } .dk-kpi.warn .v { color: var(--dk-warn); } .dk-kpi.bad .v { color: var(--dk-bad); }

/* ---------- compact table ---------- */
.dk-tw { overflow-x: auto; }
table.dk-t { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.dk-t th { position: sticky; top: 0; background: #f7f9fb; color: var(--dk-muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
    text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--dk-line); white-space: nowrap; }
.dk-t td { padding: 5px 10px; border-bottom: 1px solid var(--dk-line2); vertical-align: middle; height: 30px; }
.dk-t tbody tr:hover td { background: #f8fafd; } .dk-t tr:last-child td { border-bottom: 0; }
.dk-t .r, .dk-t th.r { text-align: right; font-variant-numeric: tabular-nums; } .dk-t .c { text-align: center; } .dk-t .nw { white-space: nowrap; }
.dk-t td.main a { font-weight: 600; color: var(--dk-ink); } .dk-t td .sm { display: block; color: var(--dk-muted); font-size: 11.5px; }
.dk-t tr.unread td.main a { color: var(--dk-pri); } .dk-t tr.unread td:first-child { box-shadow: inset 3px 0 0 var(--dk-pri2); }
.dk-empty { padding: 22px; text-align: center; color: var(--dk-muted); }

/* ---------- badges ---------- */
.dk-b { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 650; white-space: nowrap; background: #eef1f5; color: var(--dk-ink2); }
.dk-b.ok, .dk-b.active, .dk-b.paid, .dk-b.answered, .dk-b.sent, .dk-b.won { background: var(--dk-ok-soft); color: var(--dk-ok); }
.dk-b.trial, .dk-b.open, .dk-b.info, .dk-b.queued, .dk-b.new, .dk-b.pending { background: var(--dk-info-soft); color: #1d5fa8; }
.dk-b.warn, .dk-b.past_due, .dk-b.waiting, .dk-b.warning, .dk-b.high, .dk-b.held { background: var(--dk-warn-soft); color: var(--dk-warn); }
.dk-b.bad, .dk-b.suspended, .dk-b.critical, .dk-b.urgent, .dk-b.failed, .dk-b.lost { background: var(--dk-bad-soft); color: var(--dk-bad); }
.dk-b.cancelled, .dk-b.void, .dk-b.closed, .dk-b.low { background: #eef1f5; color: var(--dk-muted); }
.dk-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--dk-faint); } .dk-dot.ok { background: #1fb478; } .dk-dot.bad { background: #e0493d; } .dk-dot.warn { background: #f0a020; }

/* ---------- buttons ---------- */
.dk-btn { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 11px; border-radius: var(--dk-r-sm); border: 1px solid var(--dk-line); background: #fff;
    color: var(--dk-ink); font: 600 12.5px var(--dk-font); cursor: pointer; white-space: nowrap; text-decoration: none !important; }
.dk-btn:hover { background: #f6f8fb; } .dk-btn i { font-size: 15px; }
.dk-btn.pri { background: var(--dk-pri); border-color: var(--dk-pri); color: #fff; } .dk-btn.pri:hover { background: var(--dk-pri-ink); }
.dk-btn.ok { background: var(--dk-ok); border-color: var(--dk-ok); color: #fff; } .dk-btn.bad { color: var(--dk-bad); border-color: #f1c4bf; } .dk-btn.bad:hover { background: var(--dk-bad-soft); }
.dk-btn.ghost { border-color: transparent; background: transparent; } .dk-btn.sm { height: 24px; padding: 0 8px; font-size: 12px; } .dk-btn.lg { height: 36px; padding: 0 16px; font-size: 13.5px; }
.dk-btn[disabled] { opacity: .5; pointer-events: none; }

/* ---------- forms (compact) ---------- */
.dk-f { display: flex; flex-direction: column; gap: 3px; min-width: 0; } .dk-f > span { font-size: 11.5px; font-weight: 600; color: var(--dk-ink2); }
.dk-f > small { color: var(--dk-muted); font-size: 11.5px; }
.dk input[type=text], .dk input[type=tel], .dk input[type=email], .dk input[type=password], .dk input[type=number], .dk input[type=date], .dk input[type=datetime-local], .dk input[type=url], .dk input[type=search], .dk select, .dk textarea {
    width: 100%; height: 30px; padding: 4px 9px; border: 1px solid #d5dce5; border-radius: var(--dk-r-sm); background: #fff; color: var(--dk-ink); font: 13px var(--dk-font); outline: none; }
.dk textarea { height: auto; min-height: 80px; padding: 7px 9px; resize: vertical; line-height: 1.45; }
.dk input:focus, .dk select:focus, .dk textarea:focus { border-color: var(--dk-pri2); box-shadow: 0 0 0 3px rgba(22, 119, 210, .14); }
.dk-check { display: flex; align-items: center; gap: 7px; font-size: 12.5px; } .dk-check input { width: 15px; height: 15px; }
.dk-form { display: grid; gap: 9px 12px; }
.dk-filters { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; } .dk-filters input, .dk-filters select { width: auto; min-width: 150px; }
.dk-seg { display: inline-flex; border: 1px solid var(--dk-line); border-radius: var(--dk-r-sm); overflow: hidden; background: #fff; }
.dk-seg a { padding: 4px 10px; font-size: 12px; font-weight: 600; color: var(--dk-ink2); border-right: 1px solid var(--dk-line); } .dk-seg a:last-child { border-right: 0; }
.dk-seg a.on { background: var(--dk-pri-soft); color: var(--dk-pri); } .dk-seg a:hover { text-decoration: none; background: #f6f8fb; }

/* ---------- alerts, misc ---------- */
.dk-alert { display: flex; gap: 9px; align-items: flex-start; padding: 8px 12px; border-radius: var(--dk-r); border: 1px solid; font-size: 12.5px; margin-bottom: 10px; }
.dk-alert i { font-size: 17px; margin-top: 1px; } .dk-alert b { display: block; }
.dk-alert.ok { background: var(--dk-ok-soft); border-color: #bfe6d3; color: #0c5e43; } .dk-alert.bad { background: var(--dk-bad-soft); border-color: #f4c6c1; color: #8e241c; }
.dk-alert.warn { background: var(--dk-warn-soft); border-color: #f2d9a6; color: #7a4800; } .dk-alert.info { background: var(--dk-info-soft); border-color: #c7dcf5; color: #134f8c; }
.muted { color: var(--dk-muted); } .faint { color: var(--dk-faint); } .mono { font-family: Consolas, "SF Mono", monospace; font-size: 12px; } .num { font-variant-numeric: tabular-nums; }
.dk-kv { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 4px 10px; font-size: 12.5px; } .dk-kv dt { color: var(--dk-muted); } .dk-kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.dk-pager { display: flex; gap: 6px; align-items: center; justify-content: flex-end; padding: 8px 12px; font-size: 12px; color: var(--dk-muted); }
.dk-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--dk-line); margin-bottom: 10px; }
.dk-tabs a { padding: 6px 12px; font-weight: 600; font-size: 12.5px; color: var(--dk-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.dk-tabs a.on { color: var(--dk-pri); border-color: var(--dk-pri); } .dk-tabs a:hover { text-decoration: none; color: var(--dk-ink); }

/* ---------- conversation (tickets) ---------- */
.dk-thread { display: flex; flex-direction: column; gap: 8px; }
.dk-msg { border: 1px solid var(--dk-line); border-radius: var(--dk-r); background: #fff; max-width: 88%; }
.dk-msg .mh { display: flex; gap: 8px; align-items: center; padding: 6px 10px; border-bottom: 1px solid var(--dk-line2); font-size: 12px; color: var(--dk-muted); }
.dk-msg .mh b { color: var(--dk-ink); } .dk-msg .mb { padding: 8px 10px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
.dk-msg.me { align-self: flex-end; background: #f5f9ff; border-color: #d3e3f8; } .dk-msg.note { background: #fffaf0; border-color: #f1d9a6; border-style: dashed; }

/* ---------- bar chart (CSS only, values from the page) ---------- */
.dk-bars { display: flex; align-items: flex-end; gap: 3px; height: 90px; padding-top: 6px; }
.dk-bars span { flex: 1; background: linear-gradient(180deg, #2f80d8, #0b4f9c); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.dk-bars span:hover::after { content: attr(data-t); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: #1b2533; color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 4px; white-space: nowrap; }
.dk-axis { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--dk-faint); margin-top: 3px; }

/* ---------- auth pages ---------- */
.dk-auth { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(1200px 500px at 10% -10%, #dbe8fb, transparent), linear-gradient(180deg, #f6f8fb, #eef2f7); padding: 20px; }
.dk-auth .box { width: min(380px, 100%); background: #fff; border: 1px solid var(--dk-line); border-radius: 12px; box-shadow: var(--dk-shadow-lg); padding: 22px; }
.dk-auth .box img { height: 30px; } .dk-auth h1 { font-size: 17px; margin: 14px 0 2px; } .dk-auth p { color: var(--dk-muted); margin: 0 0 14px; }

@media (max-width: 900px) { .dk-shell { grid-template-columns: 1fr; } .dk-side { position: static; height: auto; } .dk-nav { display: flex; flex-wrap: wrap; gap: 2px; } .dk-nav .sec { display: none; } .dk-side .foot { display: none; } }
