:root {
  --bg: #f6f2ea;
  --surface: #fffdf8;
  --ink: #0f2e30;
  --muted: #5d6c6a;
  --line: #e4dccd;
  --brand: #1d6e74;
  --brand-dark: #0f3b3e;
  --accent: #c4552f;
  --aqua: #85c7cf;
  --danger: #b3261e;
  --ok: #2e7d4f;
  --radius: 14px;
  --side: 248px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font: 15px/1.55 "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
code { background: #f1ede6; padding: 1px 5px; border-radius: 4px; font-size: .85em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.lead { font-size: 1.05rem; color: var(--muted); margin-top: 0; }

/* Layout */
.admin { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--side); flex: 0 0 var(--side); background: var(--brand-dark); color: #c9d3d6;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 20px 12px;
}
.brand { display: flex; flex-direction: column; color: #fff; text-decoration: none; font: 600 1.4rem "Fraunces", Georgia, serif; padding: 4px 12px 20px; margin: 0; }
.brand small { font: 600 .65rem "DM Sans", sans-serif; letter-spacing: .25em; text-transform: uppercase; color: var(--aqua); margin-top: 4px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px;
  color: #c9d3d6; text-decoration: none; font-weight: 500;
}
.sidebar nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar nav a.active { background: var(--brand); color: #fff; }
.ico { width: 18px; text-align: center; opacity: .85; }
.badge { margin-left: auto; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; }
.sidebar-foot { border-top: 1px solid rgba(255,255,255,.1); padding: 14px 12px 0; display: grid; gap: 8px; font-size: .9rem; }
.sidebar-foot a { color: #fff; text-decoration: none; }
.sidebar-foot form { margin: 0; }
button.link { background: none; border: 0; color: #8fa1a7; padding: 0; font: inherit; cursor: pointer; text-align: left; }
button.link:hover { color: #fff; }

.main { flex: 1; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 20px 32px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar h1 { margin: 0; font-size: 1.35rem; }
.menu-btn { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; font-size: 1.2rem; padding: 4px 10px; cursor: pointer; }
.content { padding: 28px 32px 64px; max-width: 1200px; }

@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; z-index: 20; transform: translateX(-100%); transition: transform .2s; box-shadow: 4px 0 24px rgba(0,0,0,.2); }
  .sidebar.open { transform: none; }
  .menu-btn { display: block; }
  .topbar { padding: 14px 16px; }
  .content { padding: 20px 16px 48px; }
}

/* Components */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 20px; }
.panel.no-pad { padding: 0; overflow: hidden; }
.panel summary { cursor: pointer; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.panel-head h2 { margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.panel-head h2 small { font-weight: 400; font-size: .8rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar p { margin: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 .9rem inherit; font-family: inherit;
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: #cfc7bb; background: #faf8f5; }
.btn-sm { padding: 5px 10px; font-size: .8rem; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: #fbeceb; border-color: #f0c4be; }
.btn-block { width: 100%; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; border: 1px solid transparent; }
.alert-success { background: #e8f5ec; border-color: #c7e6d1; color: #1f6a37; }
.alert-error { background: #fbeceb; border-color: #f0c4be; color: #8f2a1c; }

.pill { display: inline-block; font-size: .7rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #e3eff3; color: var(--brand-dark); vertical-align: middle; }
.pill-muted { background: #eee9e2; color: var(--muted); }

/* Forms */
.form.narrow { max-width: 720px; }
.field { margin-bottom: 18px; border: 0; padding: 0; }
.field label, .field legend { display: block; font-weight: 600; margin-bottom: 6px; font-size: .9rem; }
.field input[type=text], .field input[type=email], .field input[type=url], .field input[type=password],
.field input:not([type]), .field select, .field textarea, .admin-card input[type=text], .hours-edit input[type=time] {
  width: 100%; padding: 10px 12px; border: 1px solid #d9d2c7; border-radius: 8px; font: inherit; background: #fff;
}
.field textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand) !important; box-shadow: 0 0 0 3px rgba(31,111,139,.15); }
.hint { display: block; color: var(--muted); font-size: .8rem; margin-top: 5px; }
.field-row { display: flex; gap: 16px; }
.field-row .field { flex: 1; }
.field-row .grow { flex: 3; }
@media (max-width: 600px) { .field-row { flex-direction: column; gap: 0; } }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500 !important; cursor: pointer; margin: 4px 16px 4px 0; }
.check-row { display: flex; flex-wrap: wrap; }
.form-actions { display: flex; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.sticky-actions { position: sticky; bottom: 0; background: var(--bg); padding-bottom: 12px; }

.image-picker { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.image-picker .preview img { width: 160px; height: 110px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 16px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.active { color: var(--brand); border-color: var(--brand); }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.table td.actions, .table th.actions { text-align: right; white-space: nowrap; }
.table tr.is-hidden td { opacity: .55; }
.table tr.is-closed input[type=time] { opacity: .35; }
.item-cell { display: flex; gap: 10px; align-items: center; }
.item-cell img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; }
.handle { cursor: grab; color: #b3aa9d; width: 24px; user-select: none; }
.handle-demo { color: #b3aa9d; }
[data-sort-item].dragging { opacity: .4; }
@media (max-width: 700px) {
  .table thead { display: none; }
  .table td:nth-child(4) { display: none; }
  .table td.actions .btn { margin-bottom: 4px; }
}

.sort-list { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 6px; }
.sort-list li { padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fbfaf8; cursor: grab; }

/* Card grids (gallery, highlights) */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 16px; }
.admin-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: grab; display: flex; flex-direction: column; }
.admin-card.is-hidden { opacity: .55; }
.admin-card img, .admin-card .no-img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #eee9e2; display: grid; place-items: center; color: var(--muted); }
.admin-card-body { padding: 12px; display: grid; gap: 8px; }
.admin-card-body p { margin: 0; }
.admin-card-foot { display: flex; justify-content: space-between; align-items: center; }

.dropzone {
  display: grid; place-items: center; text-align: center; gap: 4px; padding: 32px; border: 2px dashed #cfc6b8; border-radius: var(--radius);
  cursor: pointer; margin-bottom: 14px; background: #fbfaf8; position: relative;
}
.dropzone.over { border-color: var(--brand); background: #eef6f9; }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* Dashboard */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; text-decoration: none; color: var(--ink); display: grid; gap: 2px; }
.stat:hover { border-color: var(--brand); }
.stat strong { font-size: 1.8rem; line-height: 1.1; }
.stat strong.ok { color: var(--ok); }
.stat span { color: var(--muted); font-size: .85rem; }
.quick { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.quick a { display: block; padding: 10px 12px; border-radius: 8px; background: #f7f5f1; text-decoration: none; font-weight: 500; }
.quick a:hover { background: #eef6f9; }

/* Messages */
.msg-list { list-style: none; padding: 0; margin: 0; }
.msg-list li + li { border-top: 1px solid var(--line); }
.msg-list a { display: grid; grid-template-columns: 180px 1fr auto; gap: 12px; padding: 12px 16px; text-decoration: none; color: var(--ink); align-items: baseline; }
.msg-list a:hover { background: #faf8f5; }
.msg-list span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-list time { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.msg-list li.unread strong::before { content: ""; display: inline-block; width: 8px; height: 8px; background: var(--accent); border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.panel .msg-list a { padding-inline: 0; grid-template-columns: 1fr; gap: 0; }
@media (max-width: 700px) { .msg-list a { grid-template-columns: 1fr; gap: 0; } }
.message header { border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.message header p { margin: 0 0 10px; }
.message-body { white-space: normal; margin-bottom: 20px; font-size: 1rem; }

/* Login */
.auth-page { display: grid; place-items: center; min-height: 100vh; padding: 16px; background: linear-gradient(135deg, #123f50, var(--brand)); }
.auth-card { background: var(--surface); padding: 32px; border-radius: 16px; width: min(400px, 100%); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.auth-card .brand { color: var(--brand-dark); padding: 0 0 18px; }
.auth-card h1 { font-size: 1.3rem; }


/* Additions for promotions, pages and grouped forms */
.form-section { font: 600 1.25rem "Fraunces", Georgia, serif; margin: 30px 0 14px; padding-top: 22px; border-top: 1px solid var(--line); }
.form .form-section:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.pill-ok { background: #e2f2e7; color: #1d5e34; }
.input-prefix { display: flex; align-items: stretch; }
.input-prefix span { display: grid; place-items: center; padding: 0 10px; border: 1px solid #d9d2c7; border-right: 0; border-radius: 8px 0 0 8px; background: #f3eee6; color: var(--muted); }
.input-prefix input { border-radius: 0 8px 8px 0 !important; }
textarea.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .9rem; }
.mt-field { margin-top: 18px; }
.topbar h1 { font-family: "Fraunces", Georgia, serif; font-weight: 600; }
.stat strong { font-family: "Fraunces", Georgia, serif; font-weight: 600; }
.auth-page { background: linear-gradient(135deg, var(--brand-dark), var(--brand)); }
