@font-face {
  font-family: "Cairo";
  src: url("assets/fonts/HacenTunisia.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

.loading-panel,
.error-panel {
  min-height: 180px;
  display: grid;
  align-content: center;
  gap: 12px;
}

.error-panel h3 {
  margin: 0;
  color: var(--danger);
}

.error-panel p {
  margin: 0;
  color: var(--muted);
}

@font-face {
  font-family: "Hacen Tunisia";
  src: url("assets/fonts/HacenTunisia.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #edf3f8;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-strong: #ffffff;
  --text: #132033;
  --muted: #66758a;
  --line: rgba(73, 92, 117, 0.18);
  --brand: #0e8f8a;
  --brand-2: #2347ff;
  --accent: #f2c56e;
  --danger: #cf3d47;
  --success: #1a9f6b;
  --shadow: 0 24px 70px rgba(32, 48, 72, 0.13);
  --neon: 0 0 0 rgba(35, 71, 255, 0);
  --card-ray: rgba(14, 143, 138, 0.36);
  --card-ray-soft: rgba(35, 71, 255, 0.18);
  font-family: "Cairo", "Tahoma", "Arial", sans-serif;
}

[data-mode="dark"] {
  --bg: #12171d;
  --panel: rgba(35, 42, 53, 0.78);
  --panel-strong: #1d242e;
  --text: #f4f7fb;
  --muted: #aeb9c7;
  --line: rgba(255, 255, 255, 0.1);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  --card-ray: rgba(0, 224, 202, 0.48);
  --card-ray-soft: rgba(0, 167, 255, 0.22);
}

[data-theme="neon"] {
  --bg: #071923;
  --brand: #00e0ca;
  --brand-2: #00a7ff;
  --accent: #9effe8;
  --neon: 0 0 0 rgba(0, 224, 202, 0);
  --card-ray: rgba(0, 224, 202, 0.5);
  --card-ray-soft: rgba(158, 255, 232, 0.2);
}

[data-theme="classic"] {
  --bg: #f4f6f8;
  --brand: #1b7f79;
  --brand-2: #334155;
  --accent: #c5a25d;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background:
    radial-gradient(circle at 18% 8%, rgba(35, 71, 255, 0.16), transparent 28%),
    radial-gradient(circle at 88% 0%, rgba(242, 197, 110, 0.24), transparent 30%),
    var(--bg);
  color: var(--text);
  margin: 0;
  min-height: 100vh;
}

[hidden] { display: none !important; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.login-view {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card,
.view-card,
.stat-card,
.sidebar,
.topbar,
.hero,
.data-panel {
  backdrop-filter: blur(18px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.login-card {
  display: grid;
  gap: 18px;
  max-width: 460px;
  padding: 28px;
  width: 100%;
}

.brand-row,
.brand {
  align-items: center;
  display: flex;
  gap: 12px;
}

.brand-row img,
.brand img {
  background: #fff;
  border-radius: 12px;
  height: 46px;
  object-fit: contain;
  padding: 5px;
  width: 46px;
}

.brand-row strong,
.brand strong {
  display: block;
  font-size: 20px;
}

.brand-row span,
.brand span,
.login-card p,
.hero span,
.view-toolbar small {
  color: var(--muted);
}

label {
  display: grid;
  gap: 8px;
}

label span {
  color: var(--muted);
  font-weight: 700;
}

input,
select,
textarea {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  min-height: 44px;
  outline: none;
  padding: 0 14px;
  width: 100%;
}

input[type="file"] {
  align-items: center;
  cursor: pointer;
  display: flex;
  padding: 9px 12px;
}

textarea {
  min-height: 92px;
  padding: 12px 14px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(14, 143, 138, 0.12);
}

.btn,
.chip,
.icon-btn,
.menu button,
.theme-switcher button,
.tabs button {
  border: 0;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, color 180ms ease;
}

.btn,
.chip {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  min-height: 42px;
  padding: 0 14px;
}

.btn.primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
}

.btn.ghost {
  background: transparent;
}

.form-error {
  background: rgba(207, 61, 71, 0.12);
  border: 1px solid rgba(207, 61, 71, 0.24);
  border-radius: 12px;
  color: var(--danger);
  padding: 10px 12px;
}

.app-shell {
  display: grid;
  gap: 18px;
  grid-template-columns: 290px minmax(0, 1fr);
  min-height: 100vh;
  padding: 18px;
}

.sidebar {
  height: calc(100vh - 36px);
  overflow: auto;
  padding: 18px;
  position: sticky;
  top: 18px;
}

.menu {
  display: grid;
  gap: 8px;
  margin-top: 26px;
}

.menu button {
  align-items: center;
  background: transparent;
  border-radius: 12px;
  color: var(--text);
  display: flex;
  gap: 10px;
  justify-content: flex-start;
  min-height: 42px;
  padding: 0 12px;
  text-align: right;
}

.menu-icon,
.menu-chevron {
  fill: none;
  flex: 0 0 auto;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.menu-icon {
  height: 21px;
  opacity: 0.9;
  stroke-width: 1.9;
  width: 21px;
}

.sub-icon {
  height: 18px;
  opacity: 0.74;
  stroke-width: 1.85;
  width: 18px;
}

.menu-chevron {
  height: 18px;
  margin-inline-start: auto;
  opacity: 0.72;
  stroke-width: 2;
  width: 18px;
}

.menu button span {
  min-width: 0;
}

.menu button:hover,
.menu button.active {
  background: rgba(14, 143, 138, 0.13);
  transform: translateY(-1px);
}

.submenu {
  border-inline-start: 1px solid color-mix(in srgb, var(--brand) 26%, transparent);
  display: grid;
  gap: 4px;
  margin-inline-start: 14px;
  max-height: 0;
  overflow: hidden;
  padding-inline-start: 24px;
  transition: max-height 260ms ease;
}
.submenu.open { max-height: 280px; }
.submenu button {
  color: var(--muted);
  min-height: 36px;
  padding-inline-start: 18px;
}

.submenu button:hover,
.submenu button.active {
  color: var(--text);
}

.workspace {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.topbar {
  align-items: center;
  display: flex;
  gap: 12px;
  padding: 12px;
}

.icon-btn {
  align-items: center;
  background: var(--panel-strong);
  border-radius: 12px;
  color: var(--text);
  display: inline-flex;
  height: 42px;
  justify-content: center;
  position: relative;
  width: 42px;
}

.notification-btn {
  background: color-mix(in srgb, var(--panel-strong) 88%, var(--brand) 12%);
  overflow: visible;
}

.notification-icon {
  fill: none;
  height: 21px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
  width: 21px;
}

.notification-badge {
  align-items: center;
  background: linear-gradient(135deg, #ffbf47, #ff5f57);
  border: 2px solid var(--panel);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 11px;
  font-weight: 900;
  height: 20px;
  inset-block-start: -6px;
  inset-inline-end: -6px;
  justify-content: center;
  line-height: 1;
  min-width: 20px;
  padding: 0 5px;
  position: absolute;
  box-shadow: 0 10px 22px rgba(255, 95, 87, 0.22);
}

.notification-badge[hidden] {
  display: none;
}

.search {
  align-items: center;
  display: flex;
  flex: 1;
  gap: 8px;
}

.top-actions,
.theme-switcher,
.tabs,
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero {
  align-items: center;
  display: flex;
  justify-content: space-between;
  padding: 22px;
}

.hero p {
  color: var(--brand);
  font-weight: 800;
  margin: 0 0 8px;
}

.hero h1 {
  font-size: clamp(24px, 3vw, 38px);
  margin: 0 0 8px;
}

.theme-switcher button,
.tabs button {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  min-height: 36px;
  padding: 0 14px;
}

.tabs button.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
}

.tabs:empty {
  display: none;
}

.stats-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card {
  padding: 18px;
}

.stat-card:hover,
.data-panel:hover {
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.stat-card,
.data-panel {
  overflow: hidden;
  position: relative;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.stat-card::before,
.data-panel::before,
.metric-card::before,
.workflow-list button::before {
  background:
    radial-gradient(ellipse at 50% 100%, var(--card-ray) 0%, var(--card-ray-soft) 34%, transparent 72%),
    linear-gradient(90deg, transparent 0%, var(--card-ray-soft) 18%, var(--card-ray) 50%, var(--card-ray-soft) 82%, transparent 100%);
  border-radius: 999px 999px 0 0;
  bottom: -18px;
  content: "";
  height: 34px;
  left: 12%;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  right: 12%;
  transform: scaleX(0.42);
  transform-origin: 50% 100%;
  transition: opacity 180ms ease, transform 220ms ease;
  z-index: 0;
}

.stat-card:hover::before,
.data-panel:hover::before,
.metric-card:hover::before,
.workflow-list button:hover::before {
  opacity: 1;
  transform: scaleX(1);
}

.stat-card > *,
.data-panel > *,
.metric-card > *,
.workflow-list button > * {
  position: relative;
  z-index: 1;
}

.stat-card span {
  color: var(--muted);
  display: block;
}

.stat-card strong {
  display: block;
  font-size: 30px;
  margin-top: 10px;
}

.stat-card small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  line-height: 1.5;
  margin-top: 8px;
}

.context-card strong {
  font-size: 26px;
  overflow-wrap: anywhere;
}

.view-card {
  padding: 18px;
}

.view-toolbar {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin: 16px 0;
}

.content-grid {
  display: grid;
  gap: 14px;
}

.dashboard-grid { display: grid; gap: 16px; }
.metrics-strip { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric-card {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
  min-height: 132px;
  overflow: hidden;
  padding: 18px;
  position: relative;
}
.metric-card::after {
  border-radius: 999px;
  content: "";
  height: 86px;
  inset-inline-end: -28px;
  opacity: 0.16;
  position: absolute;
  top: -22px;
  width: 86px;
}
.metric-card.brand::after { background: var(--brand); }
.metric-card.blue::after { background: var(--brand-2); }
.metric-card.gold::after { background: var(--accent); }
.metric-card.danger::after { background: var(--danger); }
.metric-card span,
.metric-card small { color: var(--muted); }
.metric-card strong { font-size: 34px; line-height: 1; }

.chart-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr); }
.chart-panel,
.workflow-panel { padding: 18px; }
.panel-head { align-items: center; display: flex; justify-content: space-between; margin-bottom: 16px; }
.panel-head h3 { margin: 0; }
.panel-head span { color: var(--muted); font-size: 13px; }
.chart-bars { align-items: end; display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); min-height: 250px; }
.chart-bar-item { align-items: center; display: grid; gap: 8px; justify-items: center; }
.chart-bar-track {
  align-items: end;
  background: rgba(14, 143, 138, 0.08);
  border: 1px solid var(--line);
  border-radius: 999px;
  display: flex;
  height: 180px;
  overflow: hidden;
  padding: 6px;
  width: 42px;
}
.chart-bar-track i {
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
  border-radius: 999px;
  display: block;
  width: 100%;
}
.chart-bar-item span { color: var(--muted); font-size: 13px; }
.chart-bar-item b { font-size: 20px; }
.donut-wrap { align-items: center; display: flex; gap: 18px; }
.donut {
  --value: 0;
  align-items: center;
  background: conic-gradient(var(--brand) calc(var(--value) * 1%), rgba(14, 143, 138, 0.12) 0);
  border-radius: 50%;
  display: flex;
  height: 142px;
  justify-content: center;
  position: relative;
  width: 142px;
}
.donut::after {
  background: var(--panel-strong);
  border-radius: 50%;
  content: "";
  inset: 14px;
  position: absolute;
}
.donut strong { font-size: 24px; position: relative; z-index: 1; }
.mini-list,
.workflow-list { display: grid; gap: 10px; margin-top: 18px; }
.mini-list div,
.workflow-list button {
  align-items: center;
  background: rgba(14, 143, 138, 0.07);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 14px;
}
.workflow-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.workflow-list button {
  cursor: pointer;
  font-family: inherit;
  gap: 10px;
  overflow: hidden;
  position: relative;
  text-align: right;
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.workflow-list button:hover { transform: translateY(-2px); }
.workflow-list strong { font-size: 26px; }
.workflow-list span { color: var(--muted); }
.section-summary {
  align-items: center;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px;
}
.section-summary div,
.section-summary span {
  align-items: center;
  background: rgba(14, 143, 138, 0.07);
  border-radius: 12px;
  display: inline-flex;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
}
.section-summary strong,
.section-summary b { color: var(--brand); font-size: 18px; }
.section-summary small { color: var(--muted); }

.section-actions {
  display: flex;
  justify-content: flex-start;
}

.inline-form,
.settings-form,
.intro-panel {
  padding: 18px;
}

.inline-form h3,
.intro-panel h3 {
  margin: 0 0 14px;
}

.form-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 14px;
}

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

.inline-form .btn {
  margin-inline-end: 8px;
}

.data-panel {
  overflow: hidden;
}

table {
  border-collapse: collapse;
  min-width: 850px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 12px;
  text-align: right;
  vertical-align: top;
  white-space: nowrap;
}

td small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-block-start: 5px;
}

.wrap-cell {
  line-height: 1.9;
  max-width: 420px;
  white-space: normal;
}

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

.diagnostics-card {
  padding: 18px;
}

.diagnostics-card.wide {
  grid-column: 1 / -1;
}

.diagnostics-card h3 {
  margin: 0 0 14px;
}

.diagnostic-row {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 44px;
}

.diagnostic-row:last-child {
  border-bottom: 0;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 260px;
}

.table-action {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  min-height: 32px;
  padding: 0 10px;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.table-action:hover {
  transform: translateY(-1px);
}

.table-action.success {
  border-color: rgba(26, 159, 107, 0.35);
  color: var(--success);
}

.table-action.danger {
  border-color: rgba(207, 61, 71, 0.35);
  color: var(--danger);
}

.slider-manager {
  padding: 16px;
}

.slider-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.slider-tabs button {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  cursor: pointer;
  flex: 0 0 auto;
  font-family: inherit;
  font-weight: 900;
  min-height: 38px;
  padding: 0 14px;
}

.slider-tabs button.active {
  background: rgba(14, 143, 138, 0.14);
  color: var(--text);
}

.slider-manager-head {
  align-items: center;
  border-block: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin: 4px 0 14px;
  padding: 14px 0;
}

.slider-manager-head small {
  color: var(--muted);
  display: block;
  margin-top: 4px;
}

.slider-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.slider-head-actions .btn {
  margin: 0;
}

.slider-upload-btn {
  align-items: center;
  background: rgba(14, 143, 138, 0.12);
  border-color: rgba(14, 143, 138, 0.28);
  color: var(--brand);
  cursor: pointer;
  display: inline-flex;
  font-weight: 900;
  justify-content: center;
}

.slider-upload-btn:hover {
  background: rgba(14, 143, 138, 0.18);
  box-shadow: 0 12px 24px rgba(14, 143, 138, 0.12);
  transform: translateY(-1px);
}

.slider-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 2px 12px;
  scroll-snap-type: x proximity;
}

.slider-card {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 14px;
  flex: 0 0 260px;
  padding: 12px;
  scroll-snap-align: start;
}

.slider-card-image {
  align-items: center;
  aspect-ratio: 16 / 9;
  background: rgba(14, 143, 138, 0.08);
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
  overflow: hidden;
}

.slider-preview,
.slider-preview img {
  height: 100%;
  width: 100%;
}

.slider-preview img {
  display: block;
  object-fit: cover;
}

.slider-card label {
  display: grid;
  gap: 6px;
}

.slider-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.empty-inline {
  align-items: center;
  color: var(--muted);
  display: flex;
  min-height: 120px;
  padding: 0 12px;
}

.image-thumb-btn {
  background: transparent;
  border: 0;
  cursor: zoom-in;
  display: inline-flex;
  padding: 0;
}

.image-strip {
  align-items: center;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 132px;
}

.field-preview {
  display: inline-flex;
  margin-block-start: 8px;
}

.table-thumb {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: block;
  height: 44px;
  object-fit: cover;
  width: 60px;
}

.image-thumb-btn:hover .table-thumb {
  border-color: rgba(14, 143, 138, 0.5);
  box-shadow: 0 8px 22px rgba(14, 143, 138, 0.16);
}

.avatar-field {
  gap: 10px;
}

.avatar-preview {
  align-items: center;
  background: var(--panel-strong);
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  cursor: zoom-in;
  display: inline-flex;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  height: 62px;
  justify-content: center;
  overflow: hidden;
  padding: 0;
  width: 86px;
}

.avatar-preview.has-image {
  border-style: solid;
}

.avatar-preview img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.image-modal {
  align-items: center;
  backdrop-filter: blur(12px);
  background: rgba(10, 22, 37, 0.55);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 28px;
  position: fixed;
  z-index: 2000;
}

.image-modal-frame {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 22px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
  max-height: min(82vh, 820px);
  max-width: min(88vw, 980px);
  overflow: hidden;
  padding: 10px;
}

body[data-mode="dark"] .image-modal-frame {
  background: rgba(21, 31, 45, 0.94);
  border-color: rgba(255, 255, 255, 0.12);
}

.image-modal-frame img {
  border-radius: 16px;
  display: block;
  max-height: calc(82vh - 20px);
  max-width: calc(88vw - 20px);
  object-fit: contain;
}

.image-modal-close {
  align-items: center;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 999px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.2);
  color: #10233f;
  cursor: pointer;
  display: inline-flex;
  font-size: 28px;
  font-weight: 500;
  height: 44px;
  inset-block-start: 24px;
  inset-inline-end: 24px;
  justify-content: center;
  line-height: 1;
  position: fixed;
  width: 44px;
}

body.modal-open {
  overflow: hidden;
}

th {
  color: var(--muted);
  font-size: 13px;
}

.table-wrap {
  overflow-x: auto;
}

.badge {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 10px;
}

.pending, .pending_review, .pending_owner_review { background: rgba(242, 197, 110, 0.2); color: #9a6a09; }
.approved, .active, .approved_for_customer { background: rgba(26, 159, 107, 0.16); color: var(--success); }
.rejected, .suspended { background: rgba(207, 61, 71, 0.14); color: var(--danger); }
.draft, .new, .open { background: rgba(35, 71, 255, 0.12); color: var(--brand-2); }

.form-message {
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 800;
  grid-column: 1 / -1;
  margin-bottom: 12px;
  padding: 11px 13px;
}

.form-message.info {
  background: rgba(35, 71, 255, 0.08);
  color: var(--brand-2);
}

.form-message.success {
  background: rgba(26, 159, 107, 0.12);
  color: var(--success);
}

.form-message.error {
  background: rgba(207, 61, 71, 0.12);
  color: var(--danger);
}

.toast {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  inset-block-start: 22px;
  inset-inline-start: 22px;
  max-width: min(420px, calc(100vw - 44px));
  opacity: 0;
  padding: 14px 18px;
  position: fixed;
  transform: translateY(-10px);
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 1000;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.success {
  border-color: rgba(26, 159, 107, 0.35);
}

.toast.error {
  border-color: rgba(207, 61, 71, 0.35);
}

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

.toggle-row {
  align-items: center;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 14px;
  display: flex;
  justify-content: space-between;
  padding: 12px;
}

.toggle-row input { width: auto; }

.remember-row {
  align-items: center;
  background: rgba(14, 143, 138, 0.08);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  gap: 10px;
  grid-template-columns: none;
  padding: 10px 12px;
}

.remember-row input {
  min-height: auto;
  width: auto;
}

.remember-row span {
  color: var(--text);
  font-size: 14px;
}

@media (max-width: 1120px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { height: auto; position: static; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics-strip,
  .workflow-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .app-shell { padding: 10px; }
  .topbar, .hero, .view-toolbar { align-items: stretch; flex-direction: column; }
  .stats-grid,
  .settings-grid,
  .metrics-strip,
  .workflow-list { grid-template-columns: 1fr; }
  .chart-bars { min-height: 210px; }
  .donut-wrap { align-items: flex-start; flex-direction: column; }
}
