/* BANNTÉ CRM — iekšējais rīks
   Palete un pirmās lapas dizains pārņemti no bannte CMS (apps/cms/src/app/globals.css + login):
   siltie "stone" neitrālie toņi + šampanieša zelta akcents. */
:root {
  --stone-50: #fbf9f6;
  --stone-100: #f1ede5;
  --stone-200: #eee8df;
  --stone-300: #c9bfb0;
  --stone-400: #9a9088;
  --stone-500: #8a8178;
  --stone-600: #6b6258;
  --stone-700: #4a4138;
  --stone-800: #38322c;
  --stone-900: #2a2724;
  --gold-50: #f5ede0;
  --gold-100: #efe3d0;
  --gold: #c9a87c;
  --gold-600: #b8956a;
  --gold-700: #8a6d43;

  --paper: var(--stone-100);
  --panel: #ffffff;
  --ink: var(--stone-900);
  --ink-soft: var(--stone-500);
  --line: var(--stone-200);
  --accent: var(--gold-600);
  --accent-dark: var(--gold-700);
  --danger: #b91c1c;
  --danger-bg: #fef2f2;
  --radius: 12px;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --login-bg: url("https://d3fgho4q20t2k1.cloudfront.net/img/venues/BE-371-00-1102-liepupes-muiza/Liepupes-Muiza-Renars-Berzins.jpg?w=2000&f=webp");
}

* { box-sizing: border-box; margin: 0; }
body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
a { color: var(--accent-dark); }

/* ------------------------------------------------ login (kā CMS /login) */
.login-screen {
  position: relative;
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 16px;
  background: var(--stone-900) var(--login-bg) center / cover no-repeat;
}
.login-overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.35); }
.login-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 28rem;
  display: flex; flex-direction: column; gap: 28px;
  padding: 40px;
  border-radius: 2.5rem;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  text-align: center;
}
.login-logo { height: 44px; margin: 0 auto; display: block; }
.login-titles { display: flex; flex-direction: column; gap: 4px; }
.login-titles h1 {
  font-size: 30px; font-weight: 900; letter-spacing: -0.05em; line-height: 1.1;
  color: var(--accent);
}
.login-kicker {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3em;
  color: var(--stone-400);
}
.login-desc { font-size: 14px; line-height: 1.6; color: var(--stone-500); }
.login-error {
  color: var(--danger); background: var(--danger-bg);
  padding: 8px 16px; border-radius: 12px; font-size: 14px;
}
.google-signin { display: flex; justify-content: center; min-height: 44px; }
.login-note { font-size: 12px; color: var(--stone-400); }
.login-rule { height: 1px; width: 100%; background: rgba(184, 149, 106, 0.4); }
.login-foot { display: flex; flex-direction: column; gap: 20px; }
.login-site {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--stone-800); text-decoration: none; transition: color .15s;
}
.login-site:hover { color: var(--accent); }
.login-social { display: flex; justify-content: center; gap: 24px; color: var(--stone-400); }
.login-social a { color: inherit; display: inline-flex; transition: color .15s; }
.login-social a:hover { color: var(--accent); }

/* ------------------------------------------------ layout (tumšā sānjosla kā CMS AdminShell) */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px;
  padding: 16px 12px;
  background: var(--stone-900);
  color: var(--stone-300);
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky; top: 0; height: 100vh;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 8px 8px 0; }
.sidebar-logo { width: 100px; filter: brightness(0) invert(1); display: block; }
.sidebar-app {
  font-size: 10px; font-weight: 700; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--stone-500);
}
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.nav-btn {
  text-align: left;
  padding: 8px 10px;
  border: none;
  background: none;
  border-radius: 6px;
  font: inherit; font-size: 14px;
  color: var(--stone-300);
  cursor: pointer;
  transition: background .12s, color .12s;
}
.nav-btn:hover { background: var(--stone-800); color: #fff; }
.nav-btn.active { background: var(--stone-800); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--gold); }
.sidebar-foot {
  margin-top: auto;
  padding: 12px 8px 4px;
  border-top: 1px solid var(--stone-800);
  font-size: 12px;
  color: var(--stone-400);
  display: flex; flex-direction: column; gap: 6px;
  overflow-wrap: anywhere;
}
.link-btn { border: none; background: none; color: var(--gold); cursor: pointer; padding: 0; font: inherit; text-align: left; }
.link-btn:hover { color: #fff; }

.content { flex: 1; min-width: 0; padding: 32px; max-width: 1180px; }
.view-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 18px; flex-wrap: wrap;
}
.view-head h2 { font-weight: 800; font-size: 24px; letter-spacing: -0.03em; color: var(--stone-900); }
.filters { display: flex; gap: 8px; align-items: center; }
select {
  font: inherit; padding: 7px 10px;
  border: 1px solid var(--stone-300); border-radius: 8px; background: var(--panel);
  color: var(--ink);
}
.hint { color: var(--ink-soft); font-size: 13px; margin-bottom: 16px; }
.empty {
  padding: 48px; text-align: center; color: var(--ink-soft);
  border: 1px dashed var(--stone-300); border-radius: var(--radius); background: var(--panel);
}

