/* ============================================================
   ASF CLUB KARACHI — Design System
   ============================================================ */

:root {
  --navy: #1F3A60;
  --navy-deep: #142942;
  --blue: #3975B7;
  --gold: #FFD700;
  --gold-dim: #C9A800;
  --crimson: #73000A;
  --silver: #C0C0C0;
  --off-white: #F7F6F3;
  --white: #FFFFFF;
  --ink: #1A1E24;

  --font-display: 'Cormorant Garamond', serif;
  --font-body: 'Inter', sans-serif;

  --radius: 4px;
  --shadow-card: 0 1px 3px rgba(20, 41, 66, 0.12), 0 1px 2px rgba(20, 41, 66, 0.08);
  --shadow-elevated: 0 8px 24px rgba(20, 41, 66, 0.18);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  background: var(--off-white);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--navy-deep);
  margin: 0 0 0.35em 0;
  letter-spacing: 0.01em;
}

p { margin: 0 0 1em 0; line-height: 1.55; }
a { color: var(--blue); text-decoration: none; }

.hidden { display: none !important; }

/* ---------- Buttons ---------- */
button { font-family: var(--font-body); cursor: pointer; border: none; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.65em 1.4em;
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-weight: 600;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--navy-deep); }
.btn-gold { background: var(--gold); color: var(--navy-deep); }
.btn-gold:hover { background: var(--gold-dim); }
.btn-secondary { background: transparent; color: var(--navy); border: 1px solid var(--silver); }
.btn-secondary:hover { border-color: var(--navy); }
.btn-ghost { background: transparent; color: var(--blue); padding: 0.5em 0.8em; }
.btn-ghost:hover { text-decoration: underline; }
.btn-danger { background: var(--crimson); color: var(--white); }
.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 0.4em 0.9em; font-size: 0.82rem; }

/* ---------- Cards ---------- */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 1.5rem;
  border: 1px solid rgba(31, 58, 96, 0.07);
}
.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25em 0.7em;
  border-radius: 3px;
  letter-spacing: 0.02em;
}
.badge-gold { background: rgba(255, 215, 0, 0.16); color: #8a6d00; border: 1px solid rgba(255, 215, 0, 0.45); }
.badge-navy { background: rgba(31, 58, 96, 0.09); color: var(--navy); border: 1px solid rgba(31, 58, 96, 0.25); }
.badge-blue { background: rgba(57, 117, 183, 0.1); color: var(--blue); border: 1px solid rgba(57, 117, 183, 0.3); }
.badge-crimson { background: rgba(115, 0, 10, 0.08); color: var(--crimson); border: 1px solid rgba(115, 0, 10, 0.25); }
.badge-green { background: #e7f3ea; color: #1e6b34; border: 1px solid #b9dcc2; }

/* ---------- Forms ---------- */
label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--navy-deep); margin-bottom: 0.4em; }
input, select, textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.65em 0.8em;
  border: 1px solid #D7D9DD;
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
  border-color: var(--blue);
}
.field { margin-bottom: 1.1rem; }

/* ---------- Table ---------- */
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid rgba(31, 58, 96, 0.15);
  padding: 0.6em 0.7em;
}
td {
  padding: 0.75em 0.7em;
  border-bottom: 1px solid #EDEEF0;
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(20, 41, 66, 0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
}
.modal {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-elevated);
  width: 460px;
  max-width: 92vw;
  max-height: 86vh;
  overflow-y: auto;
  padding: 1.75rem;
}

/* ---------- Crest ---------- */
.crest {
  width: 46px; height: 46px;
  border-radius: 50%;
  flex-shrink: 0;
}
.crest-lg { width: 84px; height: 84px; }

/* ============================================================
   APP SHELL
   ============================================================ */

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 244px;
  flex-shrink: 0;
  background: var(--navy-deep);
  color: var(--white);
  display: flex;
  flex-direction: column;
  padding: 1.4rem 0;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 0.7em;
  padding: 0 1.3rem 1.3rem 1.3rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 0.8rem;
}
.sidebar-brand .brand-text { font-family: var(--font-display); font-size: 1.05rem; line-height: 1.15; color: var(--gold); }
.sidebar-brand .brand-text small { display: block; font-family: var(--font-body); font-size: 0.62rem; color: var(--silver); letter-spacing: 0.06em; }

