/* ── Design Tokens ─────────────────────────────────────────────────── */
:root {
  --sidebar-w:  256px;
  --topbar-h:   54px;
  --radius:     7px;
  --radius-lg:  12px;
  --font:       'DM Sans', system-ui, sans-serif;
  --font-mono:  'DM Mono', monospace;
}

/* ── Dark Mode (default) ──────────────────────────────────────────── */
:root, [data-theme="dark"] {
  --bg:         #0a0b0d;
  --bg-2:       #111318;
  --bg-3:       #1a1d24;
  --bg-4:       #22262f;
  --border:     #2a2e38;
  --border-2:   #363b48;

  --text-1:     #eef0f4;
  --text-2:     #b4bccf;
  --text-3:     #8694ab;

  --accent:     #4f8ef7;
  --accent-2:   #2563eb;
  --accent-dim: rgba(79,142,247,.14);

  --green:      #34d399;
  --amber:      #fbbf24;
  --red:        #f87171;
  --red-dim:    rgba(248,113,113,.13);

  --shadow:     0 1px 4px rgba(0,0,0,.5);
  --shadow-lg:  0 6px 24px rgba(0,0,0,.6);
}

/* ── Light Mode ───────────────────────────────────────────────────── */
[data-theme="light"] {
  --bg:         #f5f6f8;
  --bg-2:       #ffffff;
  --bg-3:       #ffffff;
  --bg-4:       #eef0f3;
  --border:     #d8dce4;
  --border-2:   #c5cad4;

  --text-1:     #1a1d24;
  --text-2:     #4b5468;
  --text-3:     #7a8494;

  --accent:     #2563eb;
  --accent-2:   #1d4ed8;
  --accent-dim: rgba(37,99,235,.08);

  --green:      #059669;
  --amber:      #d97706;
  --red:        #dc2626;
  --red-dim:    rgba(220,38,38,.06);

  --shadow:     0 1px 3px rgba(0,0,0,.08);
  --shadow-lg:  0 4px 16px rgba(0,0,0,.1);
}

/* ── Reset ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font); background: var(--bg); color: var(--text-1); line-height: 1.6; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ── App Layout ─────────────────────────────────────────────────────── */
.app-layout { display: flex; min-height: 100vh; }

/* ── Sidebar ─────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform .2s ease;
}

.sidebar__header {
  padding: 0 1rem;
  height: var(--topbar-h);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-shrink: 0;
}

/* DETEC AG Logo */
.sidebar__logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
}

.sidebar__logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #4f8ef7 0%, #2563eb 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(79,142,247,.35);
}

.sidebar__logo-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
}

.sidebar__logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.sidebar__logo-name {
  font-size: .88rem;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: .02em;
}

.sidebar__logo-sub {
  font-size: .65rem;
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.sidebar__tenant-badge {
  margin-left: auto;
  font-size: .68rem;
  font-weight: 600;
  background: var(--accent-dim);
  color: var(--accent);
  padding: .2rem .55rem;
  border-radius: 5px;
  border: 1px solid rgba(79,142,247,.3);
  letter-spacing: .03em;
  white-space: nowrap;
}

.sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: .6rem 0;
}

.sidebar__nav::-webkit-scrollbar { width: 3px; }
.sidebar__nav::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 2px; }

.sidebar__list { padding: 0 .6rem; }
.sidebar__section-label {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: .8rem 1rem .3rem;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .48rem .85rem;
  border-radius: var(--radius);
  color: var(--text-2);
  font-size: .875rem;
  transition: background .12s, color .12s;
}

.sidebar__link:hover { background: var(--bg-3); color: var(--text-1); }

.sidebar__item--active > .sidebar__link {
  background: var(--accent-dim);
  color: var(--accent);
}

.sidebar__icon { width: 15px; height: 15px; flex-shrink: 0; opacity: .75; }
.sidebar__item--active > .sidebar__link .sidebar__icon { opacity: 1; }
.sidebar__icon-char { font-size: .9rem; line-height: 1; width: 15px; text-align: center; }

.sidebar__chevron {
  width: 13px; height: 13px;
  margin-left: auto; opacity: .4;
  transition: transform .2s;
}

.sidebar__sub { padding: .15rem 0 .25rem 2.2rem; }
.sidebar__sub--deep { padding-left: 1rem; }

.sidebar__sub-link {
  display: block;
  padding: .28rem .5rem;
  font-size: .82rem;
  color: var(--text-3);
  border-radius: 5px;
  transition: color .12s, background .12s;
}

.sidebar__sub-link:hover,
.sidebar__sub-item--active .sidebar__sub-link { color: var(--text-1); background: var(--bg-3); }

.sidebar__footer {
  padding: .6rem .6rem .8rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: .05rem;
}

