    :root {
      --sidebar-w:      260px;
      --topbar-h:       60px;
      --bg:             #F2F2F7;
      --surface:        #FFFFFF;
      --sidebar-bg:     #FFFFFF;
      --sidebar-border: rgba(60,60,67,0.12);
      --primary:        #007AFF;
      --border:         rgba(60,60,67,0.12);
      --border-solid:   #E5E5EA;
      --text:           #1C1C1E;
      --text-secondary: #3C3C43;
      --text-muted:     rgba(60,60,67,0.6);
      --radius:         16px;
      --radius-sm:      12px;
      --ease:           .15s ease;
      --green:          #34C759;
      --green-bg:       rgba(52,199,89,0.12);
      --red:            #FF3B30;
      --red-bg:         rgba(255,59,48,0.12);
      --orange:         #FF9500;
      --orange-bg:      rgba(255,149,0,0.12);
      --blue:           #007AFF;
      --blue-bg:        rgba(0,122,255,0.1);
      --purple:         #AF52DE;
      --purple-bg:      rgba(175,82,222,0.1);
    }

    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    body {
      font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
      background: var(--bg);
      color: var(--text);
      min-height: 100vh;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
    }
    [hidden] { display: none !important; }

    ::-webkit-scrollbar { width: 5px; }
    ::-webkit-scrollbar-track { background: transparent; }
    ::-webkit-scrollbar-thumb { background: rgba(60,60,67,0.18); border-radius: 4px; }

    /* ── Sidebar ──────────────────────────────────────────── */
    .sidebar {
      position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w);
      background: var(--sidebar-bg);
      border-right: 0.5px solid var(--sidebar-border);
      display: flex; flex-direction: column; z-index: 200;
      transition: transform var(--ease);
    }
    .sidebar__logo {
      display: flex; align-items: center; gap: 10px;
      padding: 0 18px; height: 76px;
      border-bottom: 0.5px solid var(--sidebar-border);
      flex-shrink: 0;
    }
    .sidebar__logo-mark {
      width: 34px; height: 34px; border-radius: 9px;
      background: var(--primary);
      display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    }
    .sidebar__logo-mark svg { width: 19px; height: 19px; color: #fff; }
    .sidebar__logo-text { display: flex; flex-direction: column; min-width: 0; }
    .sidebar__logo-name { font-size: .95rem; font-weight: 700; color: var(--text); letter-spacing: -.3px; }
    .sidebar__logo-tag  { font-size: .62rem; font-weight: 600; color: var(--primary); text-transform: uppercase; letter-spacing: .08em; }
    .sidebar__powered {
      margin-left: auto;
      display: inline-flex; align-items: center; gap: 5px;
      padding: 3px 8px 3px 5px; border-radius: 999px;
      border: 0.5px solid var(--border-solid);
      background: rgba(120,120,128,0.08);
      color: var(--text-muted); font-size: .68rem; font-weight: 600; line-height: 1; flex-shrink: 0;
    }
    .sidebar__powered img { width: auto; height: 13px; object-fit: contain; opacity: .7; }
    .sidebar__nav { padding: 12px 10px; flex: 1; overflow-y: auto; }
    .nav-label {
      font-size: .65rem; font-weight: 600; text-transform: uppercase;
      letter-spacing: .08em; color: var(--text-muted);
      padding: 0 10px; margin: 20px 0 4px;
    }
    .nav-label:first-child { margin-top: 4px; }
    .nav-link {
      display: flex; align-items: center; gap: 10px;
      padding: 9px 10px; border-radius: 10px;
      text-decoration: none; color: var(--text-secondary);
      font-size: .875rem; font-weight: 500;
      transition: background var(--ease), color var(--ease); cursor: pointer;
    }
    .nav-link svg { width: 17px; height: 17px; flex-shrink: 0; color: var(--text-muted); transition: color var(--ease); }
    .nav-link:hover { background: rgba(120,120,128,0.08); color: var(--text); }
    .nav-link:hover svg { color: var(--text-secondary); }
    .nav-link.active { background: var(--blue-bg); color: var(--primary); }
    .nav-link.active svg { color: var(--primary); }
    .sidebar__footer {
      padding: 12px 10px;
      border-top: 0.5px solid var(--sidebar-border);
    }
    .sidebar__user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; }
    .sidebar__avatar {
      width: 32px; height: 32px; border-radius: 50%;
      background: var(--primary);
      display: flex; align-items: center; justify-content: center;
      font-size: .72rem; font-weight: 700; color: #fff; flex-shrink: 0;
    }
    .sidebar__user-name { font-size: .82rem; font-weight: 600; color: var(--text); }
    .sidebar__user-role { font-size: .7rem; color: var(--text-muted); }

    /* ── Layout ───────────────────────────────────────────── */
    .layout { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
    .topbar {
      position: sticky; top: 0; z-index: 100;
      height: var(--topbar-h);
      background: rgba(242,242,247,0.85);
      -webkit-backdrop-filter: blur(20px) saturate(180%);
      backdrop-filter: blur(20px) saturate(180%);
      border-bottom: 0.5px solid var(--border);
      display: flex; align-items: center; padding: 0 24px; gap: 12px;
    }
    .topbar__burger { display: none; background: none; border: none; cursor: pointer; color: var(--text); padding: 4px; }
    .topbar__burger svg { width: 22px; height: 22px; }
    .topbar__title { font-size: 1rem; font-weight: 700; letter-spacing: -.2px; }
    .topbar__right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
    .topbar__env {
      font-size: .7rem; font-weight: 600;
      background: var(--orange-bg); color: var(--orange);
      border-radius: 20px; padding: 3px 10px;
    }
    .content { padding: 24px; flex: 1; }

    /* ── Stat cards ───────────────────────────────────────── */
    .stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
    @media (max-width: 900px) { .stats { grid-template-columns: repeat(2, 1fr); } }
    .stat {
      background: var(--surface);
      border-radius: var(--radius);
      padding: 18px 20px;
      box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
      transition: box-shadow var(--ease), transform var(--ease);
    }
    .stat:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); transform: translateY(-1px); }
    .stat__label { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 8px; }
    .stat__value { font-size: 2rem; font-weight: 700; line-height: 1; letter-spacing: -.5px; }
    .stat__sub   { font-size: .75rem; color: var(--text-muted); margin-top: 4px; }

    /* ── Toolbar ──────────────────────────────────────────── */
    .toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
    .toolbar__left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
    .search-wrap { position: relative; }
    .search-wrap svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: rgba(60,60,67,0.4); pointer-events: none; }
    .search-input {
      border: none;
      border-radius: 10px;
      padding: 8px 12px 8px 33px;
      font-size: .85rem; font-family: inherit;
      outline: none;
      background: var(--surface);
      color: var(--text); width: 220px;
      box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 0 0 0.5px var(--border);
      transition: box-shadow var(--ease);
    }
    .search-input:focus { box-shadow: 0 0 0 3px rgba(0,122,255,0.2), 0 0 0 0.5px var(--primary); }
    .filter-sel {
      border: none; border-radius: 10px; padding: 8px 12px;
      font-size: .85rem; font-family: inherit; outline: none;
      background: var(--surface); color: var(--text); cursor: pointer;
      box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 0 0 0.5px var(--border);
      transition: box-shadow var(--ease);
    }
    .filter-sel:focus { box-shadow: 0 0 0 3px rgba(0,122,255,0.2), 0 0 0 0.5px var(--primary); }
    .btn-primary {
      background: var(--primary); color: #fff; border: none;
      border-radius: 10px; padding: 8px 18px;
      font-size: .85rem; font-weight: 600; cursor: pointer;
      display: flex; align-items: center; gap: 7px;
      transition: opacity var(--ease), transform var(--ease);
      white-space: nowrap;
      box-shadow: 0 1px 3px rgba(0,122,255,0.3);
    }
    .btn-primary:hover { opacity: .88; transform: translateY(-0.5px); }
    .btn-primary:active { transform: translateY(0); opacity: 1; }
    .btn-primary:disabled { opacity: .5; cursor: default; transform: none; }
    .btn-primary svg { width: 15px; height: 15px; }

    /* ── Table ────────────────────────────────────────────── */
    .table-wrap {
      background: var(--surface);
      border-radius: var(--radius);
      overflow: hidden;
      box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    }
    .table { width: 100%; border-collapse: collapse; font-size: .85rem; }
    .table thead th {
      text-align: left; padding: 10px 16px 9px;
      font-size: .68rem; font-weight: 600;
      text-transform: uppercase; letter-spacing: .07em;
      color: var(--text-muted);
      border-bottom: 0.5px solid var(--border);
      background: rgba(242,242,247,0.6);
      white-space: nowrap;
    }
    .table tbody td { padding: 13px 16px; border-bottom: 0.5px solid var(--border); vertical-align: middle; }
    .table tbody tr:last-child td { border-bottom: none; }
    .table tbody tr:hover td { background: rgba(0,0,0,0.018); }

    /* ── Restaurant cell ──────────────────────────────────── */
    .rest-logo {
      width: 36px; height: 36px; border-radius: 9px;
      object-fit: cover; background: var(--bg);
      box-shadow: 0 0 0 0.5px var(--border);
      overflow: hidden; flex-shrink: 0;
      display: flex; align-items: center; justify-content: center;
    }
    .rest-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
    .rest-logo svg { width: 18px; height: 18px; color: rgba(60,60,67,0.3); }
    .rest-name { font-weight: 600; font-size: .9rem; letter-spacing: -.1px; }
    .rest-slug { font-size: .75rem; color: var(--text-muted); font-family: 'SF Mono', ui-monospace, 'Fira Code', monospace; }
    .rest-meta { font-size: .78rem; color: var(--text-muted); }

    /* ── Badges ───────────────────────────────────────────── */
    .badge {
      display: inline-flex; align-items: center; gap: 5px;
      padding: 3px 10px; border-radius: 20px;
      font-size: .72rem; font-weight: 600; white-space: nowrap;
    }
    .badge::before { content: ''; display: block; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
    .badge--active    { color: var(--green); background: var(--green-bg); }
    .badge--trial     { color: var(--blue);  background: var(--blue-bg); }
    .badge--suspended { color: var(--red);   background: var(--red-bg); }
    .badge--expired   { color: rgba(60,60,67,0.55); background: rgba(120,120,128,0.1); }
    .badge--cancelled { color: rgba(60,60,67,0.55); background: rgba(120,120,128,0.1); }
    .plan-pill {
      display: inline-flex; align-items: center;
      background: var(--purple-bg); color: var(--purple);
      font-size: .75rem; font-weight: 600; padding: 3px 10px; border-radius: 20px;
    }

    /* ── Action buttons ───────────────────────────────────── */
    .btn-sm {
      border: none; border-radius: 8px; padding: 5px 12px;
      font-size: .78rem; font-weight: 600; cursor: pointer;
      transition: opacity var(--ease), transform var(--ease); white-space: nowrap;
    }
    .btn-sm:hover { opacity: .8; transform: translateY(-0.5px); }
    .btn-sm:active { transform: none; }
    .btn-sm--activate { background: var(--green-bg); color: var(--green); }
    .btn-sm--suspend  { background: var(--red-bg);   color: var(--red); }

    /* ── Empty / loading states ───────────────────────────── */
    .state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 20px; text-align: center; color: var(--text-muted); gap: 10px; }
    .state svg { width: 40px; height: 40px; opacity: .2; }
    .state p { font-size: .88rem; font-weight: 500; }
    .spinner {
      width: 28px; height: 28px;
      border: 2.5px solid rgba(60,60,67,0.12);
      border-top-color: var(--primary);
      border-radius: 50%; animation: spin .65s linear infinite;
    }
    @keyframes spin { to { transform: rotate(360deg); } }

    /* ── Modals ───────────────────────────────────────────── */
    .overlay {
      position: fixed; inset: 0;
      background: rgba(0,0,0,0.4);
      -webkit-backdrop-filter: blur(8px);
      backdrop-filter: blur(8px);
      z-index: 500; display: flex; align-items: center; justify-content: center;
      padding: 16px; animation: ov-in .2s ease;
    }
    @keyframes ov-in { from { opacity: 0; } }
    .modal {
      background: var(--surface);
      border-radius: 20px; width: 100%;
      max-width: 520px; max-height: 90vh; overflow-y: auto;
      animation: mo-in .22s cubic-bezier(0.34,1.56,0.64,1);
      box-shadow: 0 24px 80px rgba(0,0,0,0.22), 0 0 0 0.5px rgba(0,0,0,0.06);
    }
    @keyframes mo-in { from { opacity: 0; transform: scale(0.94) translateY(8px); } }
    .modal__head {
      display: flex; align-items: center; justify-content: space-between;
      padding: 20px 24px 16px;
      border-bottom: 0.5px solid var(--border);
      position: sticky; top: 0;
      background: rgba(255,255,255,0.92);
      -webkit-backdrop-filter: blur(20px);
      backdrop-filter: blur(20px);
      z-index: 1;
      border-radius: 20px 20px 0 0;
    }
    .modal__title { font-size: 1rem; font-weight: 700; letter-spacing: -.2px; }
    .modal__close {
      background: rgba(120,120,128,0.12); border: none; cursor: pointer;
      color: var(--text-muted); width: 28px; height: 28px;
      border-radius: 50%; display: flex; align-items: center; justify-content: center;
      font-size: .9rem; line-height: 1; transition: background var(--ease);
    }
    .modal__close:hover { background: rgba(120,120,128,0.2); color: var(--text); }
    .modal__body { padding: 20px 24px; display: flex; flex-direction: column; gap: 15px; }
    .modal__foot {
      display: flex; justify-content: flex-end; gap: 8px;
      padding: 14px 24px 20px;
      border-top: 0.5px solid var(--border);
      position: sticky; bottom: 0;
      background: rgba(255,255,255,0.92);
      -webkit-backdrop-filter: blur(20px);
      backdrop-filter: blur(20px);
    }

    /* ── Form ─────────────────────────────────────────────── */
    .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
    .form-group { display: flex; flex-direction: column; gap: 5px; }
    .form-group.full { grid-column: 1 / -1; }
    .form-label { font-size: .76rem; font-weight: 600; color: var(--text-muted); }
    .form-label span { color: var(--red); }
    .form-input, .form-select {
      width: 100%; border: none;
      box-shadow: 0 0 0 0.5px var(--border-solid);
      border-radius: 10px; padding: 9px 12px;
      font-size: .88rem; font-family: inherit;
      color: var(--text); background: rgba(242,242,247,0.5);
      outline: none; transition: box-shadow var(--ease), background var(--ease);
    }
    .form-input:focus, .form-select:focus {
      box-shadow: 0 0 0 3px rgba(0,122,255,0.2), 0 0 0 1px var(--primary);
      background: var(--surface);
    }
    .form-input.error { box-shadow: 0 0 0 3px rgba(255,59,48,0.15), 0 0 0 1px var(--red); }
    .form-hint { font-size: .72rem; color: var(--text-muted); }
    .form-divider { border: none; border-top: 0.5px solid var(--border-solid); }
    .form-section-label { font-size: .72rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }

    .btn-secondary {
      background: rgba(120,120,128,0.1); border: none;
      border-radius: 10px; padding: 8px 16px;
      font-size: .85rem; font-weight: 600; cursor: pointer;
      color: var(--text); transition: background var(--ease);
    }
    .btn-secondary:hover { background: rgba(120,120,128,0.18); }

    /* ── Confirm modal ────────────────────────────────────── */
    .confirm-icon { width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center; margin: 0 auto; }
    .confirm-icon--red   { background: var(--red-bg);   color: var(--red); }
    .confirm-icon--green { background: var(--green-bg); color: var(--green); }
    .confirm-icon svg { width: 26px; height: 26px; }

    /* ── Err banner ───────────────────────────────────────── */
    .err-banner {
      background: var(--red-bg);
      border-radius: 10px; padding: 10px 14px;
      font-size: .8rem; font-weight: 600; color: var(--red);
    }

    /* ── Inline spinner ───────────────────────────────────── */
    .spin {
      width: 16px; height: 16px;
      border: 2px solid rgba(255,255,255,.35);
      border-top-color: #fff; border-radius: 50%;
      animation: spin .6s linear infinite; display: inline-block; vertical-align: middle;
    }

    /* ── Mobile ───────────────────────────────────────────── */
    .sidebar-overlay { display: none; position: fixed; inset: 0; z-index: 190; background: rgba(0,0,0,.35); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
    @media (max-width: 860px) {
      .sidebar { transform: translateX(-100%); box-shadow: none; }
      .sidebar.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,0.12); }
      .sidebar-overlay.open { display: block; }
      .layout { margin-left: 0; }
      .topbar__burger { display: flex; }
      .stats { grid-template-columns: repeat(2,1fr); }
      .table thead th:nth-child(n+4), .table tbody td:nth-child(n+4) { display: none; }
      .search-input { width: 160px; }
    }
