@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;600;700&display=swap');

:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --card: #f1f3f8;
  --primary: #1f4e79;
  --accent: #f58220;
  --text: #1b2333;
  --muted: #5b6b7d;
  --danger: #d14343;
  --success: #1f8a70;
  --radius: 12px;
  --shadow: 0 20px 60px rgba(16, 36, 94, 0.12);
}

body.dark-mode {
  --bg: #0f172a;
  --panel: #111827;
  --card: #1f2937;
  --primary: #1f8bd1;
  --accent: #f58220;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --danger: #f87171;
  --success: #34d399;
  --shadow: 0 20px 60px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Manrope', 'Segoe UI', system-ui, sans-serif;
  background: radial-gradient(circle at 20% 20%, rgba(31,78,121,0.06), transparent 32%),
              radial-gradient(circle at 70% 10%, rgba(245,130,32,0.08), transparent 38%),
              var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 22px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(246,248,251,0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #e2e8f0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.app-switcher {
  position: relative;
  cursor: pointer;
  user-select: none;
}
.app-switcher__chevron {
  font-size: 0.85rem;
  color: var(--muted);
  transition: transform 0.12s ease;
}
.app-switcher.is-open .app-switcher__chevron { transform: rotate(180deg); }
.app-switcher-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  min-width: min(340px, calc(100vw - 24px));
  max-width: min(420px, calc(100vw - 24px));
  background: var(--panel);
  border: 1px solid #d7deea;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.12);
  padding: 0.75rem;
  z-index: 24;
  cursor: default;
}
.app-switcher-list { display: flex; flex-direction: column; gap: 0.5rem; }
.app-switcher-item {
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  color: var(--text);
  text-align: left;
  text-decoration: none;
  font: inherit;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
}
.app-switcher-item:hover,
.app-switcher-item:focus-visible {
  background: var(--card);
  border-color: #d7deea;
  outline: none;
}
.app-switcher-item__icon {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--card);
  color: var(--primary);
}
.app-switcher-item__icon-svg { width: 22px; height: 22px; fill: currentColor; }
.app-switcher-item strong { font-size: 0.95rem; }
.app-switcher-empty { padding: 0.9rem 0.2rem; color: var(--muted); font-size: 0.92rem; }
.brand-name { font-size: 1.1rem; }
.brand-sub { color: var(--muted); font-size: 0.8rem; display: block; margin-top: -2px; }
.logo-img { filter: drop-shadow(0 6px 14px rgba(0,0,0,0.08)); border-radius: 10px; }

.top-actions { display: flex; align-items: center; gap: 14px; }
.notification-menu { position: relative; }
.profile-menu { position: relative; }
.profile-dropdown {
  position: absolute;
  right: 0;
  top: 110%;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.12);
  padding: 0.8rem;
  width: 230px;
  z-index: 20;
}
.profile-dropdown.hidden { display: none; }
.notification-dropdown {
  position: absolute;
  right: 0;
  top: 110%;
  width: min(380px, calc(100vw - 24px));
  background: var(--panel);
  border: 1px solid #d7deea;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.12);
  padding: 0.85rem;
  z-index: 20;
}
.notification-dropdown.hidden { display: none; }
.notification-dropdown__header,
.notification-dropdown__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.notification-dropdown__header { margin-bottom: 0.7rem; }
.notification-dropdown__footer { margin-top: 0.7rem; }
.notification-dropdown__list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 320px;
  overflow-y: auto;
}
.notification-dropdown__item {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.7rem;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid #e3e9f1;
}
.notification-dropdown__item.is-unread {
  border-color: rgba(31, 78, 121, 0.24);
  box-shadow: inset 0 0 0 1px rgba(31, 78, 121, 0.08);
}
.notification-dropdown__meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.notification-dropdown__meta strong,
.notification-dropdown__meta span {
  word-break: break-word;
}
.notification-dropdown__actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
}
.notification-dropdown__icon-btn {
  width: 30px;
  min-width: 30px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 18px;
  line-height: 1;
}
.notification-dropdown__empty {
  padding: 0.9rem 0.2rem;
  text-align: center;
}
.profile-info { margin-bottom: 0.6rem; }
.profile-name { font-weight: 700; }
.profile-email { font-size: 0.9rem; color: var(--muted); word-break: break-word; }
.profile-dropdown button.fullwidth { width: 100%; margin-top: 0.35rem; }
.notification-dropdown button.fullwidth { width: 100%; }
.icon-btn {
  background: #ffffff;
  border: 1px solid #d7deea;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--primary);
  cursor: pointer;
  transition: box-shadow .12s, transform .12s, border .12s;
}
.icon-btn:hover { box-shadow: var(--shadow); transform: translateY(-1px); border-color: var(--primary); }
.icon-btn svg { pointer-events: none; }
.notification-btn { position: relative; }
.notification-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #fff6eb;
  color: #b85b00;
  border: 1px solid #f0a24d;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  font-weight: 700;
}
.view-icon.hidden { display: none; }

