/* AgentHub design system - shared by the popup and the dashboard.
   Light is the default; theme.js sets data-theme="dark" on <html>.
   Every colour in the extension comes from a variable below, so a page
   never needs a dark-mode override of its own. */

:root,
:root[data-theme="light"] {
  color-scheme: light;

  --primary: #0f8fa6;          /* fills: primary buttons, active toggles */
  --primary-hover: #0b7a8f;
  --primary-ink: #0b6f82;      /* text/icons that sit on a light surface */
  --primary-tint: #ddf1f5;     /* active nav item, icon tiles, chips */
  --primary-soft: #eaf6f9;
  --on-primary: #ffffff;

  --bg: #edf5f9;
  --sidebar: #fbfdfe;
  --card: #ffffff;
  --card-2: #f4f9fb;           /* read-only fields, nested panels */
  --line: #e1ecf1;
  --line-strong: #cfdfe7;

  --ink: #0e2a3b;
  --ink-soft: #5b7384;
  --ink-faint: #93a7b4;

  --blue: #2f7de1;   --blue-tint: #e4eefc;
  --green: #178a5d;  --green-tint: #e1f5ec;
  --amber: #b36200;  --amber-tint: #fdf0dc;
  --red: #cc3d3d;    --red-tint: #fce9e9;
  --purple: #6f55d6; --purple-tint: #ece7fb;
  --teal: #0f8fa6;   --teal-tint: #ddf1f5;
  --indigo: #3d57c9; --indigo-tint: #e5eafb;
  --orange: #d9721a; --orange-tint: #fdebd7;

  --shadow: 0 1px 2px rgba(14, 42, 59, 0.04), 0 8px 24px rgba(14, 42, 59, 0.06);
  --shadow-pop: 0 14px 34px rgba(14, 42, 59, 0.18);
  --overlay: rgba(10, 28, 40, 0.5);
  --deco: rgba(96, 196, 222, 0.14);
  --focus-ring: rgba(15, 143, 166, 0.28);
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --primary: #2bb6cf;
  --primary-hover: #4cc7dd;
  --primary-ink: #62d3e6;
  --primary-tint: rgba(43, 182, 207, 0.16);
  --primary-soft: rgba(43, 182, 207, 0.09);
  --on-primary: #032630;

  --bg: #0b1820;
  --sidebar: #0f1f29;
  --card: #13252f;
  --card-2: #183039;
  --line: #22404d;
  --line-strong: #2c5060;

  --ink: #e7f2f7;
  --ink-soft: #9db4c1;
  --ink-faint: #6d8795;

  --blue: #6aa5f5;   --blue-tint: rgba(106, 165, 245, 0.16);
  --green: #4ccb94;  --green-tint: rgba(76, 203, 148, 0.15);
  --amber: #f0b25a;  --amber-tint: rgba(240, 178, 90, 0.15);
  --red: #f17777;    --red-tint: rgba(241, 119, 119, 0.15);
  --purple: #a594f3; --purple-tint: rgba(165, 148, 243, 0.16);
  --teal: #2bb6cf;   --teal-tint: rgba(43, 182, 207, 0.16);
  --indigo: #8ea2f5; --indigo-tint: rgba(142, 162, 245, 0.16);
  --orange: #f2a15a; --orange-tint: rgba(242, 161, 90, 0.16);

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.28);
  --shadow-pop: 0 14px 34px rgba(0, 0, 0, 0.55);
  --overlay: rgba(2, 8, 12, 0.66);
  --deco: rgba(43, 182, 207, 0.06);
  --focus-ring: rgba(43, 182, 207, 0.32);
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  font-family: "Noto Sans Georgian", "BPG Nino Mtavruli", "Segoe UI", system-ui, -apple-system, Roboto, Sylfaen, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-ink); }

/* ---------- buttons ---------- */

button {
  cursor: pointer;
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease, transform 0.05s ease;
}
button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary-ink); }
button:active:not(:disabled) { transform: scale(0.985); }
button:disabled { opacity: 0.5; cursor: default; }
button:focus-visible,
input:focus-visible,
select:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }

button.primary,
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 6px 16px -6px var(--primary);
}
button.primary:hover:not(:disabled),
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--on-primary); }

button.danger { color: var(--red); }
button.danger:hover:not(:disabled) { border-color: var(--red); color: var(--red); }
button.small { padding: 6px 12px; font-size: 12px; border-radius: 9px; }

.btn-outline-blue {
  background: transparent;
  color: var(--primary-ink);
  border: 1px solid var(--line-strong);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.btn-outline-blue svg { width: 14px; height: 14px; flex-shrink: 0; }
.btn-outline-blue:hover:not(:disabled) { background: var(--primary-tint); border-color: var(--primary); }

.btn-tint-red {
  background: var(--red-tint);
  color: var(--red);
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.btn-tint-red svg { width: 14px; height: 14px; flex-shrink: 0; }
.btn-tint-red:hover:not(:disabled) { border-color: var(--red); color: var(--red); }

/* ---------- form controls ---------- */

input[type="text"],
input[type="search"],
input[type="tel"],
input[type="email"],
select,
textarea {
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  background: var(--card);
  color: var(--ink);
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
input::placeholder { color: var(--ink-faint); }
input[type="text"]:focus,
input[type="tel"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus-ring); }
input:disabled, select:disabled { background: var(--card-2); color: var(--ink-soft); cursor: not-allowed; }

/* a chevron drawn from two gradients so it follows the theme colour */
select {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%),
    linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
  cursor: pointer;
}

input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; flex-shrink: 0; }

/* ---------- surfaces & text ---------- */

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

.msg { font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; }
.msg.error { color: var(--red); }
.msg.success { color: var(--green); }

.empty {
  font-size: 13px;
  color: var(--ink-soft);
  text-align: center;
  line-height: 1.6;
  padding: 30px 16px;
  background: var(--card);
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
}

/* ---------- badges ---------- */

.role-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  text-transform: capitalize;
  white-space: nowrap;
}
.role-badge.owner { background: var(--primary-tint); color: var(--primary-ink); }
.role-badge.agent { background: var(--green-tint); color: var(--green); }
.role-badge.site-ssge, .role-badge.site-myhome { text-transform: none; } /* "ss.ge", not "Ss.Ge" */
.role-badge.site-ssge { background: var(--amber-tint); color: var(--amber); }
.role-badge.site-myhome { background: var(--teal-tint); color: var(--primary-ink); }
