/* ============================================
   LODGEMS — MAIN STYLESHEET
   Aesthetic: "Hot Desk" — black + red, yellow CTA
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;600;700;800;900&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

/* ── VARIABLES ── */
:root {
  --bg:        #0a0606;
  --surface:   #1d1111;
  --surface2:  #271616;
  --border:    #4a201f;
  --text:      #ffffff;
  --text-muted:#c9b8b8;
  --accent:    #ffd60a;   /* yellow/gold — money, CTA, focus, highlights */
  --accent2:   #ffe24d;   /* lighter yellow — CTA hover */
  --brand:     #ef2233;   /* red — brand mark, nav active, selected, bars */
  --brand2:    #c2151f;   /* deep red */
  --gold:      #ffd60a;
  --green:     #3ddc84;
  --blue:      #4aa3ff;
  --red:       #ff5a5a;
  --purple:    #b07cff;
  --cta-text:  #1a0808;   /* near-black text on yellow */
  --sidebar-w: 240px;
  --radius:    12px;
  --glow:      0 8px 34px rgba(239,34,51,.16);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
input, select, button { font-family: inherit; }

/* ── UTILITIES ── */
.hidden { display: none !important; }
.error-msg {
  color: var(--red);
  font-size: .85rem;
  margin-bottom: .75rem;
  padding: .5rem .75rem;
  background: rgba(255,90,90,.12);
  border-left: 3px solid var(--red);
  border-radius: 4px;
}
.success-msg {
  color: var(--green);
  font-size: .85rem;
  margin-bottom: .75rem;
  padding: .5rem .75rem;
  background: rgba(61,220,132,.12);
  border-left: 3px solid var(--green);
  border-radius: 4px;
}
.optional { color: var(--text-muted); font-size: .8rem; }

/* ══════════════════════════════════════════
   LOGIN PAGE
══════════════════════════════════════════ */
.login-page { background: var(--bg); }

.login-bg {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background:
    radial-gradient(125% 120% at 50% 0%, #2c0a0d 0%, var(--bg) 55%),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.75rem 2.5rem;
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--glow);
  animation: slideIn .45s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.login-brand {
  margin-bottom: 2.25rem;
  text-align: center;
}
.brand-icon {
  font-size: 2.6rem;
  color: var(--brand);
  display: block;
  margin-bottom: .5rem;
}
.login-form .btn-primary { border-radius: 999px; }
.login-brand h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  color: var(--text);
  letter-spacing: .02em;
}
.login-brand p {
  color: var(--text-muted);
  font-size: .85rem;
  margin-top: .25rem;
  font-weight: 300;
}

.login-form .form-group {
  margin-bottom: 1.25rem;
}
.login-form label {
  display: block;
  font-size: .8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .4rem;
}
.login-form input,
.login-form select {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem 1rem;
  color: var(--text);
  font-size: .95rem;
  transition: border-color .2s;
}
.login-form input:focus,
.login-form select:focus {
  outline: none;
  border-color: var(--accent);
}
.login-form select option { background: var(--surface2); }

.btn-primary {
  width: 100%;
  background: var(--accent);
  color: var(--cta-text);
  border: none;
  border-radius: var(--radius);
  padding: .85rem 1.5rem;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: background .2s, transform .1s;
  letter-spacing: .03em;
}
.btn-primary:hover { background: var(--accent2); }
.btn-primary:active { transform: scale(.98); }

.register-cta { text-align: center; margin-top: 1rem; font-size: .88rem; color: var(--text-muted); }
.register-cta a { color: var(--accent); font-weight: 600; }

.action-cell { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.btn-transfer {
  background: rgba(74,163,255,.16);
  color: var(--blue);
  border: 1px solid rgba(74,163,255,.4);
  border-radius: 6px;
  padding: .35rem .7rem;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
}
.btn-transfer:hover { opacity: .85; }
.btn-foam {
  background: rgba(176,124,255,.16);
  color: var(--purple);
  border: 1px solid rgba(176,124,255,.4);
  border-radius: 6px;
  padding: .35rem .7rem;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
}
.btn-foam:hover { opacity: .85; }
.btn-person {
  background: var(--accent);
  color: var(--cta-text);
  border: none;
  border-radius: 6px;
  padding: .35rem .7rem;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s;
}
.btn-person:hover { opacity: .85; }
.btn-extend {
  background: rgba(61,220,132,.16);
  color: var(--green);
  border: 1px solid rgba(61,220,132,.4);
  border-radius: 6px;
  padding: .35rem .7rem;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
}
.btn-extend:hover { opacity: .85; }
.extend-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem .5rem;
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
  transition: all .12s;
}
.extend-option:hover { border-color: var(--brand); }
.extend-option.selected {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
  background: rgba(239,34,51,.14);
}
.extend-option .dur-price { color: var(--accent); }
.person-count {
  display: inline-block;
  min-width: 1.6rem;
  padding: .15rem .5rem;
  border-radius: 20px;
  background: rgba(255,214,10,.16);
  color: var(--accent);
  font-size: .8rem;
  font-weight: 700;
  text-align: center;
}
.btn-checkout {
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: .35rem .9rem;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
}
.btn-checkout:hover { opacity: .85; }

.kiosk-logout-btn {
  margin-top: 1.5rem;
  background: var(--brand);
  color: #fff;
  border: none;
  padding: .6rem 1.5rem;
  border-radius: var(--radius);
  font-size: .9rem;
  cursor: pointer;
}

.kiosk-toggle { margin-bottom: .75rem; }
.kiosk-label {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .82rem;
  color: var(--text-muted);
  cursor: pointer;
}
.kiosk-label input[type="checkbox"] { accent-color: var(--brand); width: 15px; height: 15px; cursor: pointer; }
.kiosk-hint { font-size: .75rem; opacity: .6; }

.login-deco {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 30% 50%, rgba(239,34,51,.14) 0%, transparent 60%),
    var(--bg);
  overflow: hidden;
}

