/* ============================================================
   Kiusha — Dashboard
   Paleta: cream, charcoal, rose-gold accent
   Tipografía: Playfair Display (serif) + Inter (sans)
   ============================================================ */

:root {
  --bg:         #f7f3ec;
  --surface:    #ffffff;
  --surface-2:  #fbf8f3;
  --ink:        #1a1815;
  --ink-soft:   #5b554d;
  --muted:      #9a948b;
  --line:       #e7e0d3;
  --accent:     #b08968;   /* rose-gold / mocha */
  --accent-2:   #8b6a4a;
  --accent-soft:#f0e6d8;
  --danger:     #b54848;
  --success:    #5a7d4e;
  --shadow:     0 1px 2px rgba(26,24,21,.04), 0 8px 24px rgba(26,24,21,.06);
  --radius:     14px;
}

* { box-sizing: border-box; }

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

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

h1, h2, h3, h4, .serif {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 .5em;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

/* ---------- Layout ---------- */

.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--ink);
  color: #e9e3d7;
  padding: 32px 22px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: .02em;
  color: #f5ecdc;
  margin-bottom: 4px;
}
.brand .dot { color: var(--accent); }

.brand-sub {
  font-size: 10px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: #a59a85;
  margin-bottom: 40px;
}

.nav-section {
  font-size: 10px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: #7a7060;
  margin: 24px 0 10px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #d8cfba;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 2px;
  transition: all .15s ease;
}
.nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav a.active {
  background: var(--accent);
  color: #fff;
}
.nav a .ico {
  width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px;
}

.sidebar-foot {
  position: absolute;
  bottom: 22px;
  left: 22px;
  right: 22px;
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 16px;
  font-size: 12px;
  color: #9a907b;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sidebar-foot a { color: #d8cfba; }
.sidebar-foot a:hover { color: var(--accent); }

.main {
  padding: 38px 48px 60px;
  max-width: 1280px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 32px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.page-head h1 { font-size: 34px; margin: 4px 0 0; }
.page-head .eyebrow { display: block; }

/* ---------- Cards / KPIs ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 32px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 20px;
  position: relative;
  overflow: hidden;
}
.kpi .label {
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.kpi .value {
  font-family: 'Playfair Display', serif;
  font-size: 42px;
  line-height: 1;
  color: var(--ink);
}
.kpi .foot {
  margin-top: 12px;
  font-size: 12px;
  color: var(--ink-soft);
}
.kpi.accent { background: var(--accent-soft); border-color: #e6d6bc; }
.kpi.danger .value { color: var(--danger); }

/* ---------- Tables ---------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.panel-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.panel-head h3 { margin: 0; font-size: 18px; }
.panel-head .hint { font-size: 12px; color: var(--muted); }

table.kiusha {
  width: 100%;
  border-collapse: collapse;
}
table.kiusha th {
  text-align: left;
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  padding: 12px 22px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
table.kiusha td {
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink);
  vertical-align: middle;
}
table.kiusha tr:last-child td { border-bottom: 0; }
table.kiusha tr:hover td { background: var(--surface-2); }
table.kiusha .empty {
  text-align: center;
  color: var(--muted);
  padding: 40px;
  font-style: italic;
}

/* ---------- Badges / Pills ---------- */

.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: .04em;
  font-weight: 500;
  border: 1px solid transparent;
}
.pill-ink     { background: #efeae0; color: var(--ink); }
.pill-usuario { background: #ece4d4; color: var(--accent-2); }
.pill-bot     { background: #e7e3da; color: var(--ink-soft); }
.pill-success { background: #e6efe2; color: var(--success); }
.pill-danger  { background: #f5e0e0; color: var(--danger); }
.pill-warn    { background: #f7ead0; color: #a06b1a; }

/* Confianza */
.pill-conf { font-variant-numeric: tabular-nums; }
.pill-conf.alta  { background: #e6efe2; color: var(--success); }
.pill-conf.media { background: #f7ead0; color: #a06b1a; }
.pill-conf.baja  { background: #f5e0e0; color: var(--danger); }

/* ---------- Forms / Buttons ---------- */

.form-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 14px;
  align-items: end;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 26px;
  box-shadow: var(--shadow);
}
.field label {
  display: block;
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.field input,
.field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  transition: border .15s;
}
.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}
.btn-primary  { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--accent-2); color: #fff; }
.btn-accent   { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-2); }
.btn-ghost    { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-success  { background: var(--success); color: #fff; }
.btn-sm       { padding: 6px 12px; font-size: 11px; }

.btn-group { display: inline-flex; gap: 8px; margin-bottom: 22px; }
.btn-group .btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- Alerts ---------- */

.alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 20px;
  border: 1px solid;
}
.alert-success { background: #ecf3e7; border-color: #cfdfbe; color: var(--success); }
.alert-danger  { background: #f7e6e6; border-color: #ecc7c7; color: var(--danger); }

/* ---------- Two column ---------- */

.row-2 {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
}

.muted { color: var(--muted); }
.small { font-size: 12px; }
.text-end { text-align: right; }
.nowrap { white-space: nowrap; }

/* ---------- Login ---------- */

.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg);
}
.login-side {
  background: linear-gradient(135deg, #1a1815 0%, #2a241d 60%, #4a3a2a 100%);
  color: #f5ecdc;
  padding: 60px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.login-side::after {
  content: '';
  position: absolute;
  inset: auto -120px -120px auto;
  width: 360px; height: 360px;
  background: radial-gradient(circle, rgba(176,137,104,.4), transparent 70%);
  border-radius: 50%;
}
.login-side .brand-xl {
  font-family: 'Playfair Display', serif;
  font-size: 64px;
  line-height: 1;
  letter-spacing: .01em;
}
.login-side .brand-xl .dot { color: var(--accent); }
.login-side .tagline {
  font-size: 14px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: #a59a85;
  margin-top: 18px;
}
.login-side .quote {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 22px;
  line-height: 1.5;
  color: #efe4cf;
  max-width: 420px;
  position: relative;
  z-index: 1;
}
.login-side .quote::before {
  content: '"';
  display: block;
  font-size: 80px;
  line-height: 0.5;
  color: var(--accent);
  margin-bottom: 16px;
}
.login-side footer {
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #7a7060;
}

.login-form-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.login-form {
  width: 100%;
  max-width: 380px;
}
.login-form h2 {
  font-size: 32px;
  margin-bottom: 6px;
}
.login-form .sub {
  color: var(--ink-soft);
  margin-bottom: 32px;
  font-size: 13px;
}

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .sidebar-foot { position: relative; left: 0; right: 0; bottom: 0; margin-top: 20px; }
  .main { padding: 24px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .row-2 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-side { padding: 40px 32px; }
}
