/* 1819 shared UI design system.
 * Canonical owner for reusable visual primitives.
 * Feature CSS should contain only feature-specific layout/behavior.
 */
:root{
  --ui-navy:#111827;
  --ui-header-control:#263244;
  --ui-muted:#64748b;
  --ui-line:#d1d5db;
  --ui-line-soft:#e5e7eb;
  --ui-surface:#fff;
  --ui-surface-soft:#f8fafc;
  --ui-surface-subtle:#f3f4f6;
  --ui-danger:#b91c1c;
  --ui-danger-line:#fecaca;
  --ui-warning-bg:#fff7ed;
  --ui-warning-line:#fed7aa;
  --ui-radius-sm:10px;
  --ui-radius-control:12px;
  --ui-radius-card:16px;
  --ui-radius-modal:18px;
  --ui-btn-h-sm:40px;
  --ui-btn-h-md:48px;
  --ui-btn-h-lg:58px;
  --ui-control-h:48px;
  --ui-font-control:16px;
  --ui-shadow-popover:0 12px 30px rgba(0,0,0,.16);
  --ui-shadow-modal:0 24px 70px rgba(0,0,0,.30);
}

/* Controls */
html body input:not([type="checkbox"]):not([type="radio"]),
html body select,
html body textarea,
html body .ui-control{
  box-sizing:border-box;
  width:100%;
  border:1px solid var(--ui-line);
  border-radius:var(--ui-radius-control);
  background:var(--ui-surface);
  color:var(--ui-navy);
}
html body textarea,html body .ui-textarea{line-height:1.4;vertical-align:top}
html body label,html body .ui-label{color:var(--ui-muted)}

/* Button base + compatibility aliases */
html body .ui-btn,
html body .primary,
html body .small-btn,
html body .schedule-pdf-btn,
html body .payment-pdf-btn,
html body .payment-pdf-link,
html body .past-toggle,
html body .history-btn,
html body .announcement-add,
html body .announcement-cancel,
html body .announcement-save,
html body .filter-btn,
html body .save,
html body .delete{
  box-sizing:border-box;
  border-radius:var(--ui-radius-control);
  font-weight:800;
  cursor:pointer;
  text-decoration:none;
}
html body button:disabled,html body .ui-btn:disabled{opacity:.55;cursor:not-allowed}

/* Button variants */
html body .ui-btn-primary,
html body .primary,
html body .small-btn.primary-mini,
html body .schedule-pdf-btn,
html body .payment-pdf-btn,
html body .announcement-add,
html body .announcement-save,
html body .save{
  border:1px solid var(--ui-navy);
  background:var(--ui-navy);
  color:#fff;
}
html body .ui-btn-secondary,
html body .small-btn:not(.primary-mini),
html body .payment-pdf-link,
html body .past-toggle,
html body .history-btn,
html body .announcement-cancel,
html body .filter-btn{
  border:1px solid var(--ui-line);
  background:var(--ui-surface);
  color:var(--ui-navy);
}
html body .ui-btn-danger,
html body .delete,
html body .announcement-delete,
html body .small-btn.announcement-delete{
  border:1px solid var(--ui-danger-line);
  background:var(--ui-surface);
  color:var(--ui-danger);
}
html body .ui-btn-block{width:100%}
html body .ui-btn-sm,html body .small-btn{min-height:var(--ui-btn-h-sm);padding:8px 10px;font-size:12px}
html body .ui-btn-md{min-height:var(--ui-btn-h-md);padding:12px 14px}
html body .ui-btn-lg{min-height:var(--ui-btn-h-lg);padding:0 18px;font-size:18px}

/* Header + icon buttons */
html body .ui-btn-icon,
html body .password-toggle,
html body .history-close,
html body .announcement-modal-close,
html body .sheet .sheet-head #closeSheet{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0;
  border:0;
  border-radius:var(--ui-radius-sm);
}
html body .ui-header-btn,
html body .logout,
html body .top-menu-btn{
  box-sizing:border-box;
  border:0;
  border-radius:var(--ui-radius-sm);
  background:var(--ui-header-control);
  color:#fff;
}

/* Action rows */
html body .ui-actions,
html body .payment-actions,
html body .announcement-form-actions,
html body .actions{gap:8px}
html body .payment-actions>button,
html body .payment-actions>a{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-height:var(--ui-btn-h-md);
  border-radius:var(--ui-radius-control);
  font-weight:900;
  text-align:center;
}

/* Segmented controls */
html body .ui-segment,
html body .lang,
html body .segment{
  box-sizing:border-box;
  display:flex;
  gap:3px;
  border-radius:var(--ui-radius-control);
  background:var(--ui-surface-subtle);
}
html body .segment{display:grid;gap:6px}
html body .ui-segment>button,
html body .lang>button,
html body .segment>button{
  border:0;
  border-radius:9px;
  background:transparent;
  font-weight:800;
}