.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}
.switch input { display: none; }
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #334155;
  transition: .2s;
  border-radius: 999px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px; width: 18px;
  left: 4px; bottom: 3px;
  background: white;
  transition: .2s;
  border-radius: 50%;
}
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider:before { transform: translateX(20px); }

#app {
  padding: 20px;
  max-width: 1180px;
  margin: 0 auto 40px;
}

.panel {
  display: none;
  background: var(--panel);
  border: 1px solid #e3e9f1;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.panel.active { display: block; }

.panel-header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 16px;
}
.panel-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.panel-bar h2 { justify-self: start; }
.panel-actions { display: flex; gap: 8px; justify-content: flex-end; justify-self: end; }

h1, h2 {
  margin: 0 0 8px;
  font-weight: 600;
}

p {
  margin: 0 0 18px;
  color: var(--muted);
}

.actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}
.settings-block {
  box-shadow: var(--shadow);
}
.settings-submenu {
  padding: 0;
  overflow: hidden;
}
.settings-submenu__toggle {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 1rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font: inherit;
  font-weight: 700;
  color: inherit;
  cursor: pointer;
}
.settings-submenu__body {
  padding: 0 1.1rem 1.1rem;
}
.settings-submenu__actions {
  margin-bottom: 10px;
  justify-content: flex-end;
}
.settings-submenu__chevron {
  transition: transform .16s ease;
  font-size: 1rem;
}
.settings-submenu__chevron.collapsed {
  transform: rotate(-90deg);
}
.settings-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
}
.settings-nav {
  background: #ffffff;
  border: 1px solid #e3e9f1;
  border-radius: var(--radius);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow);
}
.nav-btn {
  padding: 10px 12px;
  text-align: left;
  border: 1px solid #dfe6f2;
  border-radius: var(--radius);
  background: #f8fafc;
  color: var(--text);
  cursor: pointer;
  transition: all .12s;
}
.nav-btn.active {
  border-color: var(--primary);
  background: rgba(31,78,121,0.1);
  color: var(--primary);
}
.tmpl-child {
  width: calc(100% - 22px);
  margin-left: auto;
  margin-right: 11px;
  font-size: 0.95rem;
}
.user-child {
  width: calc(100% - 26px);
  margin-left: auto;
  margin-right: 6px;
  padding-left: 18px;
  text-align: left;
}
.settings-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.settings-content .card,
.settings-content .list .row {
  cursor: default;
  transition: none;
  border: none;
  box-shadow: none;
}
.settings-content .card:hover,
.settings-content .list .row:hover {
  transform: none;
  box-shadow: none;
  border-color: transparent;
  background: transparent;
}
.settings-tab.hidden { display: none; }
.hidden { display: none; }
.user-subnav {
  margin-left: 18px;
  padding-left: 18px;
  font-size: 0.95rem;
  position: relative;
}
.kiosk-subnav {
  margin-left: 18px;
  padding-left: 18px;
  font-size: 0.95rem;
}
.block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.list { display: flex; flex-direction: column; gap: 10px; }
.list .row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  border: none;
  padding: 0;
  margin: 0;
  background: transparent;
}
.list .row input {
  background: #ffffff;
}
.nested-list .row {
  padding-left: 6px;
}
.log-list-scroll {
  max-height: 520px;
  overflow-y: auto;
  padding-right: 6px;
}
.log-filter-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 6px;
}
.log-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.log-actions .primary.small {
  height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
}
.log-filters {
  display: grid;
  grid-template-columns: 2fr repeat(3, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}
.log-filters.collapsed { display: none; }
.log-filters input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #dfe6f2;
  border-radius: var(--radius);
}
.log-entry {
  background: #f9fbff;
  border: 1px solid #dfe6f2;
  border-radius: var(--radius);
  padding: 10px 12px;
}
.inline-actions { display: flex; gap: 6px; }
.rule-row {
  padding-bottom: 14px;
  border-bottom: 1px solid #e3e9f1;
}
.rule-flow {
  display: grid;
  gap: 4px;
  margin: 6px 0 8px;
}
.rule-flow__arrow {
  display: inline-block;
  width: 18px;
}
.rule-flow__then {
  padding-left: 18px;
}
.icon-only { width: 42px; display: grid; place-items: center; }
.log-meta {
  display: flex;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}
