/* ====================================================================
   Arcadea PBX — minimal editorial UI
   Sistema visual Evolia: Geist + Instrument Serif + JetBrains Mono + #1b17ff
==================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Instrument+Serif:ital@0;1&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg:        #fafafa;
  --bg-card:   #fff;
  --border:    #e5e5e5;
  --text:      #0a0a0a;
  --text-mute: #6b6b6b;
  --accent:    #1b17ff;
  --accent-h:  #0e0bbf;
  --ok:        #16a34a;
  --warn:      #ea580c;
  --err:       #dc2626;
  --shadow:    0 1px 2px rgba(0,0,0,0.04);
  --radius:    6px;
  --mono:      'JetBrains Mono', ui-monospace, monospace;
  --serif:     'Instrument Serif', Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Geist', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code, pre { font-family: var(--mono); font-size: 13px; }

/* ===== Topbar ===== */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.topbar-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; gap: 32px;
  padding: 14px 24px;
}
.logo {
  font-family: var(--serif);
  font-size: 22px; font-style: italic;
  color: var(--text); letter-spacing: -0.01em;
}
.logo span { font-weight: normal; color: var(--accent); margin-left: 4px; }
.nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav a {
  color: var(--text-mute);
  padding: 6px 12px;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 500;
}
.nav a:hover { background: #f3f3f3; color: var(--text); text-decoration: none; }
.nav a.on { color: var(--accent); background: #eeeefe; }
.logout {
  font-size: 13px; color: var(--text-mute); padding: 6px 10px;
}
.logout:hover { color: var(--err); }

/* ===== Main ===== */
.main {
  max-width: 1280px; margin: 0 auto;
  padding: 32px 24px 60px;
}
.main > h1 {
  font-family: var(--serif);
  font-size: 36px; font-weight: normal; font-style: italic;
  margin: 0 0 6px; letter-spacing: -0.02em;
}
.subtitle { color: var(--text-mute); margin-bottom: 32px; font-size: 15px; }

/* ===== Cards ===== */
.cards { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 12px; margin-bottom: 32px; }
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.card-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-mute); margin-bottom: 8px; }
.card-value { font-family: var(--mono); font-size: 22px; font-weight: 500; }
.card-value.ok    { color: var(--ok); }
.card-value.warn  { color: var(--warn); }
.card-value.err   { color: var(--err); }
.card-sub { font-size: 12px; color: var(--text-mute); margin-top: 6px; }

/* ===== Tables ===== */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.panel-head h2 { font-size: 15px; font-weight: 600; margin: 0; }
.panel-head .actions { display: flex; gap: 8px; }
.panel-body { padding: 0; }
.panel-body.padded { padding: 18px; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-mute); padding: 10px 18px; border-bottom: 1px solid var(--border); background: #fafafa; }
td { padding: 12px 18px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: top; }
tr:last-child td { border-bottom: none; }
tr:hover { background: #fafafa; }
td.mono, th.mono { font-family: var(--mono); font-size: 13px; }
td.actions { white-space: nowrap; text-align: right; }
td.muted { color: var(--text-mute); }

/* ===== Buttons & forms ===== */
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  border: none; border-radius: 5px;
  font: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--accent-h); text-decoration: none; color: #fff; }
.btn.ghost  { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn.ghost:hover { background: #f3f3f3; }
.btn.danger { background: var(--err); }
.btn.danger:hover { background: #b91c1c; }
.btn.sm { padding: 5px 10px; font-size: 12px; }

input[type="text"], input[type="password"], input[type="time"], input[type="date"], input[type="number"], select, textarea {
  font: inherit; font-size: 14px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #fff;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(27,23,255,0.1);
}
label { display: block; font-size: 12px; font-weight: 500; color: var(--text-mute); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.04em; }
.form-row { margin-bottom: 14px; }
.form-row + .form-actions { margin-top: 8px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; }

.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form input, .inline-form select { flex: 1; }

/* ===== Flash messages ===== */
.flash {
  padding: 12px 18px;
  margin-bottom: 24px;
  border-radius: var(--radius);
  border: 1px solid;
  font-size: 14px;
}
.flash-info    { background: #eeeefe; border-color: #c7c4ff; color: #1f1ad5; }
.flash-ok      { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.flash-warn    { background: #fff7ed; border-color: #fed7aa; color: #c2410c; }
.flash-error   { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }

/* ===== Pills / status ===== */
.pill { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-family: var(--mono); }
.pill-ok   { background: #d1fae5; color: #065f46; }
.pill-warn { background: #fed7aa; color: #9a3412; }
.pill-err  { background: #fecaca; color: #991b1b; }
.pill-mute { background: #e5e7eb; color: #4b5563; }

/* ===== Kind badge (endpoint local/remote) ===== */
.kind-badge {
  display: inline-block;
  padding: 1px 6px;
  margin-left: 6px;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  vertical-align: 1px;
}
.kind-local  { background: #eef2ff; color: #4338ca; }
.kind-remote { background: #ecfdf5; color: #047857; }

/* ===== Footer ===== */
.footer {
  text-align: center;
  color: var(--text-mute);
  font-size: 12px;
  padding: 24px;
  border-top: 1px solid var(--border);
  background: #fff;
  margin-top: 60px;
}
.footer code { color: var(--text); }

/* ===== Login ===== */
.login-wrap {
  display: flex; align-items: center; justify-content: center;
  min-height: 80vh;
}
.login-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 36px;
  max-width: 380px;
  width: 100%;
  box-shadow: var(--shadow);
}
.login-card h1 {
  font-family: var(--serif);
  font-size: 32px; font-style: italic; font-weight: normal;
  margin: 0 0 6px;
}
.login-card p { color: var(--text-mute); margin: 0 0 24px; font-size: 14px; }

/* ===== Two-col grid ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 880px) { .grid-2 { grid-template-columns: 1fr; } }

/* ===== Audio preview ===== */
audio { vertical-align: middle; }

/* ===== Section heading ===== */
.section-h {
  font-family: var(--serif); font-size: 22px; font-style: italic;
  font-weight: normal; margin: 32px 0 12px;
}
