/* ==========================================================================
   IT-Service Kundenportal – Demo-Stylesheet
   Mandant: VisionHost24 IT-Solutions | Markenfarbe: #61862e
   ========================================================================== */

:root {
  /* Markenfarben (je IT-Dienstleister austauschbar) */
  --brand: #61862e;
  --brand-dark: #4a6823;
  --brand-light: #eef3e8;
  --brand-rgb: 97, 134, 46;

  /* Neutrale Töne */
  --ink: #1c2420;
  --ink-soft: #4d574a;
  --paper: #f6f7f5;
  --surface: #ffffff;
  --border: #e1e6dd;
  --border-strong: #c9d1c2;

  /* Ampelfarben (Statusanzeigen gemäß Lastenheft Kap. 7) */
  --status-green: #2f8f4e;
  --status-green-bg: #e6f4ea;
  --status-yellow: #b8860b;
  --status-yellow-bg: #fdf3df;
  --status-red: #c23b3b;
  --status-red-bg: #fbe9e9;
  --status-grey: #8a8f8a;
  --status-grey-bg: #eceeec;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(28, 36, 32, 0.06);
  --shadow-md: 0 4px 16px rgba(28, 36, 32, 0.08);
  --shadow-lg: 0 12px 32px rgba(28, 36, 32, 0.14);

  --sidebar-w: 264px;
  --topbar-h: 64px;

  --font-display: 'Sora', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font-family: inherit; }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ==========================================================================
   App-Layout
   ========================================================================== */

.app {
  display: flex;
  min-height: 100vh;
}

/* ---- Sidebar -------------------------------------------------------- */

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--ink);
  background: linear-gradient(180deg, #1f2a1f 0%, #161e16 100%);
  color: #d9ded6;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 40;
  transition: transform 0.25s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand .logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: #fff;
  font-size: 15px;
  flex-shrink: 0;
}

.sidebar-brand .brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  overflow: hidden;
}

.sidebar-brand .brand-text strong {
  font-family: var(--font-display);
  font-size: 14.5px;
  color: #fff;
  white-space: nowrap;
}

.sidebar-brand .brand-text span {
  font-size: 11px;
  color: #9aa595;
  white-space: nowrap;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 14px 10px;
}

.nav-group-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #748068;
  padding: 14px 12px 6px;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: #c7cdc1;
  font-size: 13.8px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  margin-bottom: 2px;
  position: relative;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-item i { font-size: 16px; width: 18px; text-align: center; flex-shrink: 0; opacity: 0.85; }

.nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}

.nav-item.active {
  background: var(--brand);
  color: #fff;
}
.nav-item.active i { opacity: 1; }

.nav-item .nav-badge {
  margin-left: auto;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 100px;
}
.nav-item.active .nav-badge { background: rgba(255,255,255,0.25); }
.nav-item.alert-badge .nav-badge {
  background: var(--status-red);
}

.sidebar-footer {
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.role-switcher {
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.role-switcher label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8d9682;
  display: block;
  margin-bottom: 6px;
}

.role-switcher select {
  width: 100%;
  background: #232f22;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12.5px;
}

/* ---- Main column ------------------------------------------------------ */

.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.sidebar-toggle {
  display: none;
  border: none;
  background: none;
  font-size: 20px;
  color: var(--ink-soft);
  cursor: pointer;
}

.tenant-customer-select {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
}
.tenant-customer-select i { color: var(--brand); }

.topbar-search {
  flex: 1;
  max-width: 380px;
  position: relative;
}
.topbar-search input {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--paper);
  border-radius: 100px;
  padding: 8px 14px 8px 36px;
  font-size: 13.5px;
  color: var(--ink);
}
.topbar-search input:focus { outline: none; border-color: var(--brand); background: #fff; }
.topbar-search i {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: #9aa39a;
  font-size: 14px;
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 18px;
}

.icon-btn {
  position: relative;
  border: none;
  background: none;
  font-size: 18px;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
}
.icon-btn:hover { background: var(--paper); }
.icon-btn .dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  background: var(--status-red);
  border-radius: 50%;
  border: 2px solid #fff;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
}
.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brand-light);
  color: var(--brand-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  font-family: var(--font-display);
}
.user-chip .user-meta { line-height: 1.25; }
.user-chip .user-meta strong { font-size: 13px; display: block; }
.user-chip .user-meta span { font-size: 11.5px; color: var(--ink-soft); }

/* ---- Content area ------------------------------------------------------ */

.content {
  flex: 1;
  padding: 26px 30px 60px;
  max-width: 1360px;
  width: 100%;
}

.view { display: none; }
.view.active { display: block; animation: fadeIn 0.25s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.view-header .eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--brand-dark);
  font-weight: 700;
  margin-bottom: 4px;
  display: block;
}

