/* ============================================================
   Darling's Waterfront Ticket Management — Shared Styles
   ============================================================ */

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

:root {
  --navy:       #1a3a5c;
  --navy-dark:  #0f2640;
  --blue:       #2563eb;
  --blue-light: #3b82f6;
  --blue-pale:  #eff6ff;
  --green:      #16a34a;
  --green-pale: #f0fdf4;
  --red:        #dc2626;
  --red-pale:   #fef2f2;
  --amber:      #d97706;
  --amber-pale: #fffbeb;
  --gray-50:    #f8fafc;
  --gray-100:   #f1f5f9;
  --gray-200:   #e2e8f0;
  --gray-300:   #cbd5e1;
  --gray-400:   #94a3b8;
  --gray-500:   #64748b;
  --gray-600:   #475569;
  --gray-700:   #334155;
  --gray-800:   #1e293b;
  --gray-900:   #0f172a;
  --white:      #ffffff;
  --shadow-sm:  0 1px 2px rgba(0,0,0,.05);
  --shadow:     0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:  0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg:  0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
  --radius:     8px;
  --radius-lg:  12px;
  --font:       -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html { font-size: 16px; }
body { font-family: var(--font); background: var(--gray-50); color: var(--gray-800); line-height: 1.5; min-height: 100vh; }

/* ── Typography ── */
h1 { font-size: 1.75rem; font-weight: 700; color: var(--gray-900); }
h2 { font-size: 1.375rem; font-weight: 600; color: var(--gray-800); }
h3 { font-size: 1.1rem; font-weight: 600; color: var(--gray-700); }
p  { color: var(--gray-600); }

/* ── Layout ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }

/* ── Header / Nav ── */
.app-header {
  background: var(--navy);
  color: var(--white);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}
.app-header .brand { font-size: 1rem; font-weight: 700; letter-spacing: .01em; }
.app-header .brand span { font-weight: 400; opacity: .75; font-size: .875rem; margin-left: .5rem; }
.app-header .header-right { display: flex; align-items: center; gap: 1rem; }
.app-header .user-info { font-size: .875rem; opacity: .9; }
.app-header .admin-link {
  background: rgba(255,255,255,.15);
  color: var(--white);
  border: 1px solid rgba(255,255,255,.3);
  padding: .3rem .75rem;
  border-radius: var(--radius);
  font-size: .8rem;
  font-weight: 500;
  text-decoration: none;
  transition: background .15s;
}
.app-header .admin-link:hover { background: rgba(255,255,255,.25); }

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: .25rem;
  padding: 1rem 0 0;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 1.5rem;
}
.tab-btn {
  background: none;
  border: none;
  padding: .625rem 1.25rem;
  font-size: .9rem;
  font-weight: 500;
  color: var(--gray-500);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  border-radius: var(--radius) var(--radius) 0 0;
  transition: color .15s, border-color .15s;
}
.tab-btn:hover { color: var(--navy); }
.tab-btn.active { color: var(--navy); border-bottom-color: var(--navy); font-weight: 600; }

/* ── Cards ── */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--gray-100);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  padding: .5rem 1rem;
  font-size: .875rem;
  font-weight: 500;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary   { background: var(--navy); color: var(--white); border-color: var(--navy); }
.btn-primary:hover:not(:disabled)   { background: var(--navy-dark); }
.btn-blue      { background: var(--blue); color: var(--white); border-color: var(--blue); }
.btn-blue:hover:not(:disabled)      { background: var(--blue-light); }
.btn-success   { background: var(--green); color: var(--white); border-color: var(--green); }
.btn-success:hover:not(:disabled)   { opacity: .9; }
.btn-danger    { background: var(--red); color: var(--white); border-color: var(--red); }
.btn-danger:hover:not(:disabled)    { opacity: .9; }
.btn-outline   { background: var(--white); color: var(--gray-700); border-color: var(--gray-300); }
.btn-outline:hover:not(:disabled)   { background: var(--gray-50); border-color: var(--gray-400); }
.btn-sm { padding: .3rem .7rem; font-size: .8rem; }
.btn-lg { padding: .75rem 1.5rem; font-size: 1rem; }
.btn-ms {
  background: #0078d4;
  color: var(--white);
  border-color: #0078d4;
  padding: .75rem 1.5rem;
  font-size: 1rem;
  gap: .625rem;
}
.btn-ms:hover { background: #106ebe; }
.btn-ms svg { width: 20px; height: 20px; flex-shrink: 0; }

/* ── Forms ── */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: .875rem; font-weight: 500; color: var(--gray-700); margin-bottom: .375rem; }
.form-control {
  width: 100%;
  padding: .5rem .75rem;
  font-size: .875rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--gray-800);
  transition: border-color .15s, box-shadow .15s;
  font-family: var(--font);
}
.form-control:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.form-control::placeholder { color: var(--gray-400); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th {
  text-align: left;
  padding: .625rem .875rem;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gray-500);
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}
td { padding: .625rem .875rem; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--blue-pale); }
.tr-clickable { cursor: pointer; }

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: .2rem .6rem;
  font-size: .75rem;
  font-weight: 600;
  border-radius: 9999px;
}
.badge-green  { background: var(--green-pale); color: var(--green); }
.badge-red    { background: var(--red-pale);   color: var(--red); }
.badge-blue   { background: var(--blue-pale);  color: var(--blue); }
.badge-amber  { background: var(--amber-pale); color: var(--amber); }
.badge-gray   { background: var(--gray-100);   color: var(--gray-600); }

