/* ──────────────────────────────────────────────────────────────
   Mintrix Super Admin · Beacon-inspired theme
   Light, airy, green accent, monospace metrics, soft borders.
   ────────────────────────────────────────────────────────────── */

:root {
  --bg:          #fafaf9;
  --surface:     #ffffff;
  --surface-2:   #f7f7f6;
  --ink:         #111827;
  --ink-soft:    #374151;
  --muted:       #6b7280;
  --muted-2:     #9ca3af;
  --border:      #e5e7eb;
  --border-2:    #eef0ee;
  --accent:      #10b981;        /* emerald */
  --accent-ink:  #047857;
  --accent-soft: #d1fae5;
  --danger:      #ef4444;
  --warn:        #f59e0b;
  --info:        #3b82f6;

  --r-md: 10px;
  --r-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, .06);

  --font-sans: "Inter", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

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

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

/* ── Layout ── */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 6px 16px;
  border-bottom: 1px solid var(--border-2);
}
.brand__mark {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border: 1px solid #a7f3d0;
  display: grid; place-items: center;
  color: var(--accent-ink); font-weight: 800;
  font-size: 13px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(16, 185, 129, .15);
}
.brand__mark img {
  width: 100%; height: 100%;
  object-fit: contain;
  padding: 2px;
}
.brand__title { font-weight: 700; font-size: 13.5px; letter-spacing: .2px; }
.brand__sub   { font-size: 11px; color: var(--muted); font-family: var(--font-mono); margin-top: 2px; }

.cta {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin: 16px 0;
  padding: 10px 12px;
  background: var(--accent);
  color: white;
  font-weight: 600;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: filter .15s;
}
.cta:hover { filter: brightness(.96); color: white; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 13.5px;
}
.nav__link:hover { background: var(--surface-2); }
.nav__link.is-active {
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 600;
  position: relative;
}
.nav__link.is-active::before {
  content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px;
  width: 3px; background: var(--accent); border-radius: 0 3px 3px 0;
}
.nav__ico { width: 16px; text-align: center; color: var(--muted); }
.nav__link.is-active .nav__ico { color: var(--accent-ink); }

.sidebar__footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border-2);
  display: flex; flex-direction: column; gap: 4px;
  font-size: 12px; color: var(--muted);
}
.sidebar__footer .status-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  display: inline-block; margin-right: 6px;
}

/* ── Main panel ── */
.main { display: flex; flex-direction: column; min-width: 0; }

.topnav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}
.topnav__crumbs {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .8px;
}
.topnav__crumbs span { color: var(--muted-2); }
.topnav__crumbs strong { color: var(--ink-soft); font-weight: 600; }

.topnav__right { display: flex; align-items: center; gap: 12px; }
.topnav__user {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--ink-soft);
}
.topnav__avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); color: white;
  display: grid; place-items: center; font-weight: 700; font-size: 11px;
}

.content {
  padding: 28px 24px;
  flex: 1;
}

.page-title {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 0 22px 0;
  gap: 16px;
}
.page-title h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.4px;
}
.page-title .sub {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* ── Stats cards ── */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 18px;
}
.stat__label {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 600;
}
.stat__label .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.stat__value {
  font-size: 28px;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: -.5px;
}

/* ── Cards / Sections ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.card__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-2);
}
.card__head h2 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
}
.card__body { padding: 0; }

/* ── Tables ── */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  text-align: left;
  padding: 12px 18px;
  font-size: 13.5px;
  border-bottom: 1px solid var(--border-2);
  vertical-align: middle;
}
.table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .8px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-2);
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: rgba(16, 185, 129, .03); }

.table .mono { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-soft); }
.table .muted { color: var(--muted); }