.deco-text {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.deco-text span {
  font-family: 'Playfair Display', serif;
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 900;
  color: transparent;
  -webkit-text-stroke: 1px rgba(239,34,51,.25);
  line-height: 1;
  letter-spacing: .05em;
  display: block;
  animation: fadeUp .8s ease both;
}
.deco-text span:nth-child(2) { animation-delay: .1s; padding-left: 2rem; }
.deco-text span:nth-child(3) { animation-delay: .2s; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════
   APP LAYOUT (SIDEBAR + MAIN)
══════════════════════════════════════════ */
.app-page {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform .3s ease;
}
.sidebar-collapsed .sidebar { transform: translateX(calc(-1 * var(--sidebar-w))); }
.main-content { transition: margin-left .3s ease; }
.sidebar-collapsed .main-content { margin-left: 0; }

/* ── Sidebar arrow toggle ── */
.sidebar-toggle-btn {
  position: fixed;
  top: 50%;
  left: var(--sidebar-w);
  transform: translateY(-50%);
  z-index: 300;
  width: 1.6rem;
  height: 3.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1rem;
  transition: left .3s ease, color .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}
.sidebar-toggle-btn:hover { color: var(--brand); }
.sidebar-collapsed .sidebar-toggle-btn { left: 0; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid var(--border);
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: var(--text);
}
.sidebar-brand .brand-icon {
  color: var(--brand);
  font-size: 1.4rem;
  margin-bottom: 0;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .7rem 1.25rem;
  font-size: .9rem;
  color: var(--text-muted);
  border-radius: 0;
  transition: all .2s;
  position: relative;
}
.nav-item:hover {
  background: var(--surface2);
  color: var(--text);
}
.nav-item.active {
  background: rgba(239,34,51,.22);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--gold);
}
.nav-item.active .nav-icon { color: var(--gold); }
.nav-icon {
  font-size: 1rem;
  width: 1.2rem;
  text-align: center;
}

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 1rem 1.25rem;
}
.user-info {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .75rem;
}
.user-avatar {
  width: 34px; height: 34px;
  background: var(--brand);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem;
  font-weight: 700;
}
.owner-avatar { background: var(--purple); color: #fff; }
.user-name { font-size: .85rem; font-weight: 600; }
.user-branch { font-size: .75rem; color: var(--text-muted); }

.btn-logout {
  width: 100%;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius);
  padding: .5rem;
  font-size: .8rem;
  cursor: pointer;
  transition: all .2s;
}
.btn-logout:hover { border-color: var(--brand); color: var(--brand); }

