/* johnVen — design ported from Stratamize CRM (Linear-inspired, dark-default).
   Tokens copied from stratamize_crm/src/main/resources/static/css/tokens.css. */

:root {
  --surface-0:#08090a; --surface-1:#0e0f11; --surface-2:#16171a; --surface-3:#1f2024; --surface-4:#2a2c30;
  --text-1:#f7f8f8; --text-2:#b4bcd0; --text-3:#8a93a6; --text-4:#5a6173;
  --accent-400:#8d9aff; --accent-500:#6e79e8; --accent-600:#5e6ad2; --accent-700:#4f57b0;
  --teal-500:#1D9E75; --teal-400:#34d399;
  --success:#22c55e; --warning:#f59e0b; --danger:#ef4444; --info:#3b82f6;
  --border-subtle:rgba(255,255,255,.06); --border-default:rgba(255,255,255,.1); --border-strong:rgba(255,255,255,.18);
  --font-sans:'Inter',system-ui,-apple-system,'Segoe UI',sans-serif;
  --font-mono:'JetBrains Mono','Menlo',monospace;
  --radius-sm:4px; --radius-md:6px; --radius-lg:8px; --radius-xl:12px; --radius-pill:9999px;
  --shadow-sm:0 1px 2px rgba(0,0,0,.4); --shadow-md:0 4px 8px rgba(0,0,0,.5); --shadow-lg:0 8px 24px rgba(0,0,0,.6);
  --sidebar-width:240px; --motion-fast:120ms;
  --ok-bg:rgba(34,197,94,.14); --warn-bg:rgba(245,158,11,.16); --err-bg:rgba(239,68,68,.16);
}
:root[data-theme="light"] {
  --surface-0:#ffffff; --surface-1:#fafafa; --surface-2:#f4f4f5; --surface-3:#e9eaee; --surface-4:#dcdde2;
  --text-1:#0a0a0a; --text-2:#3f3f46; --text-3:#71717a; --text-4:#a1a1aa;
  --border-subtle:rgba(0,0,0,.05); --border-default:rgba(0,0,0,.08); --border-strong:rgba(0,0,0,.14);
  --shadow-sm:0 1px 2px rgba(0,0,0,.06); --shadow-md:0 4px 8px rgba(0,0,0,.08); --shadow-lg:0 8px 24px rgba(0,0,0,.12);
  --ok-bg:rgba(34,197,94,.12); --warn-bg:rgba(245,158,11,.14); --err-bg:rgba(239,68,68,.1);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font-sans); font-size: 13px; line-height: 20px;
  color: var(--text-1); background: var(--surface-0);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-400); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--text-3); }
.small { font-size: 12px; }

/* ── App shell ── */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-width); flex-shrink: 0; background: var(--surface-1);
  border-right: 1px solid var(--border-subtle); padding: 16px 12px;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--teal-500), var(--teal-400));
  color: #04140e; font-weight: 800; display: grid; place-items: center; font-size: 16px;
}
.brand-mark.lg { width: 48px; height: 48px; font-size: 24px; margin: 0 auto 6px; }
.brand-name { font-weight: 700; font-size: 14px; letter-spacing: .01em; }
.brand-sub { font-size: 11px; color: var(--text-3); }

.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.nav-section {
  font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-4);
  font-weight: 600; padding: 14px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: var(--radius-md); color: var(--text-2);
  font-size: 13px; font-weight: 500; cursor: pointer; transition: background var(--motion-fast), color var(--motion-fast);
}
.nav-item .icon { width: 16px; height: 16px; flex-shrink: 0; opacity: .85; }
.nav-item .soon { margin-left: auto; }
.icon { display: inline-block; vertical-align: -2px; }
.nav-item:hover { background: var(--surface-2); color: var(--text-1); text-decoration: none; }
.nav-item.active {
  background: color-mix(in srgb, var(--accent-600) 22%, transparent);
  color: var(--text-1); box-shadow: inset 2px 0 0 var(--accent-500);
}
.nav-item.disabled { color: var(--text-4); cursor: default; }
.nav-item.disabled:hover { background: transparent; color: var(--text-4); }
.soon {
  font-size: 9px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-4);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-pill); padding: 1px 6px;
}