.cat-nav {
  display: none;
}
.cat-child { margin-left: 12px; font-weight: 600; }
.cat-pane.hidden { display: none; }
.tree-root { list-style: none; padding-left: 0; margin: 0; }
.tree-root > li { margin-bottom: 8px; }
.tree-root ul { margin: 4px 0 0 16px; }

.tile {
  padding: 30px 24px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(31,78,121,0.12), rgba(245,130,32,0.12));
  color: var(--text);
  border: 1px solid rgba(31,78,121,0.18);
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.filters, .form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
  position: relative;
}
.scroll-form {
  max-height: 65vh;
  overflow-y: auto;
  padding-right: 6px;
  position: relative;
}
.triple-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.form-actions.sticky {
  position: sticky;
  bottom: 0;
  background: #fff;
  border-top: 1px solid #e3e9f1;
  padding: 10px 0 0;
  display: flex;
  justify-content: flex-start;
  width: 100%;
}
.filters.collapsed { display: none; }
.filters .full {
  grid-column: 1 / -1;
}
.search-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  margin: 6px 0 30px;
  position: relative;
}
.search-box { position: relative; width: 100%; }
.full-input {
  width: 100%;
}
.suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 96px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  overflow: hidden;
  border: 1px solid rgba(31,78,121,0.12);
  max-height: 220px;
  display: flex;
  flex-direction: column;
  z-index: 10;
}
.suggestions.hidden { display: none; }
.suggestion {
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
}
.suggestion:hover,
.suggestion.active {
  background: linear-gradient(90deg, rgba(245,130,32,0.12), rgba(31,78,121,0.12));
  color: #1f4e79;
}
.sort-wrapper { position: relative; }
.popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #fff;
  border: 1px solid #d7deea;
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: 0 10px 30px rgba(31,78,121,0.12);
  z-index: 5;
}
.sort-options {
  display: grid;
  gap: 6px;
}
.sort-options button {
  width: 100%;
  text-align: left;
  background: #f8fafc;
  border: 1px solid #d7deea;
  padding: 8px 10px;
  border-radius: var(--radius);
}
.sort-options button:hover {
  background: linear-gradient(90deg, rgba(245,130,32,0.12), rgba(31,78,121,0.12));
}
.sort-options button.active {
  background: linear-gradient(135deg, var(--primary), #2b6ca3);
  color: #fff;
  border-color: var(--primary);
}
.icon-btn svg { pointer-events: none; }

.table-wrap {
  overflow-x: auto;
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid #e5e7eb;
  padding: 4px;
  margin-top: 12px;
}
table {
  width: 100%;
  border-collapse: collapse;
}
table th, table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}
table th {
  background: #f1f5f9;
  font-weight: 700;
}
table tr:hover { background: #f8fafc; }
.filter-row input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #d7deea;
  border-radius: 8px;
  font-size: 0.9rem;
}
.filter-row .hidden { display: none; }
.filter-toggle {
  font-size: 0.75rem;
  cursor: pointer;
  margin-left: 6px;
  color: var(--muted);
}
.filter-toggle:hover { color: var(--primary); }
.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-btn svg { width: 28px; height: 28px; transition: transform .15s ease; }
.icon-btn.collapsed svg { transform: rotate(180deg); }
.barcode-wrap {
  background: #fff;
  border: 1px solid #e3e9f1;
  border-radius: var(--radius);
  padding: 10px;
  display: inline-block;
}
.form-grid label, .filters label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  color: var(--muted);
}
.action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 12px;
}
.stacked {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.stacked .action-row {
  margin-top: auto;
  justify-content: flex-end;
}

input, select, button {
  border: none;
  outline: none;
  border-radius: var(--radius);
  padding: 12px 14px;
  background: #f8fafc;
  color: var(--text);
  font-size: 1rem;
}
input[type="checkbox"] {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
  padding: 0;
}
input, select { border: 1px solid #d7deea; }
input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31,78,121,0.15); }