/* ── Slots grid ── */
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .625rem; }
.slot-item {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: .5rem .75rem;
  display: flex;
  align-items: center;
  gap: .625rem;
  background: var(--white);
  font-size: .85rem;
}
.slot-item.assigned { border-color: var(--green); background: var(--green-pale); }
.slot-item.empty    { border-style: dashed; background: var(--gray-50); }
.slot-num { font-weight: 700; color: var(--gray-500); min-width: 2rem; font-size: .8rem; flex-shrink: 0; }
.slot-name { font-weight: 500; color: var(--gray-800); }
.slot-empty-label { flex: 1; color: var(--gray-400); font-style: italic; }

/* ── Preference slots ── */
.pref-slots { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1.5rem; }
.pref-slot {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.pref-slot.filled { border-color: var(--navy); background: var(--blue-pale); }
.pref-rank {
  width: 2rem; height: 2rem;
  background: var(--navy);
  color: var(--white);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .875rem;
  flex-shrink: 0;
}
.pref-slot.filled .pref-rank { background: var(--green); }
.pref-concert-name { flex: 1; font-weight: 500; }
.pref-concert-date { font-size: .8rem; color: var(--gray-500); }
.pref-slot-empty { color: var(--gray-400); font-style: italic; flex: 1; }

/* ── Concert list (employee) ── */
.concert-list { display: flex; flex-direction: column; gap: .5rem; }
.concert-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .875rem 1rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .15s;
  box-shadow: var(--shadow-sm);
}
.concert-card:hover { border-color: var(--navy); box-shadow: var(--shadow); }
.concert-card.selected { border-color: var(--green); background: var(--green-pale); }
.concert-date-badge {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 52px; height: 52px;
  background: var(--navy); color: var(--white);
  border-radius: var(--radius);
  font-size: .7rem;
  text-align: center;
  line-height: 1.2;
  flex-shrink: 0;
}
.concert-date-badge .month { font-weight: 600; text-transform: uppercase; font-size: .65rem; opacity: .9; }
.concert-date-badge .day-num { font-size: 1.25rem; font-weight: 800; line-height: 1; }
.concert-info { flex: 1; }
.concert-name { font-weight: 600; color: var(--gray-800); }
.concert-sub  { font-size: .8rem; color: var(--gray-500); margin-top: .1rem; }
.concert-rank-badge {
  width: 28px; height: 28px;
  background: var(--green); color: var(--white);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .8rem;
  flex-shrink: 0;
}

/* ── Alerts ── */
.alert {
  padding: .875rem 1rem;
  border-radius: var(--radius);
  font-size: .875rem;
  display: flex;
  align-items: flex-start;
  gap: .625rem;
  margin-bottom: 1rem;
}
.alert-info    { background: var(--blue-pale);  border: 1px solid #bfdbfe; color: #1e40af; }
.alert-success { background: var(--green-pale); border: 1px solid #bbf7d0; color: #166534; }
.alert-warning { background: var(--amber-pale); border: 1px solid #fde68a; color: #92400e; }
.alert-error   { background: var(--red-pale);   border: 1px solid #fecaca; color: #991b1b; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 500;
  padding: 1rem;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-200);
}
.modal-header h2 { font-size: 1.1rem; }
.modal-body { padding: 1.25rem 1.5rem; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: .625rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--gray-200);
}
.btn-close {
  background: none; border: none; cursor: pointer;
  color: var(--gray-400); font-size: 1.25rem; line-height: 1;
  padding: .25rem;
  transition: color .15s;
}
.btn-close:hover { color: var(--gray-700); }

/* ── Loading / empty states ── */
.loading { text-align: center; padding: 3rem 1rem; color: var(--gray-400); }
.loading-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto .75rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { text-align: center; padding: 3rem 1rem; }
.empty-state-icon { font-size: 3rem; margin-bottom: .75rem; opacity: .4; }
.empty-state h3 { color: var(--gray-600); font-weight: 500; }
.empty-state p  { font-size: .875rem; margin-top: .25rem; }

/* ── Login page ── */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 60%, #1e4d7b 100%);
  padding: 1.5rem;
}
.login-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  width: 100%; max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  text-align: center;
}
.login-logo {
  font-size: 2.5rem;
  margin-bottom: .75rem;
}
.login-card h1 { font-size: 1.375rem; margin-bottom: .25rem; }
.login-card .subtitle { font-size: .9rem; color: var(--gray-500); margin-bottom: 2rem; }
.login-divider { margin: 1.5rem 0; color: var(--gray-400); font-size: .8rem; position: relative; }
.login-divider::before, .login-divider::after {
  content: ''; position: absolute; top: 50%;
  width: calc(50% - 2rem); height: 1px;
  background: var(--gray-200);
}
.login-divider::before { left: 0; }
.login-divider::after  { right: 0; }
.login-guest-form { text-align: left; }
.login-error { color: var(--red); font-size: .85rem; margin-top: 1rem; min-height: 1.25rem; }

/* ── Section headers ── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem;
}
.section-header h2 { margin: 0; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .app-header .brand span { display: none; }
  .container { padding: 0 1rem; }
  h1 { font-size: 1.375rem; }
  .slot-grid { grid-template-columns: 1fr 1fr; }
  .modal { max-width: 100%; }
}

/* ── Utilities ── */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: .25rem; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: .75rem; }
.gap-4 { gap: 1rem; }
.mt-1 { margin-top: .25rem; }
.mt-2 { margin-top: .5rem; }
.mt-3 { margin-top: .75rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: .25rem; }
.mb-2 { margin-bottom: .5rem; }
.mb-3 { margin-bottom: .75rem; }
.mb-4 { margin-bottom: 1rem; }
.text-sm { font-size: .875rem; }
.text-xs { font-size: .75rem; }
.text-muted { color: var(--gray-500); }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.w-full { width: 100%; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.page-content { padding: 1.5rem 0; }