/* ── MAIN CONTENT ── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 2rem;
  min-height: 100vh;
  background: radial-gradient(125% 120% at 0% 0%, #2c0a0d 0%, var(--bg) 55%);
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2rem;
}
.page-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text);
}
.page-sub { color: var(--text-muted); font-size: .85rem; margin-top: .25rem; }
.header-actions { display: flex; align-items: center; gap: 1rem; }

/* ── STAT CARDS ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stats-grid-5 { grid-template-columns: repeat(5, 1fr); }

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  transition: transform .2s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.accent-gold::before  { background: var(--accent); }
.accent-green::before { background: var(--green); }
.accent-blue::before  { background: var(--blue); }
.accent-red::before   { background: var(--red); }
.accent-purple::before{ background: var(--purple); }

.stat-label { font-size: .75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; }
.stat-value {
  font-family: 'Playfair Display', serif;
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--text);
  margin: .4rem 0 .2rem;
}
.accent-gold .stat-value  { color: var(--accent); }
.accent-red .stat-value   { color: var(--red); }
.accent-green .stat-value { color: var(--green); }
.stat-sub { font-size: .75rem; color: var(--text-muted); }

/* ── SECTION CARD ── */
.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.section-header h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 700;
}

/* ── TABLE ── */
.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.data-table thead { background: var(--surface2); }
.data-table th {
  text-align: left;
  padding: .75rem 1rem;
  font-size: .72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: .9rem 1rem;
  border-bottom: 1px solid rgba(74,32,31,.5);
  color: var(--text);
}
.data-table tbody tr:hover { background: var(--surface2); }
.empty-row { text-align: center; color: var(--text-muted); padding: 2rem !important; }

/* ── BUTTONS ── */
.btn-small {
  background: var(--accent);
  color: var(--cta-text);
  border-radius: 7px;
  padding: .4rem .9rem;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s;
}
.btn-small:hover { background: var(--accent2); }

.btn-danger {
  background: transparent;
  border: 1px solid var(--red);
  color: var(--red);
  border-radius: 6px;
  padding: .3rem .7rem;
  font-size: .8rem;
  cursor: pointer;
  transition: all .2s;
}
.btn-danger:hover { background: var(--red); color: #fff; }

/* ── BADGE ── */
.badge {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
}
.badge-active  { background: rgba(61,220,132,.15);  color: var(--green); }
.badge-out     { background: rgba(201,184,184,.1);   color: var(--text-muted); }
.badge-sent    { background: rgba(74,163,255,.15);   color: var(--blue); }
.badge-warning { background: rgba(255,214,10,.16);   color: var(--accent); }
.badge-danger  { background: var(--red); color: #1a0808; font-weight: 700; animation: pulse-red 1.2s ease-in-out infinite; }
@keyframes pulse-red { 0%,100% { opacity:1; } 50% { opacity:.65; } }

/* ══════════════════════════════════════════
   CHECK-IN PAGE
══════════════════════════════════════════ */
.checkin-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 1.5rem;
  align-items: start;
}

.checkin-form-card h3,
.viber-preview-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.25rem;
}
.form-group label {
  display: block;
  font-size: .8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .5rem;
}
.form-group input,
.form-group select {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem 1rem;
  color: var(--text);
  font-size: .95rem;
  transition: border-color .2s;
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
}

/* Duration Options */
.duration-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .75rem;
}
.duration-option input { display: none; }
.duration-btn {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem .5rem;
  text-align: center;
  cursor: pointer;
  transition: all .12s;
  background: var(--surface2);
}
.duration-btn:hover { border-color: var(--brand); }
.duration-option input:checked + .duration-btn {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
  background: rgba(239,34,51,.14);
}
.dur-hours { display: block; font-weight: 700; font-size: .9rem; }
.dur-price { display: block; color: var(--accent); font-weight: 700; font-size: .8rem; margin-top: .2rem; }