.sidebar__footer-link {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .38rem .85rem;
  border-radius: var(--radius);
  color: var(--text-3);
  font-size: .8rem;
  transition: color .12s, background .12s;
}

.sidebar__footer-link:hover { color: var(--text-1); background: var(--bg-3); }
.sidebar__footer-link--danger:hover { color: var(--red); background: var(--red-dim); }

/* ── Main Content ─────────────────────────────────────────────────────── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--topbar-h);
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar__menu-btn {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  padding: .3rem;
}

.topbar__menu-btn span { display: block; width: 18px; height: 2px; background: var(--text-2); border-radius: 1px; }

.topbar__breadcrumb {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .82rem;
  color: var(--text-3);
  flex: 1;
}

.breadcrumb__item--current { color: var(--text-1); font-weight: 500; }
.breadcrumb__sep { opacity: .35; }
.breadcrumb__item--link { color: var(--text-3); transition: color .12s; }
.breadcrumb__item--link:hover { color: var(--text-1); }

.topbar__search { position: relative; }
.topbar__search-form { position: relative; display: flex; align-items: center; }
.topbar__search-icon { position: absolute; left: .6rem; width: 14px; height: 14px; color: var(--text-3); pointer-events: none; }
.topbar__search-input {
  background: var(--bg-3); border: 1px solid var(--border); color: var(--text-1);
  border-radius: 6px; padding: .35rem .6rem .35rem 2rem; font-size: .8rem;
  font-family: var(--font); width: 220px; transition: width .2s, border-color .15s;
}
.topbar__search-input:focus { outline: none; border-color: var(--accent); width: 300px; }
.topbar__search-input::placeholder { color: var(--text-3); }
.topbar__search-dropdown {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  min-width: 300px; background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 200;
  max-height: 400px; overflow-y: auto;
}
.topbar__search-dropdown.is-open { display: block; }
.topbar__search-item {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem .75rem; color: var(--text-1); text-decoration: none;
  font-size: .82rem; transition: background .1s; cursor: pointer;
}
.topbar__search-item:hover { background: var(--bg-4); }
.topbar__search-item__icon { width: 14px; height: 14px; color: var(--text-3); flex-shrink: 0; }
.topbar__search-item__icon svg { width: 100%; height: 100%; }
.topbar__search-item__label { flex: 1; }
.topbar__search-item__type { font-size: .7rem; color: var(--text-3); }
.topbar__search-empty { padding: .6rem .75rem; color: var(--text-3); font-size: .8rem; }

.topbar__actions { display: flex; align-items: center; gap: .5rem; }

.content-area { padding: 1.75rem; flex: 1; }

/* ── Auth Pages ──────────────────────────────────────────────────────── */
.auth-page { background: var(--bg); }

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

.auth-panel {
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  padding: 3rem 2.5rem;
  display: flex;
  flex-direction: column;
}

.auth-panel--wide { max-width: 520px; }

/* Auth Logo – DETEC AG */
.auth-logo {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 2.5rem;
}

.auth-logo__icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #4f8ef7 0%, #2563eb 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 12px rgba(79,142,247,.4);
}

.auth-logo__icon svg {
  width: 22px; height: 22px;
  fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round;
}

.auth-logo__text { display: flex; flex-direction: column; line-height: 1.1; }

.auth-logo__name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: .02em;
}

.auth-logo__sub {
  font-size: .68rem;
  color: var(--text-3);
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 500;
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -.02em;
  margin-bottom: 1.75rem;
  color: var(--text-1);
}

.auth-form { display: flex; flex-direction: column; gap: 1rem; }

.auth-visual {
  background: var(--bg-3);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 2rem;
}

.auth-visual__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: .35;
}

.auth-visual__label {
  position: relative;
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* ── Tenant Picker ────────────────────────────────────────────────────── */
.picker-page { background: var(--bg); }

.picker-layout { min-height: 100vh; display: flex; flex-direction: column; }

.picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: var(--topbar-h);
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
}

.picker-header__logo { display: flex; align-items: center; gap: .75rem; }
.picker-header__actions { display: flex; gap: .5rem; }

.picker-body { max-width: 640px; margin: 4rem auto; padding: 0 1.5rem; width: 100%; }

.picker-title { font-size: 1.5rem; font-weight: 600; letter-spacing: -.02em; margin-bottom: .4rem; }
.picker-subtitle { color: var(--text-2); font-size: .875rem; margin-bottom: 2rem; }

.tenant-grid { display: flex; flex-direction: column; gap: .5rem; }

.tenant-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  transition: border-color .15s, background .15s, transform .1s;
}

.tenant-card:hover {
  border-color: var(--accent);
  background: var(--bg-3);
  transform: translateX(2px);
}

.tenant-card__icon {
  width: 42px; height: 42px;
  background: var(--accent-dim);
  border: 1px solid rgba(79,142,247,.3);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--accent);
  flex-shrink: 0;
}