button {
  cursor: pointer;
  font-weight: 600;
  transition: background .15s, transform .12s;
}
button.primary {
  background: linear-gradient(135deg, var(--primary), #2b6ca3);
  color: #ffffff;
}
button.primary:hover { transform: translateY(-1px); }

button.ghost {
  background: transparent;
  border: 1px solid #d7deea;
  color: var(--primary);
}
button.danger {
  border: 1px solid var(--danger);
  color: var(--danger);
  background: #fff5f5;
}
button.danger:hover { background: #ffecec; }
button.danger {
  border: 1px solid var(--danger);
  color: var(--danger);
  background: #fff5f5;
}
button.danger:hover { background: #ffecec; }
button.back { min-width: 120px; }
button.small { padding: 8px 10px; font-size: 0.9rem; }

.inline { display: flex; gap: 8px; align-items: center; }
.inline select { flex: 1; }
.inline-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 10px;
}
.hidden { display: none !important; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  border: 1px solid transparent;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: border .12s, transform .12s;
}
.card:hover { border-color: transparent; transform: none; box-shadow: none; }
.card .muted { color: var(--muted); font-size: 0.95rem; }
.badge {
  position: absolute;
  top: 12px;
  right: 12px;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(31,78,121,0.14);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-weight: 700;
  border: 1px solid rgba(31,78,121,0.22);
}
.badge.zero {
  background: rgba(209,67,67,0.18);
  color: #d14343;
  border-color: rgba(209,67,67,0.3);
}

.card {
  position: relative;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 600;
  background: rgba(31,78,121,0.12);
  color: var(--primary);
  font-size: 0.85rem;
}
.tag.purple { background: rgba(245,130,32,0.16); color: var(--accent); }

.notice {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: #eef2f7;
  color: var(--muted);
}
.notice.success { color: var(--success); }
.notice.error { color: var(--danger); }
.notice.full { grid-column: 1 / -1; }

.toast {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(31,138,209,0.15), rgba(245,130,32,0.12));
  border: 1px solid #cfe4f6;
  color: var(--text);
  box-shadow: var(--shadow);
}
.toast strong { display: block; margin-bottom: 6px; }
.toast .muted { color: var(--muted); }

.take-card {
  background: #e8f3ff;
  border-color: #c7ddf6;
}
.take-card .tag { background: rgba(31,78,121,0.2); }
.warn-text { color: var(--danger); font-weight: 700; }

.prompt-content {
  max-width: 420px;
}
.prompt-label {
  display: block;
  margin: 10px 0 6px;
  color: var(--muted);
  font-weight: 600;
}
.prompt-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.modal .card {
  position: relative;
}

.full { grid-column: 1 / -1; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
}
.modal.hidden { display: none; }
.modal-content {
  background: #ffffff;
  border-radius: var(--radius);
  padding: 20px;
  width: min(520px, 90vw);
  border: 1px solid #e3e9f1;
  box-shadow: var(--shadow);
}
.user-form {
  display: grid;
  gap: 12px;
}
.user-form .grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.user-form .grid-2 .full { grid-column: 1 / -1; }
.pill-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.roles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}
.modal.warning .modal-content {
  border: 1px solid var(--danger);
  box-shadow: 0 0 0 3px rgba(209,67,67,0.25), 0 18px 40px rgba(209,67,67,0.35);
  animation: warn-glow 1.6s ease-in-out infinite;
}
.modal.warning h3 { color: var(--danger); }
.modal-content.warning {
  border: 1px solid rgba(209,67,67,0.35);
}