/* Summary Box */
.checkin-summary {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--glow);
}
.summary-row {
  display: flex;
  justify-content: space-between;
  padding: .4rem 0;
  font-size: .9rem;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(74,32,31,.5);
}
.summary-row:last-child { border-bottom: none; }
.total-row { color: var(--text); font-weight: 600; margin-top: .25rem; }
.total-row span:last-child {
  color: var(--accent);
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 800;
}

.btn-full { margin-top: .5rem; }

/* Add Person counter */
.add-person-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding-top: .85rem;
  border-top: 1px solid var(--border);
}
.add-person-inline-label {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
}
.add-person-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.add-person-btn {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: all .2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.add-person-btn:hover  { border-color: var(--brand); color: var(--brand); }
.add-person-btn:active { transform: scale(.93); }
#personCount {
  font-size: 1.2rem;
  font-weight: 700;
  min-width: 1.5rem;
  text-align: center;
  color: var(--accent);
}

/* Viber Preview */
.viber-phone {
  background: #1a2033;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.viber-header {
  background: #6040a0;
  padding: .75rem 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .85rem;
  color: #fff;
}
.viber-dot {
  width: 8px; height: 8px;
  background: #fff;
  border-radius: 50%;
  opacity: .8;
}
.viber-bubble {
  padding: 1.25rem;
  font-size: .85rem;
  color: #c0c8e0;
  line-height: 1.6;
  white-space: pre-line;
  min-height: 120px;
}
.viber-content-info {
  font-size: .82rem;
  color: var(--text-muted);
}
.viber-content-info p { margin-bottom: .4rem; }
.viber-content-info li { padding: .2rem 0; padding-left: .75rem; position: relative; }
.viber-content-info li::before { content: '•'; position: absolute; left: 0; color: var(--brand); }

/* ══════════════════════════════════════════
   HISTORY PAGE
══════════════════════════════════════════ */
.shift-total-badge {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .5rem 1rem;
  font-size: .9rem;
  color: var(--text-muted);
}
.shift-total-badge strong { color: var(--accent); }

.search-input {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .45rem .9rem;
  color: var(--text);
  font-size: .85rem;
  width: 200px;
  transition: border-color .2s;
}
.search-input:focus { outline: none; border-color: var(--accent); }

/* ══════════════════════════════════════════
   OWNER PAGE
══════════════════════════════════════════ */
.sidebar-owner { background: var(--surface); border-right-color: var(--border); }
.sidebar-owner .nav-item.active { background: rgba(239,34,51,.22); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.sidebar-owner .brand-icon { color: var(--brand); }

.owner-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.owner-grid .full-width { grid-column: 1 / -1; }

/* Branch list */
.branch-list { display: flex; flex-direction: column; gap: .75rem; }
.branch-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.branch-name { font-weight: 600; font-size: .9rem; }
.branch-meta { font-size: .8rem; color: var(--text-muted); margin-top: .15rem; }
.branch-sales { color: var(--accent); font-family: 'Playfair Display', serif; font-size: 1.15rem; font-weight: 700; }

/* Staff bars */
.staff-bars { display: flex; flex-direction: column; gap: 1rem; }
.staff-bar-item { }
.staff-bar-header { display: flex; justify-content: space-between; font-size: .85rem; margin-bottom: .35rem; }
.staff-bar-name { color: var(--text); }
.staff-bar-val  { color: var(--accent); font-weight: 600; }
.staff-bar-track {
  background: var(--surface2);
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
}
.staff-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  border-radius: 4px;
  transition: width .6s ease;
}