.tenant-card__body { flex: 1; }
.tenant-card__name { display: block; font-weight: 600; font-size: .95rem; color: var(--text-1); }
.tenant-card__slug { display: block; font-size: .76rem; color: var(--text-3); font-family: var(--font-mono); margin-top: .1rem; }
.tenant-card__arrow { width: 18px; height: 18px; color: var(--text-3); transition: color .15s; }
.tenant-card:hover .tenant-card__arrow { color: var(--accent); }

.picker-empty {
  text-align: center;
  padding: 3rem;
  color: var(--text-2);
  background: var(--bg-2);
  border: 1px dashed var(--border-2);
  border-radius: var(--radius-lg);
}

/* ── Form Fields ──────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: .3rem; }

.field__label {
  font-size: .78rem;
  font-weight: 500;
  color: var(--text-2);
  letter-spacing: .01em;
}

.field__required { color: var(--accent); margin-left: .2rem; }

.field__input {
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: .55rem .85rem;
  color: var(--text-1);
  font-size: .9rem;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}

.field__input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79,142,247,.15);
}

.field--error .field__input { border-color: var(--red); }
.field__error { font-size: .76rem; color: var(--red); }
.field__textarea { resize: vertical; min-height: 90px; }
.field__color { height: 38px; padding: .15rem .25rem; cursor: pointer; }
.field__input--sm { padding: .32rem .65rem; font-size: .82rem; }
.field-hint { font-size: .74rem; color: var(--text-3); line-height: 1.5; }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 500;
  padding: .5rem 1rem;
  transition: background .12s, border-color .12s, color .12s, transform .1s;
  cursor: pointer;
  white-space: nowrap;
}

.btn:active { transform: scale(.98); }

.btn--primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn--primary:hover { background: var(--accent-2); border-color: var(--accent-2); }

.btn--ghost {
  background: transparent;
  color: var(--text-2);
  border-color: var(--border-2);
}
.btn--ghost:hover { background: var(--bg-3); color: var(--text-1); border-color: var(--border-2); }

.btn--danger { background: var(--red-dim); color: var(--red); border-color: rgba(248,113,113,.4); }
.btn--danger:hover { background: var(--red); color: #fff; border-color: var(--red); }

.btn--sm { font-size: .78rem; padding: .3rem .7rem; }
.btn--lg { font-size: 1rem; padding: .65rem 1.4rem; }
.btn--full { width: 100%; }

/* ── Badges ────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: .18rem .6rem;
  border-radius: 5px;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .03em;
}

.badge--admin    { background: rgba(248,113,113,.15); color: #fca5a5; border: 1px solid rgba(248,113,113,.3); }
.badge--teamadmin { background: rgba(251,191,36,.15); color: #fde68a; border: 1px solid rgba(251,191,36,.3); }
.badge--user     { background: var(--bg-4); color: var(--text-2); border: 1px solid var(--border); }
.badge--default  { background: var(--bg-4); color: var(--text-2); border: 1px solid var(--border); }
.badge--success  { background: rgba(52,211,153,.15); color: #6ee7b7; border: 1px solid rgba(52,211,153,.3); }
.badge--muted    { background: var(--bg-3); color: var(--text-3); border: 1px solid var(--border); }

/* ── Flash Messages ───────────────────────────────────────────────────── */
.flash-stack { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1.25rem; }

.flash {
  padding: .65rem 1rem;
  border-radius: var(--radius);
  font-size: .85rem;
  border-left: 3px solid;
}

.flash--success { background: rgba(52,211,153,.1);  border-color: var(--green);  color: #a7f3d0; }
.flash--danger  { background: var(--red-dim);        border-color: var(--red);    color: #fecaca; }
.flash--info    { background: var(--accent-dim);     border-color: var(--accent); color: #bfdbfe; }
.flash--warning { background: rgba(251,191,36,.1);   border-color: var(--amber);  color: #fef3c7; }

/* ── Dashboard Home ───────────────────────────────────────────────────── */
.section-title { font-size: 1.25rem; font-weight: 600; letter-spacing: -.02em; margin-bottom: .3rem; }
.section-subtitle { color: var(--text-2); font-size: .875rem; margin-bottom: 1.75rem; }

.page-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 1rem; }

.page-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .45rem;
  transition: border-color .15s, background .15s;
}

.page-card:hover { border-color: var(--accent); background: var(--bg-3); }
.page-card__icon { font-size: 1.5rem; line-height: 1; }
.page-card__label { font-weight: 600; font-size: .9rem; color: var(--text-1); }
.page-card__count { font-size: .74rem; color: var(--text-3); }

/* ── Empty State ──────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--bg-2);
  border: 1px dashed var(--border-2);
  border-radius: var(--radius-lg);
  max-width: 420px;
}

.empty-state__icon { font-size: 2rem; margin-bottom: 1rem; }
.empty-state__title { font-weight: 600; margin-bottom: .5rem; font-size: 1rem; }
.empty-state__text { color: var(--text-2); font-size: .875rem; margin-bottom: 1.5rem; }

/* ── Account ──────────────────────────────────────────────────────────── */
.account-info { display: flex; flex-direction: column; gap: .65rem; margin-bottom: 1.5rem; }

.account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .55rem 0;
  border-bottom: 1px solid var(--border);
}

.account-row__label { font-size: .82rem; color: var(--text-2); }
.account-row__value { font-size: .88rem; font-family: var(--font-mono); }

.divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* ── Admin Styles ─────────────────────────────────────────────────────── */
.admin-badge {
  background: rgba(248,113,113,.15) !important;
  color: #fca5a5 !important;
  border-color: rgba(248,113,113,.35) !important;
}

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 1rem; margin-bottom: 2rem; }