/* ------------------------------------------------ pogas (zelta akcents kā CMS bg-blue-600) */
.btn {
  font: inherit; font-weight: 600; cursor: pointer;
  padding: 8px 16px; border-radius: 999px; border: 1px solid transparent;
  transition: background .12s, border-color .12s, color .12s;
}
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.ghost { background: var(--panel); border-color: var(--stone-300); color: var(--stone-700); font-weight: 500; }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent-dark); }
.btn.small { padding: 5px 12px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: default; }

/* ------------------------------------------------ IG tabula */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.data-table th {
  text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--stone-400);
  padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--stone-50);
}
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--stone-50); }
.row-actions { display: flex; gap: 6px; }
.tag {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500;
}
.tag-Jauns { background: var(--gold-100); color: var(--gold-700); }
.tag-Apsveikts { background: #e3efe3; color: #2f6b3a; }
.tag-Nekas { background: var(--stone-200); color: var(--stone-500); }

/* ------------------------------------------------ darījumu dēlis */
.board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px; }
.board-col {
  min-width: 230px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px;
}
.board-col h3 {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--stone-600); margin-bottom: 12px;
  display: flex; justify-content: space-between;
}
.count { color: var(--stone-400); font-weight: 500; }
.deal-card {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 12px; margin-bottom: 8px;
  background: var(--stone-50); border: 1px solid var(--line); border-radius: 8px;
  text-decoration: none; color: var(--ink);
  transition: border-color .12s;
}
.deal-card:hover { border-color: var(--accent); }
.deal-title { font-weight: 500; font-size: 13px; }
.deal-value { font-size: 12px; color: var(--ink-soft); }

/* ------------------------------------------------ admin */
.usage-pill {
  padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 500;
  background: var(--gold-100); color: var(--gold-700);
}
.usage-pill.warn { background: var(--danger-bg); color: var(--danger); }
.token-banner {
  margin-bottom: 20px; padding: 12px 16px; border-radius: var(--radius);
  background: var(--danger-bg); color: var(--danger);
  border: 1px solid rgba(185, 28, 28, 0.25); font-size: 14px; line-height: 1.45;
}
.token-banner.soon { background: var(--gold-50); color: var(--gold-700); border-color: rgba(184, 149, 106, 0.45); }
.country-block {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px; margin-bottom: 12px;
}
.country-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap;
}
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px; font-size: 13px; cursor: pointer;
  border: 1px solid var(--stone-300); background: var(--stone-50); color: var(--stone-600);
  transition: background .12s, border-color .12s, color .12s;
}
.chip.on { border-color: var(--accent); background: var(--gold-100); color: var(--gold-700); }
.chip input { accent-color: var(--accent); }
.chip-x {
  border: none; background: none; color: inherit; opacity: 0.55; cursor: pointer;
  font: inherit; font-size: 15px; line-height: 1; padding: 0 0 0 2px; margin-right: -4px;
}
.chip-x:hover { opacity: 1; color: var(--danger); }
.add-tag { display: flex; gap: 8px; margin-top: 12px; }
.add-tag input {
  flex: 1; max-width: 380px; font: inherit; padding: 6px 12px;
  border: 1px solid var(--stone-300); border-radius: 999px; background: var(--panel); color: var(--ink);
}
.add-tag input::placeholder { color: var(--stone-400); }
.admin-actions { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.saved-note { color: var(--gold-700); font-size: 13px; }

input[type="checkbox"] { accent-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ------------------------------------------------ mobils */
@media (max-width: 760px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; padding: 12px 16px; gap: 16px; flex-wrap: wrap; }
  .sidebar-brand { padding: 0; }
  .sidebar nav { flex-direction: row; }
  .sidebar-foot { margin: 0 0 0 auto; padding: 0; border: none; }
  .content { padding: 20px 16px; }
  .data-table { display: block; overflow-x: auto; }
  .login-card { padding: 28px 22px; border-radius: 1.75rem; }
}
