/*
  VVCM CRM — Premium "vanille" theme
  - Designed for tablet-first readability
  - No external CSS dependency (self-contained)
*/

:root {
  --bg: #fbf8f2;           /* vanille */
  --surface: #ffffff;
  --surface-2: #fffaf0;
  --border: #eadfce;
  --text: #1f1a15;
  --muted: #6f6257;
  --muted-2: #9b8a7c;
  --accent: #c6a66a;       /* gold-beige */
  --accent-2: #a9894f;
  --good: #1f7a3a;
  --warn: #9b6b00;
  --bad: #b42318;
  --shadow: 0 10px 30px rgba(31, 26, 21, 0.08);
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border-right: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
}

.brand img {
  width: 38px;
  height: 38px;
}

.brand-title {
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.brand-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.nav {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px;
  border-radius: 14px;
  color: var(--text);
  border: 1px solid transparent;
}

.nav a:hover {
  background: rgba(198, 166, 106, 0.10);
  border-color: rgba(198, 166, 106, 0.18);
  text-decoration: none;
}

.nav a.active {
  background: rgba(198, 166, 106, 0.16);
  border-color: rgba(198, 166, 106, 0.28);
}

.badge {
  min-width: 26px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(31, 26, 21, 0.08);
  color: var(--text);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.badge.accent {
  background: rgba(198, 166, 106, 0.22);
}

.content {
  padding: 26px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

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

.card.pad { padding: 18px; }

.grid {
  display: grid;
  gap: 14px;
}

.grid.cols-2 { grid-template-columns: 1fr 1fr; }
.grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

.btn:hover { filter: brightness(0.99); }

.btn.primary {
  background: linear-gradient(180deg, rgba(198, 166, 106, 0.28), rgba(198, 166, 106, 0.14));
  border-color: rgba(198, 166, 106, 0.38);
}

.btn.danger {
  background: rgba(180, 35, 24, 0.10);
  border-color: rgba(180, 35, 24, 0.18);
}

.btn.small { padding: 9px 12px; font-weight: 700; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.input, select, textarea {
  width: 100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  outline: none;
}

textarea { min-height: 110px; resize: vertical; }

label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.help {
  font-size: 12px;
  color: var(--muted-2);
  margin-top: 6px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(31, 26, 21, 0.06);
  font-size: 12px;
  font-weight: 700;
}

.pill.good { background: rgba(31, 122, 58, 0.12); }
.pill.warn { background: rgba(155, 107, 0, 0.12); }
.pill.bad { background: rgba(180, 35, 24, 0.12); }

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th, .table td {
  text-align: left;
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.table th {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tabs {
  display: flex;
  gap: 8px;
  padding: 8px;
  border-bottom: 1px solid var(--border);
}

.tab {
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 13px;
  color: var(--muted);
  border: 1px solid transparent;
}

.tab.active {
  background: rgba(198, 166, 106, 0.16);
  border-color: rgba(198, 166, 106, 0.28);
  color: var(--text);
}

.split {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 14px;
}

.notice {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(198, 166, 106, 0.10);
  color: var(--text);
}

.notice.bad {
  background: rgba(180, 35, 24, 0.08);
  border-color: rgba(180, 35, 24, 0.14);
}

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .split { grid-template-columns: 1fr; }
  .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
}