.stat-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}

.stat-card--link { transition: border-color .15s, background .15s; }
.stat-card--link:hover { border-color: var(--accent); background: var(--bg-3); }

.stat-card__value { font-size: 1.9rem; font-weight: 700; letter-spacing: -.04em; color: var(--text-1); }
.stat-card__label { font-size: .78rem; color: var(--text-2); }
.stat-card__link  { font-size: .76rem; color: var(--accent); margin-top: .35rem; }

.section-block {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.section-block__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-block__title { font-size: 1rem; font-weight: 600; }

/* Tables */
.table-wrapper {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

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

.data-table th {
  text-align: left;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: .7rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-3);
}

.data-table td {
  padding: .75rem 1rem;
  font-size: .875rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text-1);
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,.02); }

.actions-cell { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.table-empty { text-align: center; color: var(--text-3); padding: 2.5rem !important; }
.fw-medium { font-weight: 500; }
.text-muted { color: var(--text-2); }
.text-sm { font-size: .8rem; }
.text-mono { font-family: var(--font-mono); }

/* Code */
.code-pill {
  font-family: var(--font-mono);
  font-size: .74rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: .1rem .45rem;
  color: var(--text-2);
}

.code-block-sm {
  font-family: var(--font-mono);
  font-size: .71rem;
  color: var(--text-2);
  max-width: 220px;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Modals */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(2px);
}

.modal-backdrop.is-open { display: flex; }

.modal {
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 490px;
  box-shadow: var(--shadow-lg);
  animation: modal-in .15s ease;
}

.modal--lg { max-width: 660px; }

@keyframes modal-in {
  from { opacity: 0; transform: scale(.96) translateY(-8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.modal__title { font-weight: 600; font-size: .95rem; }
.modal__close {
  background: none; border: none;
  color: var(--text-3); font-size: 1rem;
  padding: .2rem .4rem; border-radius: 4px;
  transition: color .12s, background .12s;
}
.modal__close:hover { color: var(--text-1); background: var(--bg-3); }

.modal__body { padding: 1.25rem; display: flex; flex-direction: column; gap: .85rem; }

.modal__actions {
  display: flex; gap: .5rem; justify-content: flex-end;
  margin-top: .5rem;
  padding-top: .85rem;
  border-top: 1px solid var(--border);
}

.select-inline {
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: .28rem .6rem;
  color: var(--text-1);
  font-size: .82rem;
  font-family: var(--font);
}

/* Member chips */
.member-chips { display: flex; flex-wrap: wrap; gap: .4rem; }

.member-chip {
  display: flex;
  align-items: center;
  gap: .3rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: .2rem .6rem .2rem .75rem;
  font-size: .8rem;
}

.member-chip__remove {
  background: none; border: none; color: var(--text-3);
  font-size: .8rem; cursor: pointer; padding: 0 .1rem;
  transition: color .12s;
}
.member-chip__remove:hover { color: var(--red); }

/* Perm tags */
.perm-tag {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  background: var(--accent-dim);
  border: 1px solid rgba(79,142,247,.3);
  border-radius: 4px;
  padding: .12rem .5rem;
  font-size: .72rem;
  color: var(--accent);
}

.perm-tag__remove {
  background: none; border: none; color: var(--accent);
  font-size: .7rem; cursor: pointer; opacity: .7;
  transition: opacity .12s;
}
.perm-tag__remove:hover { opacity: 1; }

/* Page tree */
.page-tree { display: flex; flex-direction: column; gap: .5rem; }

.page-tree-item {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.page-tree-item.depth-1 { margin-left: 1.75rem; border-color: var(--border-2); }
.page-tree-item.depth-2 { margin-left: 3.5rem; background: var(--bg-3); }

.page-tree-item__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .7rem 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-tree-item__info { display: flex; align-items: center; gap: .6rem; flex: 1; }
.page-tree-item__icon { font-size: 1rem; }
.page-tree-item__label { font-weight: 500; font-size: .9rem; }
.page-tree-item__actions { display: flex; gap: .4rem; flex-wrap: wrap; }

.page-tree-item__perms {
  padding: .4rem 1rem .6rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  background: var(--bg-3);
}

/* ── Dashboard / Chart Widgets ────────────────────────────────────────── */
.dashboard-header { margin-bottom: 1rem; }

.grid-stack { min-height: 200px; margin-top: .5rem; }

/* GridStack setzt position:absolute + top/right/bottom/left Insets auf
   .grid-stack-item-content um den Margin zwischen Widgets zu erzeugen.
   height:auto stellt sicher, dass der bottom-Inset respektiert wird
   (height:100% wuerde bottom ueberschreiben und Abstaende zerstoeren). */
.grid-stack > .grid-stack-item > .grid-stack-item-content {
  height: auto;
}

.chart-widget {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
  transition: border-color .15s;
}

.chart-widget:hover { border-color: var(--border-2); }

.chart-widget__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .5rem .85rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-3);
  cursor: grab;
  user-select: none;
  flex-shrink: 0;
}

.chart-widget__header:active { cursor: grabbing; }

.chart-widget__title {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-widget__actions { display: flex; gap: .2rem; flex-shrink: 0; }

.chart-widget__btn {
  background: none; border: none;
  color: var(--text-3); font-size: .8rem;
  padding: .18rem .32rem;
  border-radius: 3px; cursor: pointer;
  transition: color .12s, background .12s;
  line-height: 1;
}

.chart-widget__btn:hover { color: var(--text-1); background: var(--border); }
.chart-widget__btn--remove:hover { color: var(--red); background: var(--red-dim); }

.chart-widget__body {
  flex: 1;
  position: relative;
  min-height: 0;
  overflow: hidden;
}

/* Canvas-Wrapper: füllt Body minus 10px Abstand auf allen Seiten */
.chart-widget__canvas-wrap {
  position: absolute;
  top:    8px;    /* Legende hat eigenen Platz durch Chart.js */
  right:  10px;
  bottom: 28px;   /* Mehr Platz für X-Achsen-Beschriftungen */
  left:   10px;
}

/* Canvas füllt den Wrapper komplett */
.chart-widget__canvas-wrap canvas {
  display: block;
  width:  100% !important;
  height: 100% !important;
}

/* Stat / Error / Table zentriert im Wrapper */
.chart-widget__canvas-wrap .chart-stat,
.chart-widget__canvas-wrap .chart-error,
.chart-widget__canvas-wrap .chart-table-wrap {
  position: absolute;
  inset: 0;
  display: none;
}

.chart-widget__loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-2);
}

.spinner {
  width: 22px; height: 22px;
  border: 2px solid var(--border-2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .65s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.chart-stat {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: .2rem; width: 100%; height: 100%;
}

.stat-value {
  font-size: 2.5rem; font-weight: 700;
  letter-spacing: -.04em; color: var(--text-1);
  font-family: var(--font-mono);
}

.stat-unit { font-size: .85rem; color: var(--text-3); }

.chart-table-wrap { width: 100%; height: 100%; overflow: auto; }

.chart-table { width: 100%; border-collapse: collapse; font-size: .78rem; }
.chart-table th {
  text-align: left; padding: .3rem .5rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-3); font-size: .68rem;
  font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  white-space: nowrap;
}
.chart-table td {
  padding: .3rem .5rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  font-family: var(--font-mono);
}

.chart-error {
  display: flex; align-items: center; justify-content: center;
  font-size: .78rem; color: var(--red);
  padding: 1rem; text-align: center;
}

/* Chart Picker */
.chart-picker {
  display: flex; flex-direction: column;
  gap: .3rem; max-height: 340px; overflow-y: auto;
}

.chart-picker__loading { color: var(--text-3); font-size: .85rem; padding: 1rem 0; }

.chart-pick-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .55rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .12s, background .12s;
}

.chart-pick-item:hover { border-color: var(--accent); background: var(--bg-3); }

.chart-pick-item__dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.chart-pick-item__info { flex: 1; display: flex; flex-direction: column; gap: .1rem; }
.chart-pick-item__title { font-size: .875rem; font-weight: 500; }
.chart-pick-item__type  { font-size: .71rem; color: var(--text-3); }
.chart-pick-item__badge { font-size: .65rem; color: var(--text-3); margin-left: .3rem; }
.chart-pick-item__add   { color: var(--accent); font-size: 1.1rem; font-weight: 600; }

/* ── Add-Dropdown (Topbar Hinzufügen-Menü) ──────────────────────── */
.add-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px); right: 0;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  min-width: 180px;
  padding: .3rem;
  animation: modal-in .12s ease;
}
.add-dropdown.is-open { display: block; }