.user-box { border-top: 1px solid var(--border-subtle); padding-top: 12px; margin-top: 8px; }
.user-name { font-size: 13px; font-weight: 600; }
.user-email { font-size: 11px; color: var(--text-3); margin-bottom: 8px; }
.user-actions { display: flex; gap: 14px; align-items: center; }
.user-actions a, .user-actions button {
  background: none; border: 0; color: var(--text-3); font-size: 12px; cursor: pointer; padding: 0; font-family: inherit;
}
.user-actions a:hover, .user-actions button:hover { color: var(--text-1); text-decoration: none; }

/* ── Content ── */
.content { flex: 1; padding: 24px 32px; max-width: 1200px; }
.page-head { margin-bottom: 18px; }
h1 { font-size: 22px; line-height: 28px; font-weight: 700; margin: 0; }
h2 { font-size: 16px; line-height: 22px; font-weight: 600; margin: 0 0 14px; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin: 16px 0 8px; }

.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.card { background: var(--surface-1); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow-sm); }
.card-num { font-size: 28px; font-weight: 700; line-height: 1; }
.card-lbl { font-size: 12px; color: var(--text-3); margin-top: 6px; }

.panel { background: var(--surface-1); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 18px; margin-bottom: 18px; box-shadow: var(--shadow-sm); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border-subtle); }
th { color: var(--text-3); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
tbody tr:hover { background: var(--surface-2); }
td.r, th.r { text-align: right; }
.row-warn td:first-child { box-shadow: inset 2px 0 0 var(--warning); }

.badge { display: inline-block; padding: 2px 9px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 600; border: 1px solid var(--border-subtle); }
.badge::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 6px; vertical-align: middle; background: currentColor; }
.badge-disponible { color: var(--success); background: var(--ok-bg); }
.badge-encorte { color: var(--info); background: rgba(59,130,246,.14); }
.badge-agotado { color: var(--danger); background: var(--err-bg); }

/* ── Forms ── */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 16px; align-items: end; }
.form-grid .wide { grid-column: 1 / -1; }
label { display: flex; flex-direction: column; font-size: 12px; gap: 5px; color: var(--text-2); }
input, select, textarea {
  padding: 8px 10px; border: 1px solid var(--border-default); border-radius: var(--radius-md);
  font-size: 13px; font-family: inherit; background: var(--surface-2); color: var(--text-1);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--border-focus, var(--accent-600)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-600) 30%, transparent); }
button, .btn {
  background: var(--accent-600); color: #fff; border: 0; border-radius: var(--radius-md);
  padding: 9px 16px; font-size: 13px; font-weight: 500; cursor: pointer; font-family: inherit;
  transition: background var(--motion-fast);
}
button:hover, .btn:hover { background: var(--accent-700); text-decoration: none; }
button.small { padding: 6px 10px; font-size: 12px; }
.btn-block { display: block; width: 100%; text-align: center; }
.inline { display: inline-flex; gap: 6px; margin: 0; }

.size-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-bottom: 14px; }
.size { background: var(--surface-2); border-radius: var(--radius-md); padding: 6px; align-items: center; }
.size span { font-weight: 600; font-size: 12px; color: var(--text-3); }
.size input { width: 100%; text-align: center; }
.checks { border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 8px 12px; }
.checks legend { color: var(--text-3); font-size: 12px; }
.checks .chk { flex-direction: row; align-items: center; gap: 6px; display: inline-flex; margin-right: 14px; }

/* ── Flash ── */
.flash { padding: 10px 14px; border-radius: var(--radius-md); margin-bottom: 16px; font-size: 13px; border: 1px solid var(--border-subtle); }
.flash-ok { background: var(--ok-bg); color: var(--success); }
.flash-err { background: var(--err-bg); color: var(--danger); }
.flash-warn { background: var(--warn-bg); color: var(--warning); }

/* ── Login / standalone ── */
.login-body { display: grid; place-items: center; min-height: 100vh; }
.login-card { background: var(--surface-1); border: 1px solid var(--border-subtle); border-radius: var(--radius-xl); padding: 36px 32px; width: 360px; text-align: center; box-shadow: var(--shadow-lg); }
.login-card h1 { font-size: 24px; margin: 4px 0; }
.login-form { display: flex; flex-direction: column; gap: 10px; text-align: left; margin-top: 16px; }