/* ══════════════════════════════════════════
   MODALS
══════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.78);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity:0 } to { opacity:1 } }

.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 2rem;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  margin: 1rem;
  box-shadow: 0 24px 60px rgba(0,0,0,.55), var(--glow);
  animation: slideUp .25s ease;
}
@keyframes slideUp {
  from { opacity:0; transform:translateY(20px) }
  to   { opacity:1; transform:translateY(0) }
}

.modal-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .35rem;
}
.modal-sub {
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.policy-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin-bottom: 1rem;
}
.policy-item {
  font-size: .9rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: .6rem;
}
.policy-icon { font-size: 1.1rem; }

.checkout-reminder-msg {
  background: rgba(255,214,10,.07);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: .9rem 1.1rem;
  font-size: .95rem;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.policy-note {
  background: rgba(255,90,90,.1);
  border-left: 3px solid var(--red);
  border-radius: 4px;
  padding: .65rem 1rem;
  font-size: .82rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.policy-actions {
  display: flex;
  gap: .75rem;
}
.btn-agree, .btn-decline {
  flex: 1;
  border: none;
  border-radius: var(--radius);
  padding: .8rem 1rem;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .2s, transform .1s, background .2s;
  letter-spacing: .02em;
}
.btn-agree   { background: var(--accent); color: var(--cta-text); }
.btn-agree:hover { background: var(--accent2); }
.btn-decline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 600;
}
.btn-decline:hover { border-color: var(--text-muted); color: var(--text); }
.btn-agree:active, .btn-decline:active { transform: scale(.97); }

/* ══════════════════════════════════════════
   SIDEBAR — HIDDEN LOGOUT / LONG PRESS
══════════════════════════════════════════ */
.sidebar-brand { position: relative; overflow: hidden; user-select: none; }
.brand-progress {
  position: absolute;
  bottom: 0; left: 0;
  height: 2px;
  width: 0;
  background: var(--brand);
  border-radius: 2px;
}
.btn-logout.logout-reveal {
  animation: revealBtn .3s ease;
}
@keyframes revealBtn {
  from { opacity:0; transform:translateY(6px) }
  to   { opacity:1; transform:translateY(0) }
}

/* ══════════════════════════════════════════
   CHECK-IN — SINGLE COLUMN LAYOUT
══════════════════════════════════════════ */
.checkin-layout-single {
  max-width: 560px;
}
.checkin-form-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

/* ══════════════════════════════════════════
   HISTORY — COUNT BADGE
══════════════════════════════════════════ */
.count-badge {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .2rem .75rem;
  font-size: .8rem;
  color: var(--text-muted);
}

/* ══════════════════════════════════════════
   OWNER — FILTER BAR
══════════════════════════════════════════ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.filter-tabs {
  display: flex;
  gap: .35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .3rem;
}
.filter-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: .45rem 1rem;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.filter-tab:hover { color: var(--text); background: var(--surface2); }
.filter-tab.active { background: var(--brand); color: #fff; }

.date-picker {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .45rem .9rem;
  color: var(--text);
  font-size: .85rem;
  transition: border-color .2s;
}
.date-picker:focus { outline: none; border-color: var(--accent); }
.date-picker::-webkit-calendar-picker-indicator { filter: invert(0.7); cursor: pointer; }

.filter-label {
  font-size: .82rem;
  color: var(--text-muted);
  margin-left: auto;
  font-style: italic;
}

/* ══════════════════════════════════════════
   OWNER — BADGES & MISC
══════════════════════════════════════════ */
.filter-badge {
  background: rgba(255,214,10,.12);
  color: var(--accent);
  border-radius: 999px;
  padding: .2rem .7rem;
  font-size: .78rem;
  font-weight: 600;
}
.live-badge {
  background: rgba(61,220,132,.12);
  color: var(--green);
  border-radius: 999px;
  padding: .2rem .7rem;
  font-size: .78rem;
  font-weight: 600;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,100% { opacity:1 }
  50%      { opacity:.6 }
}
.no-data-msg {
  color: var(--text-muted);
  font-size: .85rem;
  padding: .5rem 0;
}
.staff-bar-sub {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: .2rem;
}
.stats-grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Active check-in row highlights */
.row-expired { background: rgba(255,90,90,.07) !important; }
.row-warning { background: rgba(255,214,10,.05) !important; }

/* ══════════════════════════════════════════
   OWNER — 3-COLUMN STATS GRID
══════════════════════════════════════════ */
.stats-grid-3 { grid-template-columns: repeat(3, 1fr); }

/* ══════════════════════════════════════════
   CHECK-IN — SCREEN SYSTEM
══════════════════════════════════════════ */
.checkin-main {
  display: flex;
  flex-direction: column;
  padding: 0;
}

.checkin-screen {
  flex: 1;
  min-height: calc(100vh - 0px);
}