.add-dropdown__item {
  display: flex;
  align-items: center;
  gap: .5rem;
  width: 100%;
  padding: .45rem .7rem;
  background: none;
  border: none;
  border-radius: 5px;
  color: var(--text-2);
  font-size: .82rem;
  font-family: var(--font);
  cursor: pointer;
  text-align: left;
  transition: background .12s, color .12s;
}
.add-dropdown__item:hover { background: var(--bg-3); color: var(--text-1); }

/* ── Zeitbereich-Toolbar (lebt in .topbar__actions) ─────────────────── */
.timerange-bar {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin: 0;
  position: relative;
  flex-wrap: nowrap;
}

.timerange-quick {
  display: flex; align-items: center; gap: .4rem;
  cursor: pointer;
  padding: .28rem .65rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-2);
  background: var(--bg-3);
  transition: border-color .15s;
  user-select: none;
}

.timerange-quick:hover { border-color: var(--accent); }

.timerange-quick__label { font-size: .82rem; font-weight: 500; color: var(--text-1); white-space: nowrap; }

.timerange-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px); right: 0;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  min-width: 360px;
  animation: modal-in .15s ease;
}

.timerange-dropdown.is-open { display: block; }

.timerange-dropdown__section {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}
.timerange-dropdown__section:last-child { border-bottom: none; }

