:root {
  --ink: #0e2228;
  --ink-soft: #254149;
  --muted: #5c757d;
  --green: #087a64;
  --green-hover: #06604e;
  --green-bright: #14cba8;
  --cyan-accent: #09b6d4;
  --green-soft: #e6f7f3;
  --green-border: #b3e6d9;
  --line: #dbe7e5;
  --line-strong: #c2d6d3;
  --bg: #f1f6f5;
  --surface: #ffffff;
  --surface-subtle: #f7fbfa;
  --nav: #0a1f24;
  --nav-mid: #102e35;
  --danger: #b4232c;
  --danger-bg: #fef2f2;
  --danger-border: #f8c9cc;
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 9px;
  --shadow-sm: 0 2px 8px rgba(10, 31, 36, 0.04), 0 1px 2px rgba(10, 31, 36, 0.03);
  --shadow-md: 0 14px 34px -8px rgba(10, 31, 36, 0.09), 0 4px 12px -2px rgba(10, 31, 36, 0.04);
  --shadow-lg: 0 24px 56px -12px rgba(10, 31, 36, 0.16), 0 8px 20px -4px rgba(10, 31, 36, 0.07);
  --focus-ring: 0 0 0 3.5px rgba(8, 122, 100, 0.18);
  --transition: 160ms cubic-bezier(0.2, 0.8, 0.2, 1);
  --sidebar-w: 276px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
  width: 100%;
}

body {
  margin: 0;
  width: 100%;
  overflow-x: hidden;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 15% 0%, rgba(20, 203, 168, 0.09), transparent 38%),
    radial-gradient(circle at 92% 6%, rgba(9, 182, 212, 0.08), transparent 34%),
    linear-gradient(180deg, #f6faf9 0%, #ecf3f2 100%);
  background-attachment: fixed;
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body > * {
  min-width: 0;
}

a {
  color: var(--green);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--transition), opacity var(--transition);
}

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

button,
input,
select,
textarea {
  font: inherit;
}

/* Buttons */
button,
.button {
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 11px 18px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 680;
  cursor: pointer;
  text-decoration: none;
  max-width: 100%;
  transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.btn-sm {
  min-height: 36px;
  padding: 7px 14px;
  font-size: 13px;
  border-radius: 10px;
}

button:active:not(:disabled),
.button:active {
  transform: translateY(1px);
}

button:focus-visible,
.button:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.primary {
  background: linear-gradient(135deg, #0b8a70 0%, var(--green) 100%);
  color: #ffffff;
  border-color: #066350;
  box-shadow: 0 3px 10px rgba(8, 122, 100, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #09755f 0%, var(--green-hover) 100%);
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(8, 122, 100, 0.3);
}

.secondary {
  background: #ffffff;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  box-shadow: 0 1px 2px rgba(10, 31, 36, 0.04);
}

.secondary:hover:not(:disabled) {
  background: var(--surface-subtle);
  border-color: #9ab8b3;
  color: var(--ink);
}

.danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}

.danger:hover:not(:disabled) {
  background: #fde3e5;
  border-color: #f1a7ad;
  color: #941b22;
}

.full {
  width: 100%;
}

/* Sidebar Navigation */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 6%, rgba(20, 203, 168, 0.16), transparent 38%),
    radial-gradient(circle at 85% 14%, rgba(9, 182, 212, 0.12), transparent 36%),
    linear-gradient(180deg, var(--nav) 0%, var(--nav-mid) 58%, #07171b 100%);
  color: #e6f2f0;
  display: flex;
  flex-direction: column;
  padding: 24px 16px 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 10px 0 36px rgba(6, 20, 24, 0.18);
  z-index: 20;
}

.sidebar .brand {
  flex-shrink: 0;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 4px 10px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-decoration: none;
}

.brand img {
  width: 186px;
  max-width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.28));
}

.brand > small {
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: 0.28em;
  color: #8fd9ca;
  margin-top: 2px;
  padding-left: 2px;
}

.mobile-menu {
  display: none;
}

