*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --accent-100: #fde8e4;
  --accent-200: #f9c4bb;
  --accent-400: #ef8a78;
  --accent-500: #e86f5a;
  --secondary-100: #e8edf5;
  --secondary-200: #c5d4ea;
  --secondary-400: #6b8fc4;
  --secondary-500: #4a6fa5;
  --green-100: var(--accent-100);
  --green-400: var(--accent-400);
  --green-500: var(--accent-500);
  --blue-100: var(--secondary-100);
  --blue-400: var(--secondary-400);
  --blue-500: var(--secondary-500);
  --text-primary: #1a2332;
  --text-secondary: #6b7a90;
  --text-muted: #9aa8b8;
  --border: #e2e8f0;
  --white: #ffffff;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 10px;
  --radius-lg: 16px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, var(--accent-100) 0%, var(--secondary-100) 100%);
  min-height: 100vh;
  color: var(--text-primary);
}

html { overflow-y: scroll; scrollbar-gutter: stable; }
#siteHeader {
  height: 73px;
  min-height: 73px;
  flex-shrink: 0;
}
#siteFooter {
  height: 81px;
  min-height: 81px;
  max-height: 81px;
  overflow: hidden;
  flex-shrink: 0;
}
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; min-height: 48px; }
.logo-mark { height: 48px; width: 48px; flex-shrink: 0; display: inline-flex; color: var(--accent-500); }
.logo-mark-svg { width: 100%; height: 100%; display: block; }
.logo.has-org-logo .logo-mark,
.logo.has-org-logo [data-chedule-logo] { display: none; }
.org-logo,
.header-org-logo,
.display-org-logo,
.login-brand .org-logo,
.kiosk-org-brand .org-logo,
.public-brand img.org-logo,
.site-header .org-logo {
  width: auto;
  height: 40px;
  max-width: 140px;
  max-height: 40px;
  object-fit: contain;
  object-position: left center;
  border-radius: 8px;
  flex-shrink: 0;
}
.display-org-logo { height: 48px; max-height: 48px; max-width: 160px; }
.logo-text {
  font-size: calc(18px * 48 / 30.8);
  font-weight: 700;
  line-height: 48px;
}

.btn-primary {
  padding: 12px 20px; border: none; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent-500) 0%, var(--secondary-500) 100%);
  color: var(--white); font-size: 0.9375rem; font-weight: 600; font-family: inherit;
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
  transition: opacity 0.2s, transform 0.15s;
}
.btn-primary:hover { opacity: 0.92; transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-secondary {
  padding: 10px 16px; border: 1.5px solid var(--border); border-radius: var(--radius);
  background: var(--white); color: var(--text-primary); font-size: 0.875rem; font-weight: 500;
  font-family: inherit; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center;
  transition: border-color 0.2s, background 0.2s;
}
.btn-secondary:hover { border-color: var(--accent-400); background: var(--accent-100); }

.btn-danger { background: var(--danger); color: white; border: none; }
.btn-success { background: var(--success); color: white; border: none; }
.btn-sm { padding: 6px 12px; font-size: 0.75rem; }

.page-shell { max-width: 1200px; margin: 0 auto; padding: 24px; flex: 1 0 auto; width: 100%; }

.page-card {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(232, 111, 90, 0.12), 0 8px 24px rgba(74, 111, 165, 0.08);
  overflow: hidden;
}

.app-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 28px; border-bottom: 1px solid var(--border); background: var(--white);
}
.app-header h1 { font-size: 1.375rem; font-weight: 700; }
.app-header p { font-size: 0.875rem; color: var(--text-secondary); margin-top: 4px; }
.app-header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.app-content { padding: 28px; }