.timerange-dropdown__label {
  font-size: .68rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: .6rem;
}

.timerange-quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .3rem; }

.timerange-quick-btn {
  background: none; border: 1px solid transparent;
  border-radius: var(--radius);
  padding: .32rem .6rem;
  font-size: .82rem; color: var(--text-2);
  cursor: pointer; text-align: left;
  transition: background .12s, color .12s, border-color .12s;
}

.timerange-quick-btn:hover { background: var(--bg-3); color: var(--text-1); }
.timerange-quick-btn.active {
  background: var(--accent-dim);
  border-color: rgba(79,142,247,.4);
  color: var(--accent);
}

.timerange-custom { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; }
.timerange-custom .field { flex: 1; min-width: 140px; }

.timerange-display { font-size: .72rem; color: var(--text-3); font-family: var(--font-mono); white-space: nowrap; }

.timerange-refresh {
  background: none;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: .3rem .45rem;
  color: var(--text-2);
  cursor: pointer;
  display: flex; align-items: center;
  transition: color .15s, border-color .15s;
  margin-left: auto;
}

.timerange-refresh:hover { color: var(--accent); border-color: var(--accent); }

/* ── Error Pages ─────────────────────────────────────────────────────── */
.error-page {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 2rem; gap: 1rem;
}

.error-page__code {
  font-size: 6rem; font-weight: 700;
  letter-spacing: -.05em;
  color: var(--border-2); line-height: 1;
  font-family: var(--font-mono);
}

.error-page__title { font-size: 1.4rem; font-weight: 600; color: var(--text-1); }
.error-page__text { color: var(--text-2); font-size: .9rem; max-width: 320px; margin-bottom: .5rem; }

/* ── Toast ───────────────────────────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  z-index: 9999; display: flex; flex-direction: column; gap: .5rem;
}

.toast {
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: .75rem 1.1rem;
  font-size: .875rem;
  box-shadow: var(--shadow-lg);
  animation: toast-in .2s ease;
  max-width: 340px;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Page Header ─────────────────────────────────────────────────────── */
.page-header { margin-bottom: 1.75rem; }
.page-header__title { font-size: 1.25rem; font-weight: 600; letter-spacing: -.02em; }
.page-header__subtitle { color: var(--text-2); font-size: .875rem; margin-top: .25rem; }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.is-open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .topbar__menu-btn { display: flex; }
  .content-area { padding: 1.25rem; }
}

/* ══════════════════════════════════════════════════════════════════
   MOBILE / RESPONSIVE – vollständig überarbeitet
   ══════════════════════════════════════════════════════════════════ */

/* Tablet (768px) */
@media (max-width: 900px) {
  :root { --sidebar-w: 220px; }
}