/* Landing screen */
.checkin-landing-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(120deg, rgba(239,34,51,.16), transparent 60%),
    radial-gradient(ellipse at 50% 40%, rgba(239,34,51,.10) 0%, transparent 65%),
    var(--bg);
  min-height: 100vh;
}

.landing-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.25rem;
  padding: 2rem;
}

.landing-eyebrow {
  font-size: .8rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .18em;
}

.landing-brand-icon {
  font-size: 4rem;
  color: var(--brand);
  line-height: 1;
}

.landing-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(3.2rem, 9vw, 4.6rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: .01em;
  line-height: 1.02;
}

.landing-sub {
  color: var(--text-muted);
  font-size: 1.3rem;
  font-weight: 300;
  max-width: 460px;
}

.btn-checkin-big {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: var(--accent);
  color: var(--cta-text);
  border: none;
  border-radius: 16px;
  padding: 1.5rem 3.25rem;
  font-size: 1.6rem;
  font-weight: 700;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  letter-spacing: .02em;
  margin-top: 1rem;
  transition: background .2s, transform .15s;
  animation: glowpulse 2.6s ease-out infinite;
}
@keyframes glowpulse {
  0%   { box-shadow: 0 0 0 0 rgba(239,34,51,.5); }
  70%  { box-shadow: 0 0 0 22px rgba(239,34,51,0); }
  100% { box-shadow: 0 0 0 0 rgba(239,34,51,0); }
}
.btn-checkin-big:hover {
  background: var(--accent2);
  transform: translateY(-2px);
}
.btn-checkin-big:active { transform: scale(.97); }

.checkin-big-icon {
  font-size: 1.8rem;
  line-height: 1;
}

/* Thank-you screen */
.thankyou-icon {
  width: 130px; height: 130px;
  background: rgba(61,220,132,.15);
  border: 2px solid var(--green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.6rem;
  color: var(--green);
  animation: popIn .5s ease;
}
@keyframes popIn {
  0%   { opacity:0; transform:scale(.3) }
  60%  { opacity:1; transform:scale(1.12) }
  100% { opacity:1; transform:scale(1) }
}

.thankyou-sub {
  font-size: 1.2rem;
  color: var(--green);
}

/* Form screen layout */
#screenForm {
  padding: 2rem;
}

.checkin-layout-centered {
  display: flex;
  justify-content: center;
}

.checkin-layout-centered .checkin-form-card {
  width: 100%;
  max-width: 780px;
  padding: 2.5rem 2.75rem;
}

.checkin-layout-centered .checkin-form-card h3 {
  font-size: 1.25rem;
  margin-bottom: 1.75rem;
  text-align: center;
}

.checkin-layout-centered .form-group label {
  font-size: .85rem;
}

.checkin-layout-centered .form-group input {
  font-size: 1.05rem;
  padding: .9rem 1.1rem;
}

.checkin-layout-centered .duration-btn {
  padding: .9rem .5rem;
}
.checkin-layout-centered .dur-hours { font-size: 1rem; }
.checkin-layout-centered .dur-price { font-size: .85rem; }

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 1100px) {
  .stats-grid, .stats-grid-5 { grid-template-columns: repeat(2, 1fr); }
  .checkin-layout { grid-template-columns: 1fr; }
  .owner-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  :root { --sidebar-w: 60px; }
  .sidebar-brand span,
  .nav-item span:not(.nav-icon),
  .sidebar-footer .user-name,
  .sidebar-footer .user-branch { display: none; }
  /* Keep logout reachable for owner/staff on the slim rail — show it as a compact ⏻ icon */
  .btn-logout {
    padding: .5rem 0;
    font-size: 0;
    border-color: var(--border);
  }
  .btn-logout::before { content: '⏻'; font-size: 1.15rem; line-height: 1; }
  .sidebar-brand { justify-content: center; padding: 1rem .5rem; }
  .nav-item { justify-content: center; padding: .75rem; }
  .nav-icon { width: auto; font-size: 1.2rem; }
  .sidebar-footer { padding: .75rem; }
  .user-info { justify-content: center; }
  .main-content { padding: 1rem; }
  .duration-grid { grid-template-columns: repeat(2, 1fr); }
  .login-bg { flex-direction: column; }
  .login-card { width: 100%; min-height: auto; }
  .login-deco { display: none; }
}