.sidebar nav {
  display: block;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 0;
  padding: 6px 4px 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.nav-group {
  margin: 14px 0 18px;
}

.nav-group + .nav-group {
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-label {
  display: block;
  color: #7fa7a4;
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0 12px 7px;
}

.sidebar nav a {
  position: relative;
  display: block;
  color: #c2d8d6;
  padding: 9.5px 13px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 560;
  margin-bottom: 3px;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}

.sidebar nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  text-decoration: none;
  transform: translateX(2px);
}

.sidebar nav a.active {
  background: linear-gradient(90deg, rgba(20, 203, 168, 0.22) 0%, rgba(9, 182, 212, 0.09) 100%);
  color: #ffffff;
  font-weight: 680;
  box-shadow: inset 0 0 0 1px rgba(20, 203, 168, 0.3);
}

.sidebar nav a.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  bottom: 7px;
  width: 3.5px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, var(--green-bright), var(--cyan-accent));
  box-shadow: 0 0 10px rgba(20, 203, 168, 0.7);
}

.sidebar .sidebar-bottom {
  margin-top: 4px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 11px 12px;
  min-height: 58px;
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  font-weight: 650;
  color: #ffffff;
}

.sidebar-bottom .user-meta,
.sidebar-bottom > div:nth-child(2) {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.sidebar-bottom .user-name {
  display: block;
  font-size: 13px;
  font-weight: 720;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-bottom small {
  color: #93b5b2;
  font-size: 11.5px;
  font-weight: 500;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.avatar {
  background: linear-gradient(135deg, #6df0cf 0%, #19b8d6 100%);
  color: #08282c;
  border-radius: 10px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-weight: 800;
  font-size: 14px;
  text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
}

.icon-button {
  padding: 6px 10px;
  min-height: 34px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #d6ece9;
  flex-shrink: 0;
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

/* Main Layout & Header - Full Width Responsive, Zero Horizontal Scroll */
main {
  margin-left: var(--sidebar-w);
  width: calc(100% - var(--sidebar-w));
  max-width: none;
  padding: 32px clamp(24px, 2.8vw, 48px) 48px;
  min-width: 0;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

h1 {
  font-size: clamp(24px, 2.1vw, 32px);
  font-weight: 820;
  letter-spacing: -0.025em;
  line-height: 1.18;
  margin: 5px 0 0;
  color: var(--ink);
}

h2 {
  font-size: 19.5px;
  font-weight: 760;
  line-height: 1.3;
  letter-spacing: -0.015em;
  margin: 0 0 14px;
  color: var(--ink);
}

h3 {
  margin: 12px 0 6px;
  font-size: 16.5px;
  font-weight: 720;
}

p {
  margin: 10px 0 16px;
}

p:last-child {
  margin-bottom: 0;
}

small {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
}

.eyebrow {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
}

.live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  background: #ffffff;
  color: #0d5c4c;
  border: 1px solid var(--green-border);
  border-radius: 999px;
  padding: 8px 15px;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}

.live i {
  display: inline-block;
  background: #10b981;
  border-radius: 50%;
  width: 8px;
  height: 8px;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22);
}

/* Hero Banner */
.hero {
  position: relative;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 88% 18%, rgba(20, 203, 168, 0.34), transparent 36%),
    radial-gradient(circle at 68% 90%, rgba(9, 182, 212, 0.22), transparent 40%),
    linear-gradient(125deg, #0a2228 0%, #0e423d 52%, #0a6e5b 100%);
  color: #ffffff;
  padding: 30px 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.hero-copy {
  min-width: 0;
  flex: 1;
}

.hero .eyebrow {
  color: #84f2d8;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 4px 11px;
  border-radius: 999px;
}

.hero h2 {
  color: #ffffff;
  font-size: clamp(23px, 2.3vw, 32px);
  font-weight: 820;
  letter-spacing: -0.02em;
  margin: 12px 0 8px;
}

.hero p {
  color: #d3ece8;
  margin: 0;
  max-width: 780px;
  font-size: 15px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-btn-primary {
  background: #ffffff;
  color: #09352f;
  border-color: #ffffff;
  min-height: 40px;
  padding: 8px 16px;
  font-size: 13.5px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.hero-btn-primary:hover {
  background: #e6faf5;
  color: #062622;
}

.hero-btn-secondary {
  background: rgba(255, 255, 255, 0.11);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.24);
  min-height: 40px;
  padding: 8px 16px;
  font-size: 13.5px;
}

.hero-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.hero-symbol {
  width: 76px;
  height: 76px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  display: grid;
  place-items: center;
  font-size: 34px;
  line-height: 1;
  margin-left: 16px;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
}

/* Dashboard Stats & Cards */
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  min-width: 0;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
}

.stats .card {
  margin: 0;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdfc 100%);
}

.stats .card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3.5px;
  background: linear-gradient(90deg, var(--green) 0%, var(--green-bright) 55%, var(--cyan-accent) 100%);
}

.stats .card:hover,
.item-grid .card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stat-tag {
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  color: var(--green);
  background: var(--green-soft);
  border: 1px solid var(--green-border);
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.stats span {
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 680;
}

.stats strong {
  display: block;
  font-size: clamp(32px, 2.8vw, 42px);
  font-weight: 820;
  letter-spacing: -0.03em;
  margin: 10px 0 6px;
  line-height: 1.08;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 22px;
  align-items: stretch;
}

.two-column > .card {
  margin-bottom: 0;
}

.section-head,
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.section-head h2 {
  margin: 3px 0 0;
}

.section-head {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.item .section-head {
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.toolbar {
  margin-bottom: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 20px;
  box-shadow: var(--shadow-sm);
}

.toolbar p {
  margin: 0;
  font-weight: 600;
}

.muted {
  color: var(--muted);
}

/* System Status Grid on Dashboard */
.status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 18px;
}

.status-box {
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  min-width: 0;
}

.status-box.wide {
  grid-column: 1 / -1;
}

.status-box dt {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 760;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.status-box dd {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
}

.ai-status-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 6px;
}

.ai-pill-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13.5px;
  font-weight: 680;
}

.ai-status-row small {
  grid-column: 1 / -1;
  margin-top: 4px;
  font-weight: 500;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  background: var(--green-soft);
  color: #086854;
  border: 1px solid var(--green-border);
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 720;
  padding: 4px 11px;
  white-space: nowrap;
}

.badge.neutral {
  color: #52676d;
  background: #eef3f2;
  border-color: #d5e1df;
}

.badge.success {
  color: #06634f;
  background: #dcf7ee;
  border-color: #9ce0c9;
}

/* Alerts & Notices */
.notice,
.hint,
.error {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 18px;
  font-size: 14px;
  line-height: 1.6;
}

.notice:last-child,
.hint:last-child {
  margin-bottom: 0;
}

.notice {
  background: #e7f5f2;
  border: 1px solid #bfe0d8;
  color: #184b40;
}

.hint {
  background: #f3f8f7;
  border: 1px solid var(--line);
  color: #46615d;
  line-height: 1.65;
}

.error,
.errorlist {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger);
}

.errorlist {
  border-radius: 10px;
  padding: 10px 14px 10px 28px;
  font-size: 13px;
  margin: 8px 0 0;
}

.trunk-help p {
  margin: 8px 0;
  line-height: 1.6;
}

.trunk-help .button {
  margin-top: 8px;
}

/* Empty States & Item Grids */
.empty {
  text-align: center;
  padding: 42px 22px;
}

.empty-icon {
  width: 60px;
  height: 60px;
  background: var(--green-soft);
  border: 1px solid var(--green-border);
  color: var(--green);
  display: grid;
  place-items: center;
  font-size: 26px;
  border-radius: 18px;
  margin: 0 auto 16px;
  box-shadow: 0 8px 20px rgba(8, 122, 100, 0.1);
}

.empty p {
  max-width: 460px;
  margin: 10px auto 20px;
  color: var(--muted);
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr));
  gap: 20px;
}

.item-grid .card {
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.item h2 {
  overflow-wrap: anywhere;
  margin-top: 4px;
  margin-bottom: 6px;
}

.edit-link {
  font-size: 13px;
  padding: 5px 11px;
  border-radius: 8px;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
}

.edit-link:hover {
  background: var(--green-soft);
  border-color: var(--green-border);
}

.call-list {
  display: grid;
  gap: 8px;
}

.call-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  color: var(--ink);
  overflow-wrap: anywhere;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.call-row + .call-row {
  margin-top: 8px;
}

.call-list .call-row + .call-row {
  margin-top: 0;
}

a.call-row:hover {
  background: var(--green-soft);
  border-color: var(--green-border);
  transform: translateX(2px);
}

.call-row-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.call-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--green);
  display: grid;
  place-items: center;
  font-weight: 800;
  flex-shrink: 0;
}