/* Mobile (600px und kleiner) */
@media (max-width: 640px) {
  :root {
    --sidebar-w: 280px;
    --topbar-h: 52px;
  }

  /* ── Layout ── */
  .app-layout { display: block; }

  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
    z-index: 200;
  }

  .sidebar.is-open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,.5);
  }

  .main-content { margin-left: 0; }

  .topbar {
    padding: 0 .5rem;
    gap: .35rem;
  }
  .topbar__menu-btn { display: flex; flex-shrink: 0; }
  .topbar__breadcrumb { font-size: .75rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar__search { flex-shrink: 0; }
  .topbar__search-input { width: 90px; font-size: .75rem; padding: .3rem .5rem .3rem 1.7rem; }
  .topbar__search-input:focus { width: 130px; }
  .topbar__actions { flex-shrink: 0; gap: .25rem; }

  .content-area { padding: 1rem; }

  /* Overlay wenn Sidebar offen */
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 150;
  }
  .sidebar-overlay.is-open { display: block; }

  /* ── Auth / Login ── */
  .auth-layout { grid-template-columns: 1fr; min-height: 100vh; }
  .auth-visual { display: none; }
  .auth-panel { padding: 2rem 1.5rem; border-right: none; }

  /* ── Tenant Picker ── */
  .picker-body { margin: 2rem auto; }
  .picker-title { font-size: 1.25rem; }

  /* ── Stat Grid ── */
  .stat-grid { grid-template-columns: repeat(2, 1fr); }

  /* ── Tables: Card-Layout auf Mobile ── */
  .table-wrapper { overflow: visible; }

  .data-table thead { display: none; }

  .data-table tr {
    display: block;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: .75rem;
    padding: .75rem 1rem;
  }

  .data-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .4rem 0;
    border-bottom: 1px solid var(--border);
    font-size: .85rem;
  }

  .data-table td:last-child { border-bottom: none; }

  .data-table td::before {
    content: attr(data-label);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-3);
    flex-shrink: 0;
    margin-right: .75rem;
  }

  .actions-cell {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .35rem;
  }

  /* ── Modals ── */
  .modal-backdrop { padding: .5rem; align-items: flex-end; }

  .modal {
    max-width: 100%;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    animation: modal-slide-up .2s ease;
  }

  @keyframes modal-slide-up {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }

  .modal--lg { max-width: 100%; }

  .modal__body { max-height: 70vh; overflow-y: auto; }

  /* ── Page Grid ── */
  .page-grid { grid-template-columns: repeat(2, 1fr); gap: .75rem; }

  /* ── Dashboard Grid auf Mobile ── */
  .grid-stack > .grid-stack-item {
    min-height: 200px;
  }

  /* ── Chart Widgets ── */
  .chart-widget__title { font-size: .75rem; }

  /* ── Timerange Bar ── */
  .timerange-bar { gap: .35rem; }
  .timerange-quick__label { font-size: .75rem; }
  .timerange-display { display: none; }

  .timerange-dropdown {
    min-width: calc(100vw - 2rem);
    right: -1rem;
  }

  .timerange-quick-grid { grid-template-columns: repeat(2, 1fr); }

  .timerange-custom { flex-direction: column; }
  .timerange-custom .field { min-width: 100%; }

  /* ── Admin Shell Sidebar ── */
  .admin-badge { display: none; }

  /* ── Formulare ── */
  .modal__body > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  /* ── Section Block ── */
  .section-block__header { flex-direction: column; align-items: flex-start; gap: .5rem; }

  /* ── Page Tree ── */
  .page-tree-item.depth-1 { margin-left: .75rem; }
  .page-tree-item.depth-2 { margin-left: 1.5rem; }

  .page-tree-item__row { flex-direction: column; align-items: flex-start; gap: .5rem; }
  .page-tree-item__actions { width: 100%; justify-content: flex-start; }

  /* ── Breadcrumb ── */
  .topbar__breadcrumb .breadcrumb__item:not(.breadcrumb__item--current) {
    display: none;
  }
  .topbar__breadcrumb .breadcrumb__sep { display: none; }
}

/* Extra-kleine Geräte (360px) */
@media (max-width: 380px) {
  .stat-grid { grid-template-columns: 1fr; }
  .page-grid { grid-template-columns: 1fr; }
  .auth-panel { padding: 1.5rem 1rem; }
}

/* ── Touch-Optimierungen (alle Touch-Geräte) ── */
@media (hover: none) {
  /* Grössere Tap-Targets */
  .btn { min-height: 40px; }
  .btn--sm { min-height: 36px; padding: .4rem .75rem; }

  .sidebar__link { padding: .6rem .85rem; min-height: 44px; }
  .sidebar__sub-link { padding: .4rem .5rem; min-height: 38px; }
  .sidebar__footer-link { min-height: 40px; }

  .field__input { padding: .65rem .85rem; font-size: 16px; } /* 16px verhindert Auto-Zoom auf iOS */
  .select-inline { font-size: 16px; min-height: 40px; }

  /* Kein Hover-Effekt auf Touch */
  .tenant-card:hover { transform: none; }

  /* Chart-Widget: kein Cursor-Grab auf Touch */
  .chart-widget__header { cursor: default; }

  /* Timerange Quick-Buttons grösser */
  .timerange-quick-btn { min-height: 40px; font-size: .875rem; }
}

