/* Brand palette sourced from deskconecta.com (see memory: deskconecta-brand-colors). */
:root {
  --bg: #f7f9fb; --surface: #ffffff; --surface-2: #f1f4f8; --border: #e3e8ed;
  --text: #16191f; --muted: #6b7684; --primary: #eb6831; --primary-ink: #ffffff;
  --ok: #1a7f5a; --warn: #eb9d36; --danger: #b42318; --ring: rgba(235,104,49,.35);
  --radius: 12px; --shadow: 0 1px 2px rgba(14,16,19,.05), 0 8px 24px -12px rgba(14,16,19,.18);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Arial, sans-serif;
}
[data-theme="dark"] {
  --bg: #0e1013; --surface: #16191f; --surface-2: #21262e; --border: #333b45;
  --text: #f1f4f8; --muted: #929ca9; --primary: #eb6831; --ring: rgba(235,104,49,.4);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.4);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); }
a { color: var(--primary); }
button { font-family: inherit; cursor: pointer; }
.btn { border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: .55rem .9rem; border-radius: 10px; font-weight: 600; font-size: .9rem; }
.btn:hover { border-color: var(--primary); }
.btn.primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.sm { padding: .35rem .6rem; font-size: .8rem; }
.btn.ghost { background: transparent; }
input, select { font-family: inherit; font-size: .95rem; padding: .6rem .7rem; width: 100%;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 10px; }
input:focus, select:focus, .btn:focus { outline: none; box-shadow: 0 0 0 3px var(--ring); border-color: var(--primary); }
label { display: block; font-size: .82rem; color: var(--muted); margin: .1rem 0 .3rem; font-weight: 600; }
.field { margin-bottom: .8rem; }

/* Auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.6rem; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.1rem; }
.brand .dot { width: 26px; height: 26px; border-radius: 50%; border: 5px solid var(--primary); }
/* Real DeskConecta logo + EKG heartbeat. Logo swaps by theme (white on dark, dark on light). */
.brand-logo { height: 24px; width: auto; display: block; }
.brand-logo-light { display: none; }
[data-theme="light"] .brand-logo-dark { display: none; }
[data-theme="light"] .brand-logo-light { display: block; }
.brand-sub { color: var(--muted); font-weight: 600; font-size: .9rem; border-left: 1px solid var(--border); padding-left: .55rem; }
.ekg { display: block; height: 24px; width: 72px; }
.ekg-base { fill: none; stroke: var(--muted); stroke-width: 2; opacity: .35; }
.ekg-pulse { fill: none; stroke: var(--primary); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 46 600; filter: drop-shadow(0 0 5px var(--primary)); animation: ekgsweep 2.4s linear infinite; }
@keyframes ekgsweep { from { stroke-dashoffset: 646; } to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .ekg-pulse { animation: none; stroke-dasharray: none; } }
.brand-side { flex-direction: column; align-items: flex-start; gap: .35rem; }
.brand-side .ekg { width: 100%; height: 22px; }
.tagline { color: var(--muted); font-size: .9rem; margin: .3rem 0 1.2rem; }
.tabs { display: flex; gap: .3rem; background: var(--surface-2); padding: .25rem; border-radius: 10px; margin-bottom: 1rem; }
.tabs button { flex: 1; border: none; background: transparent; padding: .5rem; border-radius: 8px; color: var(--muted); font-weight: 700; }
.tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* Shell */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--border); padding: 1.1rem; display: flex; flex-direction: column; gap: .3rem; }
.side .brand { margin-bottom: 1.2rem; }
.nav a { display: flex; align-items: center; gap: .6rem; padding: .6rem .7rem; border-radius: 10px;
  color: var(--text); text-decoration: none; font-weight: 600; font-size: .92rem; }
.nav a:hover { background: var(--surface-2); }
.nav a.active { background: var(--primary); color: var(--primary-ink); }
.side .spacer { flex: 1; }
.main { padding: 1.4rem 1.8rem; max-width: 1100px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.2rem; gap: 1rem; }
.topbar h1 { font-size: 1.4rem; margin: 0; }
.row { display: flex; gap: .5rem; align-items: center; }

/* Cards & tiles */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem; }
.grid { display: grid; gap: 1rem; }
.tiles { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.tile .k { color: var(--muted); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.tile .v { font-size: 1.9rem; font-weight: 800; margin-top: .2rem; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .65rem .6rem; border-bottom: 1px solid var(--border); font-size: .9rem; }
th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }
tr:last-child td { border-bottom: none; }
.badge { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.badge.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.badge.down { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.badge.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.badge.muted { background: var(--surface-2); color: var(--muted); }
.dot-s { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.muted { color: var(--muted); }
.notice { padding: .7rem .9rem; border-radius: 10px; font-size: .88rem; margin-bottom: 1rem; }
.notice.err { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.notice.ok { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); }
.codes { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--surface-2);
  padding: .8rem; border-radius: 10px; font-size: .85rem; white-space: pre-wrap; word-break: break-all; }
.section-title { font-size: 1rem; font-weight: 800; margin: 1.4rem 0 .6rem; }
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { flex-direction: row; flex-wrap: wrap; border-right: none; border-bottom: 1px solid var(--border); }
  .side .spacer { display: none; } .nav { display: flex; flex-wrap: wrap; gap: .2rem; }
}