dl {
  margin: 0;
}

dt {
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
  margin-top: 16px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

dd {
  margin: 4px 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* Forms & Controls - Structured Field Cards */
label {
  display: block;
  font-weight: 680;
  font-size: 13.5px;
  color: var(--ink-soft);
  margin-bottom: 7px;
}

input:not([type="checkbox"]),
select,
textarea {
  width: 100%;
  padding: 11px 14px;
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--ink);
  min-height: 46px;
  margin-top: 4px;
  max-width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

input:not([type="checkbox"]):hover:not(:disabled),
select:hover:not(:disabled),
textarea:hover:not(:disabled) {
  border-color: #96b5b0;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: var(--focus-ring);
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
  vertical-align: middle;
  margin: 7px 8px 7px 0;
  cursor: pointer;
}

.field > div {
  max-height: 240px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
}

.field > div label {
  font-weight: 500;
}

.field small {
  margin-top: 7px;
  line-height: 1.45;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr));
  gap: 16px 18px;
  align-items: stretch;
}

.field {
  min-width: 0;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.field > label {
  margin: 0 0 8px;
  line-height: 1.45;
}

.field.wide {
  grid-column: 1 / -1;
}

.field.control > input,
.field.control > select {
  height: 46px;
  min-height: 46px;
  margin: 0;
}

select:not([multiple]) {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  padding: 11px 42px 11px 14px;
  line-height: 24px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23566e68' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-position: right 14px center;
  background-repeat: no-repeat;
  background-size: 16px;
}

select[multiple] {
  min-height: 140px;
}

.field textarea {
  margin: 0;
  min-height: 110px;
}

.form-grid .field.toggle {
  justify-content: center;
  padding: 14px 16px;
}

.field .toggle-row {
  min-height: 46px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.field .toggle-row:hover {
  border-color: var(--green-border);
  background: var(--green-soft);
}

.toggle-row input[type="checkbox"] {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  margin: 0;
}

.toggle-row span {
  line-height: 22px;
  font-weight: 650;
  color: var(--ink);
}

.field.choices > div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 235px), 1fr));
  gap: 8px;
  max-height: 280px;
  padding: 10px;
  background: #ffffff;
}