/* ── Mobile Navbar Bottom – entfernt ── */
.mobile-nav { display: none; }


/* ── Startseiten-Widgets ─────────────────────────────────────────── */
.home-widget-grid { min-height: 200px; }

.home-widget {
  width: 100%; height: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-2);
  border: 1px solid var(--border);
}

.home-widget__video {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.home-widget__image {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.home-widget__text {
  padding: 1rem;
  font-size: .9rem;
  color: var(--text-1);
  line-height: 1.6;
  height: 100%;
  overflow: auto;
}

/* Media Library */
.media-library {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  max-height: 300px;
  overflow-y: auto;
}

.media-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .4rem .6rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: grab;
  transition: border-color .15s;
  user-select: none;
}

.media-item:hover { border-color: var(--accent); }
.media-item:active { cursor: grabbing; }

.media-item__thumb {
  width: 36px; height: 36px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.media-item__video-thumb, .media-item__chart-thumb {
  width: 36px; height: 36px;
  background: var(--bg-4);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.media-item__name {
  flex: 1;
  font-size: .8rem;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.media-item__del {
  background: none; border: none;
  color: var(--text-3); font-size: .8rem;
  cursor: pointer; padding: .1rem .3rem;
  border-radius: 3px;
  transition: color .12s;
  flex-shrink: 0;
}
.media-item__del:hover { color: var(--red); }

/* Home Editor Widget */
.home-editor-widget {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.home-editor-widget__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .4rem .75rem;
  background: var(--bg-3);
  border-bottom: 1px solid var(--border);
  cursor: grab;
}

.home-editor-widget__title {
  font-size: .78rem;
  font-weight: 500;
  color: var(--text-2);
}

/* Admin Sidebar: Startseite bearbeiten Link */
.sidebar__footer-link--media {
  color: var(--accent);
}

/* ── Chart-Gruppen ───────────────────────────────────────────────── */
.group-item-list {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  min-height: 40px;
}

.group-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem .65rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .82rem;
  cursor: grab;
  transition: border-color .12s;
  user-select: none;
}

.group-item:hover { border-color: var(--accent); }

.group-item__handle { color: var(--text-3); font-size: 1rem; }
.group-item__title  { flex: 1; color: var(--text-1); }
.group-item__size   { font-size: .72rem; color: var(--text-3); font-family: var(--font-mono); }

.group-item__del {
  background: none; border: none;
  color: var(--text-3); font-size: .8rem;
  cursor: pointer; padding: 0 .2rem;
  transition: color .12s;
}
.group-item__del:hover { color: var(--red); }

.group-dropzone {
  margin-top: .4rem;
  padding: .4rem .75rem;
  border: 1px dashed var(--border-2);
  border-radius: var(--radius);
  font-size: .75rem;
  color: var(--text-3);
  text-align: center;
  cursor: copy;
  transition: border-color .15s, color .15s;
}
.group-dropzone:hover { border-color: var(--accent); color: var(--accent); }

.group-editor-item {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .5rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: .3rem;
}


/* ── Light Mode Overrides ─────────────────────────────────────────── */
[data-theme="light"] .badge--admin    { background: rgba(220,38,38,.08); color: #dc2626; border-color: rgba(220,38,38,.25); }
[data-theme="light"] .badge--teamadmin { background: rgba(217,119,6,.08); color: #b45309; border-color: rgba(217,119,6,.25); }
[data-theme="light"] .badge--success  { background: rgba(5,150,105,.08); color: #047857; border-color: rgba(5,150,105,.25); }

[data-theme="light"] .flash--success { background: rgba(5,150,105,.06);  color: #065f46; }
[data-theme="light"] .flash--danger  { background: rgba(220,38,38,.06);  color: #991b1b; }
[data-theme="light"] .flash--info    { background: rgba(37,99,235,.06);  color: #1e40af; }
[data-theme="light"] .flash--warning { background: rgba(217,119,6,.06);  color: #92400e; }

[data-theme="light"] .btn--primary { color: #fff; }
[data-theme="light"] .btn--danger:hover { color: #fff; }

[data-theme="light"] .sidebar { background: var(--bg-2); box-shadow: 1px 0 4px rgba(0,0,0,.06); }
[data-theme="light"] .sidebar__logo-name { color: var(--text-1); }

[data-theme="light"] .auth-page { background: var(--bg); }
[data-theme="light"] .auth-panel { background: var(--bg-2); }
[data-theme="light"] .auth-visual { background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%); }

[data-theme="light"] .topbar { background: var(--bg-2); border-bottom: 1px solid var(--border); }
[data-theme="light"] .data-table th { background: var(--bg-4); }

[data-theme="light"] .sidebar__footer-link--danger { color: var(--red); }
[data-theme="light"] .sidebar__footer-link--danger:hover { background: rgba(220,38,38,.06); }