/* ── Pills / Badges ── */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  border: 1px solid transparent;
}
.pill--ok       { background: var(--accent-soft); color: var(--accent-ink); }
.pill--off      { background: #f3f4f6; color: var(--muted); }
.pill--warn     { background: #fef3c7; color: #92400e; }
.pill--danger   { background: #fee2e2; color: #991b1b; }
.pill .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: background .14s, color .14s, border-color .14s;
}
.btn:hover  { background: var(--surface-2); }
.btn--primary {
  background: var(--accent); color: white; border-color: transparent;
}
.btn--primary:hover { color: white; filter: brightness(.95); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn--ghost:hover { color: var(--ink); background: var(--surface-2); }
.btn--danger { color: var(--danger); border-color: #fecaca; }
.btn--danger:hover { background: #fef2f2; }
.btn--sm { padding: 4px 8px; font-size: 12px; }

/* ── Forms ── */
.form-row {
  display: flex; flex-direction: column; gap: 4px;
  margin-bottom: 14px;
}
.form-row label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .8px;
  font-weight: 600;
  color: var(--muted);
}
.form-row .hint {
  font-size: 11.5px; color: var(--muted-2);
}
.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="password"],
.form-row input[type="tel"],
.form-row input[type="number"],
.form-row select,
.form-row textarea {
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13.5px;
  font-family: inherit;
  background: var(--surface);
  outline: none;
  transition: border-color .14s, box-shadow .14s;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, .12);
}

.form-grid-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.form-grid-3 {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px;
}
@media (max-width: 640px) {
  .form-grid-3 { grid-template-columns: 1fr; }
}

.required-mark { color: var(--danger); font-weight: 700; margin-left: 2px; }

.switch {
  position: relative; display: inline-block;
  width: 36px; height: 20px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch__slider {
  position: absolute; cursor: pointer;
  inset: 0;
  background: #d1d5db;
  border-radius: 999px;
  transition: .2s;
}
.switch__slider::before {
  position: absolute; content: "";
  width: 14px; height: 14px;
  left: 3px; top: 3px;
  background: white;
  border-radius: 50%;
  transition: .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch input:checked + .switch__slider { background: var(--accent); }
.switch input:checked + .switch__slider::before { transform: translateX(16px); }

/* ── Modals (premium / green-headed) ── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(11, 24, 39, .45);
  backdrop-filter: blur(2px);
  display: none; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: mxFadeIn .15s ease-out;
}
.modal-backdrop.is-open { display: flex; }
@keyframes mxFadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(2, 32, 18, .15), 0 4px 14px rgba(2, 32, 18, .08);
  width: 100%; max-width: 560px;
  overflow: hidden;
  border: 1px solid var(--border);
  animation: mxRise .18s ease-out;
}
.modal--lg { max-width: 760px; }
@keyframes mxRise {
  from { transform: translateY(8px) scale(.985); opacity: 0; }
  to   { transform: translateY(0)   scale(1);    opacity: 1; }
}

.modal__head {
  padding: 18px 22px;
  border-bottom: 1px solid #d1fae5;
  display: flex; align-items: center; justify-content: space-between;
  background:
    linear-gradient(135deg, #ecfdf5 0%, #f0fdfa 60%, #ffffff 100%);
  position: relative;
}
.modal__head::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, transparent 80%);
  opacity: .35;
}
.modal__head h3 {
  margin: 0;
  font-size: 16px; font-weight: 700;
  color: var(--ink);
  display: flex; align-items: center; gap: 10px;
}
.modal__head h3 i { color: var(--accent-ink); }
.modal__head .modal__sub {
  display: block;
  font-size: 11.5px; font-weight: 500; color: var(--muted);
  margin-top: 3px; letter-spacing: .3px;
}
.modal__close {
  background: rgba(16, 185, 129, .08);
  border: 1px solid transparent;
  color: var(--accent-ink);
  font-size: 18px; cursor: pointer;
  width: 30px; height: 30px;
  border-radius: 8px;
  display: grid; place-items: center;
  transition: background .14s, border-color .14s;
}
.modal__close:hover { background: rgba(16, 185, 129, .15); border-color: #a7f3d0; }
.modal__body { padding: 22px 24px; }
.modal__foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--border-2);
  background: var(--surface-2);
}

/* Section sub-header inside modal body */
.modal__section {
  margin: 18px 0 10px;
  padding: 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .9px;
  color: var(--accent-ink);
  font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.modal__section::before {
  content: "";
  width: 14px; height: 2px;
  background: var(--accent);
  border-radius: 2px;
  display: inline-block;
}
.modal__section + .form-grid-2,
.modal__section + .form-grid-3,
.modal__section + .form-row { margin-top: 6px; }

/* Caps row visual upgrade — wrap inputs in a subtle green-tinted card */
.caps-card {
  margin-top: 4px;
  padding: 14px;
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%);
  border: 1px solid #d1fae5;
  border-radius: 12px;
}
.caps-card .form-row label {
  color: var(--accent-ink);
}
.caps-card .form-row input {
  background: white;
  font-family: var(--font-mono);
  font-weight: 600;
  text-align: center;
}
.caps-card .hint { text-align: center; color: var(--muted-2); }

/* ── Messages / Toasts (flash) ── */
.messages { margin-bottom: 18px; }
.message {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 8px;
  border: 1px solid;
}
.message--success { background: var(--accent-soft); border-color: #bbf7d0; color: var(--accent-ink); }
.message--error   { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.message--info    { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.message--warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }

/* ── Login page ── */
.login-screen {
  min-height: 100vh;
  background: var(--bg);
  display: grid; place-items: center;
  padding: 24px;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px;
  width: 100%; max-width: 380px;
  box-shadow: var(--shadow-md);
}
.login-card__brand {
  display: flex; align-items: center; gap: 10px; margin-bottom: 22px;
}

/* ── Menu icon tile (used on menus list page) ── */
.menu-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border: 1px solid #a7f3d0;
  color: var(--accent-ink);
  font-size: 14px;
}
.menu-icon--off {
  background: #f3f4f6;
  border-color: var(--border);
  color: var(--muted-2);
}

/* ── Submenu list rows ── */
.submenu-list { list-style: none; margin: 0; padding: 0; }
.submenu-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 18px;
  border-top: 1px solid var(--border-2);
  font-size: 13px;
}
.submenu-list li:first-child { border-top: 0; }
.submenu-list .grow { flex: 1; }
.submenu-list .key { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); }

/* ── Empty state ── */
.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
}
.empty strong { color: var(--ink-soft); display: block; margin-bottom: 4px; font-size: 14.5px; }

/* ── Utility ── */
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; }
.muted { color: var(--muted); }
.right { margin-left: auto; }
.mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.txt-xs { font-size: 11.5px; }
.txt-sm { font-size: 12.5px; }
.bold { font-weight: 600; }