.field.choices > div > div {
  min-width: 0;
}

.field.choices > div label {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  margin: 0;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  overflow-wrap: anywhere;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.field.choices > div label:hover {
  border-color: var(--green-border);
  background: var(--green-soft);
}

.field.choices input[type="checkbox"] {
  flex-shrink: 0;
  margin: 0;
}

.choice-empty {
  margin: 0;
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: #ffffff;
  font-size: 13px;
  color: var(--muted);
  min-height: 56px;
}

.field.choices .choice-empty {
  min-height: 84px;
}

.required {
  color: var(--green);
  font-weight: 800;
}

.form-card {
  max-width: none;
  padding: clamp(22px, 2.4vw, 34px);
}

.form-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  margin-bottom: 24px;
  background: #edf3f2;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.form-tabs[hidden],
.form-section[hidden] {
  display: none !important;
}

.form-tab {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid transparent;
  min-height: 42px;
  font-size: 13.5px;
  font-weight: 680;
  padding: 9px 16px;
  border-radius: 10px;
}

.form-tab:hover {
  background: rgba(255, 255, 255, 0.65);
  color: var(--ink);
}

.form-tab.selected {
  background: var(--green);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(8, 122, 100, 0.24);
}

.form-tab:focus-visible {
  outline: 3px solid #99cbbb;
  outline-offset: 2px;
}

.form-section {
  border: 0;
  padding: 0;
  margin: 0 0 28px;
  min-width: 0;
}

.form-section + .form-section {
  border-top: 1px solid var(--line);
  padding-top: 26px;
}

.form-tabs:not([hidden]) ~ .form-section {
  border: 0;
  padding-top: 0;
  margin-bottom: 0;
}

.form-section legend {
  float: left;
  width: 100%;
  font-size: 19px;
  font-weight: 760;
  line-height: 1.4;
  margin-bottom: 8px;
  padding: 0;
  color: var(--ink);
}

.form-section legend + .form-grid,
.form-section legend + .section-description {
  clear: both;
}

.section-description {
  font-size: 13.5px;
  color: var(--muted);
  margin: 0 0 18px;
  max-width: 960px;
}

.form-section .form-grid {
  padding-top: 6px;
}

.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 26px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.form-actions > * {
  min-width: 140px;
}

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

.actions form {
  margin: 0;
}

/* Auth / Login View */
.auth-main {
  margin: 0;
  width: 100%;
  max-width: none;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 28px 18px;
  background:
    radial-gradient(circle at 18% 18%, rgba(20, 203, 168, 0.22), transparent 40%),
    radial-gradient(circle at 82% 80%, rgba(9, 182, 212, 0.18), transparent 42%),
    linear-gradient(145deg, #07191e 0%, #0d2b32 52%, #091f24 100%);
}

.auth-main header {
  display: none;
}

.auth-main footer {
  color: rgba(210, 232, 229, 0.65);
}

.auth-card {
  width: min(100%, 456px);
  background: #ffffff;
  padding: 42px 38px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 26px;
  box-shadow: 0 28px 72px rgba(4, 14, 17, 0.45), 0 4px 16px rgba(0, 0, 0, 0.14);
}

.login-logo {
  width: 224px;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto 24px;
}

.auth-card h2,
.auth-card > p {
  text-align: center;
}

.auth-card h2 {
  font-size: 28px;
  margin-top: 8px;
  margin-bottom: 8px;
}

.auth-card form {
  display: grid;
  gap: 14px;
  margin: 24px 0;
}

.mark {
  font-size: 35px;
  color: var(--green);
  font-weight: 800;
}

.narrow {
  max-width: 760px;
}

/* Secrets, Codes, Tables & Setup */
.secret {
  display: block;
  padding: 14px 16px;
  background: #eef6f4;
  border: 1px dashed #8cb5ab;
  border-radius: 10px;
  overflow-wrap: anywhere;
  letter-spacing: 0.05em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 15px;
  font-weight: 700;
  margin: 10px 0;
}

.card code {
  overflow-wrap: anywhere;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: #eff5f4;
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 0.92em;
}

.codes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0;
}

.codes code {
  padding: 10px;
  background: #eff5f4;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-wrap: anywhere;
  text-align: center;
  font-weight: 700;
}

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) minmax(150px, 1fr) minmax(150px, 1fr) auto auto;
  gap: 15px;
  align-items: end;
}

