/* ============================================================
   HKM Admin Portal - Main Stylesheet
   Font: Montserrat | Primary: #264454 | Accent: #E8704F
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');

/* --- CSS Variables --- */
:root {
  --color-primary: #264454;
  --color-accent: #E8704F;
  --color-accent-hover: #d4603f;
  --color-bg: #f5f5f2;
  --color-white: #ffffff;
  --color-text: #1a1a1a;
  --color-text-muted: #6b7280;
  --color-border: #e5e7eb;
  --color-card-bg: #ffffff;
  --color-nav-bg: #264454;
  --color-tag-bg: #f0f0ed;
  --color-tag-border: #d1d5db;
  --border-radius-sm: 6px;
  --border-radius-md: 12px;
  --border-radius-lg: 20px;
  --border-radius-pill: 50px;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-nav: 0 2px 8px rgba(0,0,0,0.15);
  --font: 'Montserrat', sans-serif;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  font-family: var(--font);
  background-color: var(--color-bg);
  color: var(--color-text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
}

input, textarea, select, button {
  font-family: var(--font);
}

/* ============================================================
   NAVBAR / HEADER
   ============================================================ */
.navbar {
  background-color: var(--color-primary);
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 40px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  box-shadow: var(--shadow-nav);
}

.navbar-inner {
  width: 100%;
  max-width: 1400px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: 8px;
  flex-shrink: 0;
}

.navbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.navbar-brand-text {
  display: flex;
  flex-direction: column;
}

.navbar-brand-title {
  color: white;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.navbar-brand-sub {
  color: white;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 15px;
  flex: 1;
}

.navbar-nav a {
  color: white;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--border-radius-pill);
  transition: all 0.2s;
  white-space: nowrap;
}

.navbar-nav a:hover {
  color: white;
  background-color: rgba(255,255,255,0.1);
}

.navbar-nav a.active {
  background-color: var(--color-accent);
  color: white;
  font-weight: 600;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}



.btn-signout {
  display: flex;
  align-items: center;
  gap: 6px;
  color: white;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--border-radius-pill);
  border: 1px solid white;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-signout:hover {
  background: rgba(255,255,255,0.1);
  color: white;
}

.btn-visit-site {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: var(--border-radius-pill);
  background: white;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  white-space: nowrap;
}

.btn-visit-site:hover {
  background: rgba(255,255,255,0.9);
}

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.main-wrapper {
  padding-top: 52px;
  min-height: 100vh;
}

.page-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px;
}

/* ============================================================
   PAGE HEADINGS
   ============================================================ */
h1.page-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 28px;
}

/* ============================================================
   DASHBOARD CARDS
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--color-card-bg);
  border-radius: var(--border-radius-md);
  padding: 24px 22px;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(0,0,0,0.04);
}

.stat-card-icon {
  color: var(--color-accent);
  margin-bottom: 12px;
  opacity: 0.85;
}

.stat-card-icon svg {
  width: 22px;
  height: 22px;
  stroke: var(--color-accent);
  fill: none;
  stroke-width: 1.8;
}

.stat-card-number {
  font-size: 30px;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-card-label {
  font-size: 12px;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* ============================================================
   DASHBOARD PANELS
   ============================================================ */
.panels-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-card {
  background: var(--color-card-bg);
  border-radius: var(--border-radius-md);
  padding: 24px;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(0,0,0,0.04);
}

.panel-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 18px;
}

.panel-card-title svg {
  width: 16px;
  height: 16px;
  stroke: var(--color-accent);
  fill: none;
  stroke-width: 2;
}

.panel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 13px;
}

.panel-row:last-of-type {
  border-bottom: none;
}

.panel-row-label {
  color: var(--color-text-muted);
  font-weight: 400;
}

.panel-row-value {
  color: var(--color-primary);
  font-weight: 600;
}

.panel-row-bar {
  height: 3px;
  background: #f3ebe7;
  border-radius: 2px;
  margin-top: 4px;
  width: 100%;
}

.panel-row-bar-fill {
  height: 100%;
  background: var(--color-accent);
  border-radius: 2px;
  width: 0%;
}

.panel-empty {
  color: var(--color-text-muted);
  font-size: 12.5px;
  margin-top: 6px;
}

/* Full-width panel */
.panel-card.full-width {
  grid-column: 1 / -1;
}

/* ============================================================
   ENTER MEMBERS PORTAL BUTTON
   ============================================================ */
.btn-members-portal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-primary);
  color: white;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: var(--border-radius-pill);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
}

.btn-members-portal:hover {
  background: #1d3340;
}

.btn-members-portal svg {
  width: 15px;
  height: 15px;
  stroke: white;
  fill: none;
  stroke-width: 2;
}

/* ============================================================
   FORMS (shared across pages)
   ============================================================ */
.form-group {
  margin-bottom: 22px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  font-family: var(--font);
  font-size: 13px;
  color: var(--color-text);
  background: white;
  transition: border-color 0.2s;
  outline: none;
}

.form-control:focus {
  border-color: var(--color-accent);
}

.form-control::placeholder {
  color: #b0b7c0;
}