/* Surface/card primitives */
html body .ui-card,
html body .section,
html body .metric,
html body .staff-card,
html body .pay-card,
html body .pay-control-card,
html body .schedule-export,
html body .log-card,
html body .history-item,
html body .announcement-card,
html body .staff-filter-panel{
  box-sizing:border-box;
  border-color:var(--ui-line-soft);
  background:var(--ui-surface);
}
html body .ui-card{border:1px solid var(--ui-line-soft);border-radius:var(--ui-radius-card)}

/* Popover/menu surfaces */
html body .ui-popover,
html body .top-menu,
html body .staff-filter-menu,
html body .nav-hold-menu{
  box-sizing:border-box;
  border:1px solid var(--ui-line-soft);
  border-radius:14px;
  background:var(--ui-surface);
  box-shadow:var(--ui-shadow-popover);
}
html body .nav-hold-menu{position:fixed;z-index:350;bottom:calc(78px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);width:min(260px,88vw);padding:6px}
html body .nav-hold-menu button{width:100%;border:0;background:transparent;text-align:left;padding:12px;border-radius:10px;font-weight:800}
html body .nav-hold-menu button:active{background:var(--ui-surface-subtle)}
html body .bottom-nav[data-visible-count="3"]{grid-template-columns:repeat(3,1fr)}

/* Chips / badges */
html body .ui-chip,
html body .chip,
html body .announcement-badge,
html body .today-badge,
html body .off-badge,
html body .log-action{
  display:inline-flex;
  align-items:center;
  width:auto;
  border-radius:999px;
  font-weight:800;
}
html body .ui-count-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:52px;
  min-height:36px;
  padding:7px 12px;
  border:1px solid var(--ui-line-soft);
  border-radius:999px;
  background:var(--ui-surface);
  color:var(--ui-navy);
  font-size:13px;
  font-weight:900;
  white-space:nowrap;
}

/* Modal primitives */
html body .ui-modal-backdrop,
html body .history-modal-backdrop,
html body .announcement-modal-backdrop{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.48);
}
html body .ui-modal,
html body .history-modal,
html body .announcement-modal{
  box-sizing:border-box;
  background:var(--ui-surface);
  border-radius:var(--ui-radius-modal);
}
html body .ui-modal{box-shadow:var(--ui-shadow-modal)}
html body .ui-modal-header,
html body .history-modal-head,
html body .announcement-modal-header{
  display:flex;
  align-items:center;
  gap:10px;
  border-bottom:1px solid var(--ui-line-soft);
  background:var(--ui-surface);
}

/* Floating action button */
html body .ui-fab,
html body .add{
  display:flex;
  align-items:center;
  justify-content:center;
  border:0;
  border-radius:50%;
  background:var(--ui-navy);
  color:#fff;
}

/* Shared feedback / information */
html body .ui-warning,
html body .alert{
  box-sizing:border-box;
  border:1px solid var(--ui-warning-line);
  border-radius:var(--ui-radius-control);
  background:var(--ui-warning-bg);
}
html body .ui-info-tile,
html body .info,
html body .history-change{
  box-sizing:border-box;
  border-radius:var(--ui-radius-control);
  background:var(--ui-surface-soft);
}

/* Shared text helpers */
html body .ui-muted,html body .role-note{color:var(--ui-muted)}
html body .ui-total,html body .total-box{background:var(--ui-surface-soft);font-weight:900}

/* Bottom navigation icon normalization */
html body .bottom-nav button{display:flex;min-width:0;flex-direction:column;align-items:center;justify-content:center}
html body .bottom-nav .nav-ico{display:flex;width:24px;height:24px;min-height:24px;align-items:center;justify-content:center;margin:0 auto 3px;font-size:22px;line-height:1;font-weight:800}
html body .bottom-nav button[data-page="dashboard"] .nav-ico{color:#2563eb}
html body .bottom-nav button[data-page="reservations"] .nav-ico{color:#0f766e}
html body .bottom-nav button[data-page="schedule"] .nav-ico{color:#7c3aed}
html body .bottom-nav button[data-page="staff"] .nav-ico{color:#0ea5e9;font-size:21px}
html body .bottom-nav button[data-page="payments"] .nav-ico{color:#059669}
html body .bottom-nav button.active{color:var(--ui-navy)}

@media(max-width:640px){
  html body input:not([type="checkbox"]):not([type="radio"]),
  html body select,
  html body textarea{font-size:16px}
  html body .ui-btn-lg{min-height:var(--ui-btn-h-lg)}
  html body .ui-count-badge{min-width:48px;min-height:34px;padding:6px 10px;font-size:12px}
  html body .bottom-nav button{min-width:0}
  html body .bottom-nav .nav-ico{width:24px;height:24px;min-height:24px;font-size:22px}
  html body .bottom-nav button[data-page="staff"] .nav-ico{font-size:21px}
}