.filters label {
  margin: 0;
}

.filters button {
  margin-bottom: 0;
  height: 46px;
}

.table-scroll {
  overflow-x: auto;
  max-width: 100%;
  border-radius: 12px;
}

table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: 13.5px;
}

th {
  text-align: left;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  background: var(--surface-subtle);
  border-top: 1px solid var(--line);
}

th:first-child {
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
  padding-left: 16px;
}

th:last-child {
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
  padding-right: 16px;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
  vertical-align: middle;
}

td:first-child {
  min-width: 125px;
  padding-left: 16px;
}

td:last-child {
  padding-right: 16px;
}

tbody tr {
  transition: background var(--transition);
}

tbody tr:hover td {
  background: #f5faf8;
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.pagination a {
  margin-left: 15px;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.details-grid > div {
  padding: 15px 16px;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.details-grid strong {
  display: block;
  overflow-wrap: anywhere;
  margin-top: 5px;
}

.settings-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 14px;
  margin-top: 18px;
}

.settings-summary > div {
  padding: 16px;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: 12px;
  min-width: 0;
}

.settings-summary dt {
  margin: 0;
}

.settings-summary dd {
  font-size: 16px;
  font-weight: 680;
  line-height: 1.45;
  margin-top: 4px;
}

.setup-steps {
  padding-left: 24px;
}

.setup-steps li {
  margin: 0 0 18px;
  padding-left: 5px;
}

.setup-steps strong {
  display: block;
  margin-bottom: 5px;
}

.setup-address {
  display: inline-block;
  font-size: clamp(20px, 2vw, 28px);
  font-weight: 800;
  color: var(--green);
  background: var(--green-soft);
  border: 1px solid var(--green-border);
  padding: 10px 18px;
  border-radius: 14px;
  overflow-wrap: anywhere;
  letter-spacing: 0;
}

audio {
  width: 100%;
  margin: 10px 0;
}

footer {
  font-size: 12px;
  color: #7c928e;
  margin-top: 40px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.auth-main footer {
  border-top: none;
  margin-top: 22px;
  padding-top: 0;
}

/* Responsive Breakpoints */
@media (max-width: 1180px) {
  :root {
    --sidebar-w: 240px;
  }
  .sidebar {
    padding: 20px 14px;
  }
  main {
    padding: 26px 22px 40px;
  }
  .two-column {
    grid-template-columns: 1fr;
  }
  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .filters label:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .form-grid,
  .status-grid,
  .ai-status-row {
    grid-template-columns: 1fr;
  }
  .field.wide,
  .status-box.wide {
    grid-column: auto;
  }
  .form-card {
    padding: 20px;
  }
  .form-actions > * {
    flex: 1;
  }
}

@media (max-width: 760px) {
  .sidebar {
    position: sticky;
    top: 0;
    width: 100%;
    height: auto;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0;
    padding: 14px 18px;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  .sidebar .brand {
    padding: 0;
    gap: 3px;
    border-bottom: none;
  }
  .brand img {
    width: 142px;
  }
  .brand > small {
    font-size: 8px;
  }
  .mobile-menu {
    display: inline-flex;
    align-self: center;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
    min-height: 40px;
    padding: 8px 14px;
  }
  .mobile-menu:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
  }
  .sidebar nav {
    display: none;
    grid-column: 1 / -1;
    max-height: 62dvh;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }
  .sidebar.menu-open nav {
    display: block;
  }
  .sidebar .sidebar-bottom {
    display: none;
  }
  .sidebar.menu-open .sidebar-bottom {
    display: flex;
    grid-column: 1 / -1;
    margin-top: 8px;
  }
  main {
    margin: 0;
    width: 100%;
    padding: 20px 16px 36px;
  }
  header {
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 14px;
  }
  h1 {
    font-size: 24px;
  }
  .live {
    font-size: 0;
    padding: 10px;
    gap: 0;
  }
  .live i {
    margin: 0;
  }
  .hero {
    padding: 22px 20px;
  }
  .hero-symbol {
    display: none;
  }
  .stats {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .card {
    padding: 20px 18px;
  }
  .auth-card {
    padding: 30px 24px;
  }
  .filters {
    grid-template-columns: 1fr;
  }
  .filters label:first-child {
    grid-column: auto;
  }
  .codes {
    grid-template-columns: 1fr;
  }
  .form-tabs {
    gap: 6px;
  }
  .form-tab {
    flex: 1 1 130px;
    padding: 9px;
    font-size: 12.5px;
  }
  .form-actions .button,
  .form-actions button {
    width: 100%;
  }
  .details-grid {
    grid-template-columns: 1fr;
  }
  .section-head a {
    font-size: 12.5px;
  }
  .qr-provision-grid {
    grid-template-columns: 1fr;
    justify-items: center;
  }
}

.qr-provision-card {
  border-color: var(--green-border);
  background: linear-gradient(180deg, #ffffff 0%, #f5fbf9 100%);
}

.qr-provision-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 26px;
  align-items: center;
  margin-top: 8px;
}

.qr-secret-block {
  margin-bottom: 24px;
  padding: 20px;
  border-radius: 14px;
  border: 1px solid var(--green-border);
  background: #f5fbf9;
}

.qr-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(13, 31, 28, 0.06);
}

.qr-box svg {
  display: block;
  width: 210px;
  height: 210px;
}

.qr-instructions {
  min-width: 0;
}

.qr-steps {
  margin-top: 14px;
  margin-bottom: 0;
}