.site-header { background: rgba(255,255,255,0.95); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); height: 73px; }
.site-header-inner { max-width: 1200px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: nowrap; height: 72px; }
.site-nav { display: flex; gap: 4px; flex-wrap: nowrap; }
.site-nav a { padding: 8px 14px; border-radius: var(--radius); text-decoration: none; color: var(--text-secondary); font-size: 0.875rem; font-weight: 500; transition: background 0.2s, color 0.2s; }
.site-nav a:hover, .site-nav a.active { background: var(--accent-100); color: var(--accent-500); }
.site-header-actions { display: flex; align-items: center; gap: 12px; }
.site-footer { margin-top: auto; padding: 32px 24px; border-top: 1px solid var(--border); background: rgba(255,255,255,0.6); height: 81px; box-sizing: border-box; }
.profile-name { white-space: nowrap; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.site-footer-inner { max-width: 1200px; margin: 0 auto; font-size: 0.8125rem; color: var(--text-muted); text-align: center; }

.profile-menu { position: relative; }
.profile-trigger { display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; border: 1.5px solid var(--border); border-radius: 999px; background: var(--white); cursor: pointer; font-family: inherit; }
.profile-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--accent-500), var(--secondary-500)); color: white; display: flex; align-items: center; justify-content: center; font-size: 0.8125rem; font-weight: 700; }
.profile-dropdown { position: absolute; top: calc(100% + 8px); right: 0; width: 260px; background: white; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 12px 40px rgba(26,35,50,0.12); opacity: 0; visibility: hidden; transform: translateY(-8px); transition: 0.2s; z-index: 100; }
.profile-menu.open .profile-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.data-panel.users-panel { margin-top: 8px; }
.data-panel.admin-staff-users { margin-top: 40px; }
.profile-dropdown-header { padding: 16px; border-bottom: 1px solid var(--border); }
.profile-dropdown-edit { padding: 6px 16px 8px; }
.btn-signout { width: 100%; padding: 10px; border: 1.5px solid var(--border); border-radius: var(--radius); background: white; cursor: pointer; font-family: inherit; margin: 12px 16px; width: calc(100% - 32px); }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.8125rem; font-weight: 600; margin-bottom: 6px; color: var(--text-secondary); }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: var(--radius);
  font-size: 0.9375rem; font-family: inherit; background: white; transition: border-color 0.2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { outline: none; border-color: var(--accent-400); box-shadow: 0 0 0 3px rgba(232,111,90,0.12); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }

.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table th, .data-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.data-table th { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.data-table tr:hover td { background: #fafbfc; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #f8fafc; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.stat-label { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 6px; }
.stat-value { font-size: 1.375rem; font-weight: 700; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 24px; flex-wrap: wrap; }
.tab-btn { padding: 10px 16px; border: none; background: none; font-family: inherit; font-size: 0.875rem; font-weight: 500; color: var(--text-secondary); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab-btn.active { color: var(--accent-500); border-bottom-color: var(--accent-500); }

.status-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.status-waiting { background: #fef3c7; color: #92400e; }
.status-called { background: #dbeafe; color: #1e40af; }
.status-in_service { background: #d1fae5; color: #065f46; }
.status-completed { background: #e5e7eb; color: #374151; }
.status-cancelled, .status-no_show { background: #fee2e2; color: #991b1b; }

.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 0.875rem; }
.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.alert-info { background: var(--secondary-100); border: 1px solid var(--secondary-200); color: var(--secondary-500); }

.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty-state h3 { font-size: 1rem; color: var(--text-secondary); margin-bottom: 8px; }

.pin-overlay { position: fixed; inset: 0; background: rgba(26,35,50,0.6); display: flex; align-items: center; justify-content: center; z-index: 200; }
.pin-card { position: relative; background: white; border-radius: var(--radius-lg); padding: 20px 28px 28px; max-width: 360px; width: 90%; text-align: center; }
.pin-card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 10px; text-align: left; }
.pin-card-header h2 { margin: 0; flex: 1; color: var(--text-primary, #1a2332); font-size: 1.125rem; line-height: 1.3; }
.pin-close {
  width: 32px; height: 32px; border: none; border-radius: 8px; background: #f8fafc;
  color: var(--text-primary, #1a2332); font-size: 1.25rem; line-height: 1; cursor: pointer; font-family: inherit; flex-shrink: 0;
}
.pin-close:hover { background: var(--accent-100); color: var(--accent-500); }
.pin-card > h2 { margin-bottom: 8px; color: var(--text-primary, #1a2332); }
.pin-card p { color: var(--text-secondary); font-size: 0.875rem; margin-bottom: 20px; }
.pin-input { font-size: 1.5rem; letter-spacing: 0.5em; text-align: center; color: transparent; caret-color: transparent; -webkit-text-fill-color: transparent; }
.pin-card .pin-input { background: #fff; }

.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.app-tile { display: block; padding: 24px; background: white; border: 1.5px solid var(--border); border-radius: var(--radius-lg); text-decoration: none; color: inherit; transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s; }
.app-tile:hover { border-color: var(--accent-400); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(232,111,90,0.1); }
.app-tile-icon { width: 48px; height: 48px; border-radius: 12px; background: linear-gradient(135deg, var(--accent-100), var(--secondary-100)); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; margin-bottom: 12px; }
.app-tile h3 { font-size: 1rem; margin-bottom: 6px; }
.app-tile p { font-size: 0.8125rem; color: var(--text-secondary); line-height: 1.4; }

.connection-banner { position: fixed; bottom: 0; left: 0; right: 0; background: #fef3c7; color: #92400e; text-align: center; padding: 8px; font-size: 0.8125rem; z-index: 300; display: none; }
.connection-banner.visible { display: block; }

/* LAS-style modals */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(26, 35, 50, 0.45);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  opacity: 0; visibility: hidden; transition: opacity 0.2s, visibility 0.2s; z-index: 1000;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal-dialog {
  width: 100%; max-width: 560px; background: var(--white); border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgba(26, 35, 50, 0.2); overflow: hidden; max-height: 90vh; display: flex; flex-direction: column;
}
.modal-dialog.modal-wide { max-width: 680px; }
.modal-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.modal-form-row .form-group { margin-bottom: 0; }
@media (max-width: 560px) {
  .modal-form-row { grid-template-columns: 1fr; }
}
.form-group.is-hidden,
.form-group[hidden] { display: none !important; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.modal-header h2 { font-size: 1.125rem; font-weight: 700; margin: 0; }
.modal-close {
  width: 32px; height: 32px; border: none; border-radius: 8px; background: #f8fafc;
  color: var(--text-secondary); font-size: 1.25rem; cursor: pointer; font-family: inherit;
}
.modal-close:hover { background: var(--accent-100); color: var(--accent-500); }
.modal-body { padding: 22px; overflow-y: auto; flex: 1; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px;
  border-top: 1px solid var(--border); flex-shrink: 0;
}
.modal-note { font-size: 0.8125rem; color: var(--text-secondary); margin-bottom: 16px; line-height: 1.5; }
.modal-status { font-size: 0.8125rem; margin-top: 12px; }
.modal-status.is-error { color: #b91c1c; }
.admin-self-assign-panel {
  margin-top: 4.5rem;
  min-height: 2.75rem;
}
.checkbox-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.checkbox-grid label { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; font-weight: 400; }
.photo-preview { width: 120px; height: 120px; border-radius: var(--radius); object-fit: cover; border: 1px solid var(--border); margin-top: 8px; }
.kiosk-exit-btn {
  position: fixed; top: 12px; right: 12px; z-index: 150; padding: 8px 14px;
  border: 1px solid var(--border); border-radius: var(--radius); background: rgba(255,255,255,0.95);
  font-size: 0.8125rem; font-weight: 600; font-family: inherit; cursor: pointer;
  color: var(--text-primary, #1a2332);
}
body.display-mode .kiosk-exit-btn {
  background: rgba(30, 41, 59, 0.95); border-color: #64748b; color: #f8fafc;
}
.kiosk-layout { display: grid; grid-template-columns: 1fr 220px; gap: 24px; align-items: start; }
.kiosk-qr-panel { text-align: center; padding: 16px; background: #f8fafc; border-radius: var(--radius); border: 1px solid var(--border); }
.kiosk-qr-panel img { width: 140px; height: 140px; display: block; margin: 0 auto 8px; }
.kiosk-qr-panel p { font-size: 0.75rem; color: var(--text-muted); line-height: 1.4; }
@media (max-width: 768px) {
  .kiosk-layout { grid-template-columns: 1fr; }
  .kiosk-qr-panel { order: -1; }
}

@media (max-width: 768px) {
  .form-row { grid-template-columns: 1fr; }
  .app-header { flex-direction: column; align-items: flex-start; }
}