.view-header h1 { font-size: 24px; }
.view-header p.sub { color: var(--ink-soft); font-size: 13.8px; margin-top: 5px; max-width: 640px; }

.view-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-outline { background: #fff; border-color: var(--border-strong); color: var(--ink); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand-dark); }
.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: var(--paper); }
.btn-sm { padding: 5px 11px; font-size: 12.5px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ==========================================================================
   Cards & grid
   ========================================================================== */

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

.card-pad { padding: 20px; }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.card-head h3 { font-size: 15px; }
.card-head .muted-link { font-size: 12.5px; color: var(--ink-soft); font-weight: 600; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-5 { grid-template-columns: repeat(3, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
}

/* ---- Status pill / dashboard stat card ------------------------------- */

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.stat-card .stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.stat-card .stat-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.stat-card .stat-value {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
}
.stat-card .stat-label { font-size: 12.8px; color: var(--ink-soft); font-weight: 500; }

.icon-tone-green { background: var(--status-green-bg); color: var(--status-green); }
.icon-tone-yellow { background: var(--status-yellow-bg); color: var(--status-yellow); }
.icon-tone-red { background: var(--status-red-bg); color: var(--status-red); }
.icon-tone-grey { background: var(--status-grey-bg); color: var(--status-grey); }
.icon-tone-brand { background: var(--brand-light); color: var(--brand-dark); }

/* ---- Status dot + pill ------------------------------------------------ */

.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-green { background: var(--status-green); }
.dot-yellow { background: var(--status-yellow); }
.dot-red { background: var(--status-red); }
.dot-grey { background: var(--status-grey); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 100px;
  white-space: nowrap;
}
.pill-green { background: var(--status-green-bg); color: var(--status-green); }
.pill-yellow { background: var(--status-yellow-bg); color: var(--status-yellow); }
.pill-red { background: var(--status-red-bg); color: var(--status-red); }
.pill-grey { background: var(--status-grey-bg); color: var(--status-grey); }
.pill-brand { background: var(--brand-light); color: var(--brand-dark); }

/* ==========================================================================
   Tables
   ========================================================================== */

.table-wrap { overflow-x: auto; }
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
table.data-table th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  font-weight: 700;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data-table td:first-child { min-width: 160px; }
table.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--ink);
}
table.data-table tbody tr:hover { background: var(--paper); }
table.data-table tbody tr:last-child td { border-bottom: none; }
.cell-muted { color: var(--ink-soft); }
.cell-strong { font-weight: 600; }

.table-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.table-toolbar .filter-input {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 11px;
  font-size: 13px;
  background: var(--paper);
  min-width: 160px;
}
.table-toolbar select.filter-input { cursor: pointer; }

/* ==========================================================================
   Forms
   ========================================================================== */

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 760px) { .form-grid { grid-template-columns: 1fr; } }
.form-grid.full { grid-template-columns: 1fr; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field.span-2 { grid-column: span 2; }
@media (max-width: 760px) { .field.span-2 { grid-column: span 1; } }

.field label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
}
.field .hint { font-size: 11.5px; color: #8a9281; }

.field input,
.field select,
.field textarea {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13.8px;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.12);
}
.field textarea { resize: vertical; min-height: 80px; }

.upload-zone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--paper);
  padding: 22px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 13px;
  cursor: pointer;
}
.upload-zone i { font-size: 22px; color: var(--brand); display: block; margin-bottom: 6px; }
.upload-zone:hover { border-color: var(--brand); }

.checkbox-row { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; color: var(--ink-soft); }
.checkbox-row input { margin-top: 3px; }

/* ==========================================================================
   Progress / Timeline / Steps
   ========================================================================== */

.steps-track {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.step-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 84px;
  position: relative;
}
.step-node::after {
  content: '';
  position: absolute;
  top: 13px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--border-strong);
  z-index: 0;
}
.step-node:last-child::after { display: none; }
.step-node.done::after { background: var(--brand); }
.step-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  z-index: 1;
}
.step-node.done .step-circle { background: var(--brand); border-color: var(--brand); color: #fff; }
.step-node.current .step-circle { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 4px rgba(var(--brand-rgb),0.14); }
.step-label { font-size: 11px; text-align: center; color: var(--ink-soft); font-weight: 600; }
.step-node.done .step-label, .step-node.current .step-label { color: var(--ink); }

.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding-bottom: 20px; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -26px;
  top: 2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--brand);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--brand);
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item .t-date { font-size: 11.5px; color: var(--ink-soft); font-weight: 600; }
.timeline-item .t-title { font-size: 13.8px; font-weight: 600; margin: 2px 0 3px; }
.timeline-item .t-body { font-size: 13px; color: var(--ink-soft); }