@keyframes warn-glow {
  0% { box-shadow: 0 0 0 2px rgba(209,67,67,0.20), 0 12px 30px rgba(209,67,67,0.25); }
  50% { box-shadow: 0 0 0 6px rgba(209,67,67,0.35), 0 20px 44px rgba(209,67,67,0.45); }
  100% { box-shadow: 0 0 0 2px rgba(209,67,67,0.20), 0 12px 30px rgba(209,67,67,0.25); }
}
.modal-content h3 { margin-top: 0; }
.align-right { margin-left: auto; display: block; }
.modal-content.notification-rule-modal {
  width: min(860px, 94vw);
}
.notification-rule-form {
  gap: 18px;
}
.notification-rule-conditions-block {
  grid-column: 1 / -1;
}
.notification-rule-message-fields {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
}
.notification-rule-actions-block {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
}
.notification-rule-actions-title {
  margin: 0;
}
.notification-rule-actions-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}
.notification-rule-actions-toolbar--footer {
  margin-top: 4px;
}
.notification-rule-icon-btn {
  width: 46px;
  height: 46px;
  min-width: 46px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border-radius: 14px;
}
.notification-rule-icon-btn svg {
  width: 22px;
  height: 22px;
  pointer-events: none;
}
.notification-rule-icon-btn.active {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px rgba(31,78,121,0.12);
  background: rgba(31,78,121,0.08);
  color: var(--primary);
}
.notification-rule-submit-row {
  grid-column: 1 / -1;
  justify-content: center;
}

.pill-list { display: flex; flex-wrap: wrap; gap: 8px; }
.room-pills { margin-top: 4px; }

@media (max-width: 640px) {
  .topbar { flex-direction: column; gap: 10px; }
  .tile { padding: 18px; }
}

body:has(#login.active) .topbar {
  background: rgba(6, 10, 18, 0.82);
  border-bottom-color: rgba(255,255,255,0.08);
}