.nav-group { flex: 1; overflow-y: auto; padding: 0 0.7rem; }
.nav-item {
  display: flex; align-items: center; gap: 0.75em;
  padding: 0.65em 0.9em;
  border-radius: var(--radius);
  color: rgba(255,255,255,0.72);
  font-size: 0.88rem;
  cursor: pointer;
  margin-bottom: 0.15rem;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: var(--white); }
.nav-item.active { background: var(--gold); color: var(--navy-deep); font-weight: 600; }
.nav-icon { width: 18px; text-align: center; opacity: 0.85; }

.sidebar-footer { padding: 1rem 1.3rem 0 1.3rem; border-top: 1px solid rgba(255,255,255,0.1); margin-top: 0.8rem; }
.mode-switch-link { font-size: 0.78rem; color: var(--silver); cursor: pointer; }
.mode-switch-link:hover { color: var(--gold); }

.main-col { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: 62px;
  background: var(--white);
  border-bottom: 1px solid #E4E6E9;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.6rem;
}
.topbar-title { font-family: var(--font-display); font-size: 1.3rem; color: var(--navy-deep); }
.topbar-right { display: flex; align-items: center; gap: 1.1rem; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--off-white);
  color: var(--navy);
  font-size: 1rem;
  position: relative;
}
.icon-btn .dot { position: absolute; top: 3px; right: 3px; width: 8px; height: 8px; border-radius: 50%; background: var(--crimson); border: 2px solid var(--white); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--navy); color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700;
}

.content { padding: 1.8rem 2rem 3rem 2rem; }

/* Grid helpers */
.grid { display: grid; gap: 1.1rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }

.stat-card { padding: 1.3rem; }
.stat-card .stat-label { font-size: 0.76rem; color: #6B7280; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 0.5em; }
.stat-card .stat-value { font-family: var(--font-display); font-size: 2rem; color: var(--navy-deep); font-weight: 700; }
.stat-card .stat-delta { font-size: 0.78rem; color: #1e6b34; margin-top: 0.3em; }

/* ---------- Landing / Login ---------- */
.landing {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--navy-deep) 0%, var(--navy) 62%, #24507e 100%);
  padding: 2rem;
}
.landing-panel {
  background: var(--white);
  border-radius: 6px;
  box-shadow: var(--shadow-elevated);
  width: 420px;
  max-width: 100%;
  padding: 2.6rem 2.4rem 2.2rem 2.4rem;
  text-align: center;
}
.landing-panel .crest-lg { margin: 0 auto 1rem auto; display: block; }
.landing-tagline { color: var(--gold-dim); font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 1.6rem; }
.login-tabs { display: flex; border: 1px solid #E4E6E9; border-radius: var(--radius); overflow: hidden; margin-bottom: 1.4rem; }
.login-tab { flex: 1; padding: 0.6em; font-size: 0.85rem; font-weight: 600; background: var(--off-white); color: #6B7280; }
.login-tab.active { background: var(--navy); color: var(--white); }

/* ---------- Announcement / booking list items ---------- */
.list-item { display: flex; align-items: center; gap: 0.9rem; padding: 0.85rem 0; border-bottom: 1px solid #EDEEF0; }
.list-item:last-child { border-bottom: none; }
.list-item-icon {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(57, 117, 183, 0.1); color: var(--blue);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.list-item-body { flex: 1; min-width: 0; }
.list-item-title { font-weight: 600; font-size: 0.9rem; color: var(--navy-deep); }
.list-item-sub { font-size: 0.8rem; color: #6B7280; }

.quick-action {
  display: flex; align-items: center; gap: 0.7em;
  padding: 0.8em 1em;
  border: 1px solid #E4E6E9;
  border-radius: var(--radius);
  font-size: 0.85rem; font-weight: 600; color: var(--navy);
  margin-bottom: 0.6rem;
}
.quick-action:hover { border-color: var(--blue); background: rgba(57,117,183,0.04); }

.section-gap { margin-bottom: 1.1rem; }
