:root {
    --ink: #1a1a1a;
    --muted: #6b6b6b;
    --border: #dcdcdc;
    --bg: #f6f6f6;
    --surface: #ffffff;
    --black: #111111;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
}
a { color: var(--black); }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 0.85em; }

/* Topbar */
.topbar { background: #fff; border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; gap: 24px; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--black); text-decoration: none; }
.topnav { display: flex; gap: 18px; flex: 1; }
.topnav a { color: var(--ink); text-decoration: none; font-size: 0.95rem; }
.topnav a:hover { color: var(--black); text-decoration: underline; }
.topbar-user { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; }

.content { max-width: 1200px; margin: 0 auto; padding: 24px 20px 60px; }

.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.page-head h1 { margin: 0; font-size: 1.5rem; }

/* Alerts -- distinguished by value/weight rather than hue, since the
   palette is grayscale only: error is inverted (black bg) to draw the eye,
   success is a calm light-gray card with a solid left border. */
.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 14px; font-size: 0.95rem; }
.alert-success, .alert-ok { background: #f0f0f0; border: 1px solid var(--border); border-left: 4px solid var(--black); color: var(--ink); }
.alert-error { background: var(--black); border: 1px solid var(--black); color: #fff; }

/* Cards */
.card { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 18px; margin-bottom: 18px; }
.card-narrow { max-width: 420px; }
.rich-text-editor { background: #fff; min-height: 220px; margin-bottom: 8px; }
.rich-text-editor .ql-editor { min-height: 200px; font-size: 14px; }
.card h3 { margin-top: 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

/* Forms */
.form-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.form-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; flex: 1; min-width: 140px; }
.form-group-small { flex: 0 0 110px; min-width: 90px; }
.form-group-tiny { flex: 0 0 80px; min-width: 70px; }
.form-group-full { flex-basis: 100%; }
.form-group-btn { flex: 0 0 auto; margin-bottom: 12px; }
label { font-size: 0.82rem; font-weight: 600; color: #444; }
input[type=text], input[type=password], input[type=number], input[type=email], input[type=color], select, textarea {
    padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 0.95rem; font-family: inherit; width: 100%;
}
textarea { resize: vertical; }

.search-bar { display: flex; gap: 8px; margin: 14px 0; }
.search-bar input[type=text] { max-width: 320px; }

/* Buttons -- filled black is primary, outlined is secondary; danger uses a
   thicker border rather than color to signal "be careful" (the confirm()
   dialogs on destructive actions are the real safety net either way). */
.btn { display: inline-block; padding: 9px 16px; border-radius: 6px; border: 1px solid var(--black); background: var(--black); color: #fff; font-size: 0.92rem; cursor: pointer; text-decoration: none; }
.btn:hover { background: #333; border-color: #333; }
.btn-primary { background: var(--black); border-color: var(--black); }
.btn-small { padding: 5px 10px; font-size: 0.82rem; }
.btn-outline { background: #fff; color: var(--black); }
.btn-outline:hover { background: #f0f0f0; }
.btn-danger { background: #fff; color: var(--black); border: 2px solid var(--black); font-weight: 600; }
.btn-danger:hover { background: var(--black); color: #fff; }
.btn-block { width: 100%; }
.inline-form { display: inline-block; }

/* Tables */
.data-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.data-table th, .data-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 0.92rem; vertical-align: top; }
.data-table th { background: #f7f7f7; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); }
.table-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 0.78rem; }
.badge-ok { background: var(--black); color: #fff; }
.badge-off { background: #f0f0f0; color: #777; border: 1px solid var(--border); }

/* Category checkboxes & size/price grid (beer menu assignment) */
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 14px; margin: 6px 0 14px; }
.checkbox-label { display: flex; align-items: center; gap: 6px; font-size: 0.88rem; font-weight: 400; color: #333; }
.checkbox-label input { width: auto; }

/* Restaurant access, shown directly in the Users table -- compact
   wrapping list rather than the wider grid used in standalone forms,
   sized to sit comfortably inside a table cell. Checking a box submits
   its form immediately (see the onchange on each input in
   admin/users.php), the same "changes apply right away" pattern
   already used for the role dropdown in the row next to it, so there's
   no separate edit/save step to find. */
.checkbox-grid-inline { display: flex; flex-wrap: wrap; gap: 4px 14px; max-width: 260px; }
.checkbox-grid-inline label { display: flex; align-items: center; gap: 5px; font-size: 0.85rem; font-weight: 400; color: #333; white-space: nowrap; }
.checkbox-grid-inline input { width: auto; }
.restaurant-access-cell { min-width: 220px; }

.size-price-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px 14px; margin: 6px 0 14px; }
.size-price-item { display: flex; flex-direction: column; gap: 3px; }
.size-price-item label { font-size: 0.78rem; color: #555; }

.section-label { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: #555; margin: 10px 0 2px; }

/* Restaurant grid on dashboard */
.restaurant-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.restaurant-card { background: #fff; border: 1px solid var(--border); border-top: 4px solid var(--black); border-radius: 8px; padding: 16px; }
.restaurant-card h2 { margin: 0 0 4px; font-size: 1.1rem; }
.card-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

/* Remove-location control -- set apart from the action button groups
   above it (extra top margin plus a divider) since it's destructive
   and shouldn't sit visually level with routine Manage/Print/View
   buttons. The confirmation panel it reveals requires typing REMOVE
   exactly before its own submit button enables (see the delegated
   input listener in admin/index.php). */
.danger-zone { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--border); }
.remove-confirm { margin-top: 10px; }
.remove-confirm label { display: block; margin-bottom: 6px; line-height: 1.4; }
.remove-confirm-row { display: flex; gap: 8px; }
.remove-confirm-input { flex: 1 1 auto; min-width: 0; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 0.85rem; }
.remove-confirm-row .btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* Login page */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #2b2b2b, #000); }
.login-box { background: #fff; padding: 36px 32px; border-radius: 10px; width: 100%; max-width: 360px; box-shadow: 0 10px 40px rgba(0,0,0,0.25); }
.login-box h1 { margin: 0 0 2px; font-size: 1.3rem; color: var(--black); }
.login-box label { display: block; margin-top: 14px; }
.login-box input { margin-top: 4px; }
.login-box button { margin-top: 20px; }

/* Type-ahead picker (assets/js/searchable-select.js) */
.ss-wrap { position: relative; }
.ss-input { padding-right: 34px; }
.ss-toggle { position: absolute; top: 1px; right: 1px; bottom: 1px; width: 32px; border: 0; background: transparent; cursor: pointer; font-size: 0.9rem; color: #555; border-radius: 0 6px 6px 0; }
.ss-toggle:hover { background: #f2f2f2; }
.ss-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 2px); margin: 0; padding: 4px 0; list-style: none; max-height: 280px; overflow-y: auto; background: #fff; border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,0.15); }
.ss-list li { padding: 7px 12px; font-size: 0.92rem; cursor: pointer; }
.ss-list li.ss-active, .ss-list li:hover { background: #111; color: #fff; }
.ss-list li.ss-empty { color: #777; cursor: default; background: transparent; }
.ss-list li .ss-note { float: right; margin-left: 12px; font-size: 0.75rem; opacity: 0.7; font-style: italic; }
.ss-list li.ss-disabled { color: #999; cursor: not-allowed; background: transparent; }
.ss-list li.ss-disabled:hover { background: transparent; color: #999; }