/* ==========================================================================
   Tabs
   ========================================================================== */

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
  overflow-x: auto;
}
.tab-btn {
  border: none;
  background: none;
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tab-btn.active { color: var(--brand-dark); border-bottom-color: var(--brand); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ==========================================================================
   Modal
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20,26,18,0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}
.modal-overlay.active { display: flex; }
.modal-box {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-width: 560px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 16px; }
.modal-close { border: none; background: none; font-size: 18px; color: var(--ink-soft); cursor: pointer; }
.modal-body { padding: 22px; }
.modal-foot {
  padding: 16px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ==========================================================================
   Misc components
   ========================================================================== */

.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--ink-soft);
}
.empty-state i { font-size: 34px; color: var(--border-strong); display: block; margin-bottom: 12px; }
.empty-state h4 { font-size: 15px; color: var(--ink); margin-bottom: 5px; }
.empty-state p { font-size: 13px; }

.banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.3px;
  margin-bottom: 18px;
}
.banner i { font-size: 16px; margin-top: 1px; }
.banner-info { background: var(--brand-light); color: var(--brand-dark); }
.banner-warn { background: var(--status-yellow-bg); color: #8a6300; }
.banner-grey { background: var(--status-grey-bg); color: var(--ink-soft); }

.module-disabled-note {
  background: #fff;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 40px 30px;
  text-align: center;
  color: var(--ink-soft);
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
}
.list-row:last-child { border-bottom: none; }
.list-row .lr-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.list-row .lr-icon {
  width: 36px; height: 36px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 15px;
}
.list-row .lr-title { font-size: 13.8px; font-weight: 600; }
.list-row .lr-sub { font-size: 12px; color: var(--ink-soft); margin-top: 1px; }
.list-row .lr-right { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }

.progress-bar { height: 7px; background: var(--border); border-radius: 100px; overflow: hidden; }
.progress-bar > span { display: block; height: 100%; background: var(--brand); border-radius: 100px; }

.kbd-note { font-size: 11.5px; color: #9aa39a; }

.avatar-sq {
  width: 38px; height: 38px; border-radius: 9px;
  background: var(--brand-light); color: var(--brand-dark);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}

.device-card {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--status-green);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.device-card.dc-yellow { border-left-color: var(--status-yellow); }
.device-card.dc-red { border-left-color: var(--status-red); }
.device-card.dc-grey { border-left-color: var(--status-grey); }
.device-card .dc-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.device-card .dc-name { font-weight: 700; font-size: 14px; }
.device-card .dc-meta { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.dc-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 14px; font-size: 12.3px; }
.dc-rows span.k { color: var(--ink-soft); }
.dc-rows span.v { font-weight: 600; }
.device-card .dc-rows { margin-top: 12px; }

/* Risk matrix */
.risk-matrix { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; max-width: 460px; }
.risk-cell { aspect-ratio: 1.5; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: rgba(0,0,0,0.55); }

/* Notification dropdown */
.dropdown-panel {
  position: absolute;
  top: 56px;
  right: 24px;
  width: 360px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 60;
  display: none;
  max-height: 440px;
  overflow-y: auto;
}
.dropdown-panel.active { display: block; }
.dropdown-panel .dp-head { padding: 13px 16px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 13.5px; display:flex; justify-content: space-between; align-items:center; }

/* Role banner */
.role-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #1f2a1f;
  color: #d9ded6;
  font-size: 12.5px;
  padding: 7px 24px;
  position: relative;
  z-index: 50;
  flex-wrap: wrap;
  margin-left: var(--sidebar-w);
}
@media (max-width: 980px) {
  .role-banner { margin-left: 0; }
}
.role-banner b { color: #fff; }
.role-banner i { color: var(--brand); }

/* Sign pad */
.signpad {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9aa39a;
  font-size: 13px;
  font-style: italic;
  background: var(--paper);
}

/* Mobile */
.mobile-overlay {
  display: none;
  position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 39;
}
@media (max-width: 980px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .sidebar-toggle { display: inline-flex; align-items:center; justify-content:center; }
  .mobile-overlay.active { display: block; }
  .tenant-customer-select span.tcs-full { display: none; }
  .dropdown-panel { right: 12px; left: 12px; width: auto; }
}
@media (max-width: 760px) {
  .content { padding: 18px 14px 50px; }
  .topbar { padding: 0 14px; gap: 10px; }
  .topbar-search { display: none; }
}

.module-grid-toggle { display: flex; align-items: center; gap: 10px; }
.switch {
  position: relative; width: 38px; height: 21px; flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; cursor: pointer; inset: 0; background: var(--border-strong); border-radius: 100px; transition: 0.2s;
}
.switch .slider::before {
  content: ''; position: absolute; width: 15px; height: 15px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: 0.2s;
}
.switch input:checked + .slider { background: var(--brand); }
.switch input:checked + .slider::before { transform: translateX(17px); }

.code-id { font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 100px; }
::-webkit-scrollbar-track { background: transparent; }