textarea.form-control {
  resize: vertical;
  min-height: 140px;
}

/* File input */
.file-input-group {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.btn-choose-file {
  padding: 6px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  background: white;
  font-family: var(--font);
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-choose-file:hover {
  border-color: var(--color-accent);
}

/* Date/Time row */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* ============================================================
   TAG SELECTORS (pill toggles)
   ============================================================ */
.tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-pill {
  padding: 7px 16px;
  border-radius: var(--border-radius-pill);
  border: 1.5px solid var(--color-tag-border);
  background: white;
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.tag-pill:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.tag-pill.active {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  color: white;
}

/* ============================================================
   TOGGLE SWITCH
   ============================================================ */
.toggle-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary);
}

.toggle-status {
  font-size: 13px;
  color: var(--color-text-muted);
  font-weight: 500;
}

.toggle-switch {
  position: relative;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #d1d5db;
  border-radius: var(--border-radius-pill);
  transition: 0.3s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--color-accent);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(18px);
}

/* ============================================================
   PRIMARY BUTTONS
   ============================================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--color-accent);
  color: white;
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 600;
  padding: 11px 26px;
  border-radius: var(--border-radius-pill);
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: var(--color-accent-hover);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: white;
  color: var(--color-primary);
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 600;
  padding: 11px 26px;
  border-radius: var(--border-radius-pill);
  border: 1.5px solid var(--color-border);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* ============================================================
   TWO-COLUMN LAYOUT (form + sidebar panel)
   ============================================================ */
.two-col-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  align-items: start;
}

.sidebar-panel {
  background: white;
  border-radius: var(--border-radius-md);
  padding: 24px;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(0,0,0,0.04);
}

.sidebar-panel-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 12px;
}

.sidebar-panel-empty {
  font-size: 12.5px;
  color: var(--color-text-muted);
}

/* ============================================================
   CUSTOMISE FORM FIELDS BOX
   ============================================================ */
.custom-fields-box {
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  padding: 20px;
  margin-top: 16px;
  background: #fafaf9;
}

.custom-fields-box-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 6px;
}

.custom-fields-box-sub {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 14px;
}

.selected-fields-info {
  font-size: 11.5px;
  color: var(--color-text-muted);
  margin-top: 14px;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f2;
}

.login-card {
  background: white;
  border-radius: 16px;
  padding: 44px 40px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}

.login-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 20px;
  margin: 0 auto 16px;
}

.login-title {
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 4px;
}

.login-subtitle {
  text-align: center;
  font-size: 12.5px;
  color: var(--color-text-muted);
  margin-bottom: 28px;
  font-weight: 400;
}

.login-form-group {
  margin-bottom: 16px;
}

.login-form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 6px;
}

.login-form-input {
  width: 100%;
  padding: 11px 16px;
  border: none;
  border-radius: 10px;
  background: #f0f2f5;
  font-family: var(--font);
  font-size: 13.5px;
  color: var(--color-text);
  outline: none;
  transition: background 0.2s;
}

.login-form-input:focus {
  background: #e8ebee;
}

.btn-signin {
  width: 100%;
  padding: 13px;
  background: var(--color-accent);
  color: white;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: var(--border-radius-pill);
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 8px;
}

.btn-signin:hover {
  background: var(--color-accent-hover);
}

.login-error {
  background: #fff0ee;
  color: #c0392b;
  font-size: 12.5px;
  padding: 10px 14px;
  border-radius: var(--border-radius-sm);
  margin-bottom: 16px;
  text-align: center;
}

/* ============================================================
   UPCOMING CLASSES TABLE  
   ============================================================ */
.classes-list {
  margin-top: 4px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .two-col-layout {
    grid-template-columns: 1fr;
  }

  .sidebar-panel {
    order: -1;
  }
}

@media (max-width: 768px) {
  .navbar {
    padding: 0 14px;
    gap: 12px;
  }

  .navbar-brand-text {
    display: none;
  }

  .navbar-nav {
    display: none;
  }

  .navbar-mobile-menu {
    display: flex;
  }

  .page-content {
    padding: 24px 16px;
  }

  h1.page-title {
    font-size: 22px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .panels-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .login-card {
    padding: 32px 24px;
  }
}

/* ============================================================
   MOBILE NAV TOGGLE
   ============================================================ */
.navbar-mobile-menu {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
}

.navbar-mobile-menu svg {
  stroke: white;
  width: 22px;
  height: 22px;
}

.mobile-nav-overlay {
  display: none;
  position: fixed;
  top: 52px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
}

.mobile-nav-drawer {
  background: var(--color-primary);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-nav-drawer a {
  color: rgba(255,255,255,0.8);
  font-size: 14px;
  font-weight: 500;
  padding: 12px 16px;
  border-radius: var(--border-radius-sm);
  transition: all 0.2s;
}

.mobile-nav-drawer a:hover,
.mobile-nav-drawer a.active {
  background: rgba(255,255,255,0.1);
  color: white;
}

.mobile-nav-drawer .divider {
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 8px 0;
}

.mobile-nav-overlay.open {
  display: block;
}