body:has(#login.active) .brand-name,
body:has(#login.active) .brand-sub,
body:has(#login.active) .top-actions,
body:has(#login.active) .top-actions .icon-btn {
  color: #f8fafc;
}

body:has(#login.active) .top-actions {
  visibility: hidden;
}
body:has(#login.active) .app-switcher__chevron,
body:has(#login.active) .app-switcher-dropdown { display: none !important; }

body.dark-mode .notification-dropdown,
body.dark-mode .profile-dropdown,
body.dark-mode .app-switcher-dropdown {
  border-color: #2b3546;
}

@media (max-width: 640px) {
  .notification-dropdown {
    right: -44px;
    width: min(360px, calc(100vw - 16px));
  }
}

.login-panel {
  position: relative;
  padding: 0;
  overflow: hidden;
  background:
    linear-gradient(160deg, rgba(75,165,214,0.14) 0%, rgba(75,165,214,0.02) 26%, transparent 26%),
    linear-gradient(135deg, #05070b 0%, #0d1724 52%, #13283a 100%);
  border-color: rgba(255,255,255,0.08);
  min-height: calc(100vh - 130px);
}

.login-success-wave {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  z-index: 999;
  overflow: hidden;
}

.login-success-wave.active {
  opacity: 1;
}

.login-success-wave__layer {
  position: absolute;
  width: 170vw;
  height: 170vh;
  left: -35vw;
  border-radius: 42%;
  transform: translateY(110%);
}

.login-success-wave.active .login-success-wave__layer--one {
  animation: login-wave-rise 820ms cubic-bezier(.2,.8,.2,1) forwards;
  background: rgba(75,165,214,0.24);
}

.login-success-wave.active .login-success-wave__layer--two {
  animation: login-wave-rise 820ms 70ms cubic-bezier(.2,.8,.2,1) forwards;
  background: rgba(75,165,214,0.4);
}

.login-success-wave.active .login-success-wave__layer--three {
  animation: login-wave-rise 820ms 140ms cubic-bezier(.2,.8,.2,1) forwards;
  background: linear-gradient(135deg, rgba(75,165,214,0.92), rgba(123,199,240,0.9));
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) minmax(340px, 0.9fr);
  min-height: calc(100vh - 130px);
}

.login-language-toggle--top {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 2;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.12);
}

.login-hero {
  padding: 56px 48px;
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
}

.login-brand-lockup {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.login-brand-image {
  max-width: 220px;
}

.login-brand-tag {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(75,165,214,0.12);
  border: 1px solid rgba(75,165,214,0.35);
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9ed5f4;
}

.login-eyebrow {
  margin: 0 0 12px;
  color: #7bc7f0;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-hero h1 {
  margin: 0;
  font-size: clamp(2.3rem, 4vw, 4.2rem);
  line-height: 1.02;
  color: #ffffff;
  max-width: 10ch;
}

.login-lead {
  margin-top: 18px;
  max-width: 56ch;
  color: rgba(248,250,252,0.8);
  font-size: 1.05rem;
  line-height: 1.7;
}

.login-card {
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(14px);
  padding: 42px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  position: relative;
  z-index: 1;
}

.login-card-header {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 16px;
}

.login-card-kicker {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 700;
}

.login-card h2 {
  margin: 0;
}

.login-language-toggle {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: #e9eef5;
}

.login-lang-btn {
  min-width: 52px;
  padding: 10px 14px;
  border-radius: 999px;
  background: transparent;
  color: #425466;
}

.login-lang-btn.active {
  background: #4ba5d6;
  color: #ffffff;
}

.email-editor {
  width: 100%;
  border: 1px solid rgba(66, 84, 102, 0.16);
  border-radius: 18px;
  background: #f8fbfd;
  overflow: hidden;
}

.email-editor__topbar,
.email-editor__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(240,247,251,0.98));
}

.email-editor__subject {
  padding: 14px;
  border-bottom: 1px solid rgba(66, 84, 102, 0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(244,249,252,0.98));
}

.email-editor__subject input {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(66, 84, 102, 0.16);
  background: #ffffff;
  color: #17324d;
}

.email-editor__topbar {
  border-bottom: 0;
  flex-wrap: wrap;
}

.email-editor__toolbar {
  border-bottom: 1px solid rgba(66, 84, 102, 0.08);
  flex-wrap: wrap;
  justify-content: flex-start;
}

.email-editor__modes,
.email-editor__placeholders,
.email-editor__actions,
.email-editor__locales {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.email-editor__modes .ghost.active {
  background: #4ba5d6;
  color: #ffffff;
  border-color: #4ba5d6;
}

.email-editor__actions {
  margin-left: auto;
}

.email-editor__locales .ghost.active {
  background: #17324d;
  color: #ffffff;
  border-color: #17324d;
}

.email-editor__toolbar .ghost,
.email-editor__modes .ghost {
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 12px;
}

.email-editor__icon-btn {
  width: 40px;
  min-width: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.email-editor__icon-btn svg {
  width: 18px;
  height: 18px;
}

.email-editor__select {
  min-height: 36px;
  min-width: 240px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(66, 84, 102, 0.16);
  background: #ffffff;
  color: #17324d;
}

.email-editor__surface,
.email-editor__source,
.email-editor__preview {
  width: 100%;
  min-height: 320px;
  padding: 18px;
  background: #ffffff;
}

.email-editor__surface {
  outline: none;
  line-height: 1.6;
}

.email-editor__surface:empty::before {
  content: attr(data-placeholder);
  color: #8b9aab;
}

.email-editor__source {
  border: 0;
  resize: vertical;
  font: 0.95rem/1.6 Consolas, "Courier New", monospace;
}

.email-editor__preview {
  border-top: 0;
}

.email-editor__preview a,
.email-editor__surface a {
  color: #0f6fa5;
}

.email-editor__surface h1,
.email-editor__surface h2,
.email-editor__surface h3,
.email-editor__preview h1,
.email-editor__preview h2,
.email-editor__preview h3 {
  margin-top: 0;
  color: #17324d;
}

.email-editor__surface p,
.email-editor__preview p {
  margin: 0 0 14px;
}

.email-editor__surface ul,
.email-editor__surface ol,
.email-editor__preview ul,
.email-editor__preview ol {
  padding-left: 20px;
}

.microsoft-login-btn {
  width: 100%;
  background: #111111;
  color: #ffffff;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #111111;
  box-shadow: 0 16px 40px rgba(17,17,17,0.18);
}

.microsoft-login-btn:hover {
  transform: translateY(-1px);
  background: #0d0d0d;
  border-color: #4ba5d6;
  box-shadow: 0 18px 42px rgba(75,165,214,0.22);
}

.microsoft-login-btn__content {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.microsoft-login-btn__icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.login-hint,
.login-status {
  margin: 0;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #4b6a80;
  font-size: 0.94rem;
}

.login-divider-toggle {
  width: 100%;
  background: transparent;
  padding: 8px 0;
}

.login-divider-toggle:hover {
  transform: none;
  color: #4ba5d6;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(75,165,214,0.32);
}

.login-form,
.password-reset-form {
  display: grid;
  gap: 14px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 600;
  color: var(--muted);
}

.login-field input {
  min-height: 52px;
  background: #f8fafc;
}

.login-field input:focus {
  border-color: #4ba5d6;
  box-shadow: 0 0 0 3px rgba(75,165,214,0.18);
}

.login-local-actions {
  display: grid;
  gap: 10px;
}

.login-submit,
.login-reset-toggle {
  width: 100%;
}

.login-inline-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.login-reset-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: #4ba5d6;
  font-size: 0.94rem;
  text-align: left;
  justify-self: start;
}

.login-reset-link:hover {
  transform: none;
  color: #2d8fc4;
  text-decoration: underline;
}

@keyframes login-wave-rise {
  0% {
    transform: translateY(110%) rotate(0deg);
    border-radius: 40%;
  }
  40% {
    transform: translateY(40%) rotate(4deg);
    border-radius: 46%;
  }
  100% {
    transform: translateY(-24%) rotate(-3deg);
    border-radius: 50%;
  }
}

@media (max-width: 920px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-hero {
    padding: 40px 28px 16px;
  }

  .login-hero h1 {
    max-width: none;
  }

  .login-card {
    padding: 28px;
  }

  .login-language-toggle--top {
    top: 18px;
    right: 18px;
  }
}

@media (max-width: 640px) {
  .login-card-header {
    flex-direction: column;
    align-items: stretch;
  }
}


.kiosk-admin-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 18px;
}
.kiosk-admin-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.kiosk-admin-field__label {
  font-weight: 700;
}
.kiosk-admin-field input,
.kiosk-admin-field select,
.kiosk-admin-field textarea {
  width: 100%;
}
.kiosk-admin-users {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
}
.kiosk-admin-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.kiosk-admin-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
}
.kiosk-admin-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 4px;
}
.kiosk-admin-shell__header {
  margin-bottom: 16px;
}
.kiosk-admin-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.kiosk-admin-sidebar {
  border-right: 1px solid #e3e9f1;
  padding-right: 14px;
}
.kiosk-admin-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.kiosk-admin-nav__section {
  margin-top: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b778c;
}
.kiosk-admin-nav__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 10px 12px;
  text-align: left;
  border: 1px solid #dfe6f2;
  border-radius: 10px;
  background: #fff;
}
.kiosk-admin-nav__item span {
  font-size: 0.85rem;
  color: #6b778c;
}
.kiosk-admin-nav__item.active {
  border-color: var(--primary);
  background: rgba(31,78,121,0.08);
}
.kiosk-admin-nav__empty {
  padding: 8px 4px;
}
.kiosk-admin-main {
  min-width: 0;
}
.kiosk-admin-overview__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.kiosk-admin-card {
  border: 1px solid #e3e9f1;
  border-radius: 12px;
  background: #fff;
  padding: 16px;
}
.kiosk-admin-card h4 {
  margin: 6px 0 6px;
}
.kiosk-admin-card__meta {
  font-size: 0.82rem;
  color: #6b778c;
}
.kiosk-admin-card__actions {
  margin-top: 14px;
}
.kiosk-admin-detail__header {
  margin-bottom: 14px;
}
@media (max-width: 900px) {
  .kiosk-admin-layout {
    grid-template-columns: 1fr;
  }
  .kiosk-admin-sidebar {
    border-right: 0;
    border-bottom: 1px solid #e3e9f1;
    padding-right: 0;
    padding-bottom: 14px;
  }
}


