:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --border-focus: #3b82f6;

  --success-color: #16a34a;
  --success-bg: #f0fdf4;
  --warning-color: #d97706;
  --warning-bg: #fffbeb;
  --danger-color: #dc2626;
  --danger-bg: #fef2f2;
  --purple-color: #7c3aed;
  --purple-bg: #f5f3ff;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

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

body {
  font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.app-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: #f1f5f9;
  color: #334155;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  border: 1px solid #cbd5e1;
}

.btn-back:hover {
  background-color: #e2e8f0;
  color: #0f172a;
}

.header-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

.header-left h1 {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.3px;
}

.header-left .subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-sample {
  background-color: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}
.btn-sample:hover {
  background-color: #fde68a;
}

.btn-backup {
  background-color: #f1f5f9;
  color: #334155;
  border-color: #cbd5e1;
}
.btn-backup:hover {
  background-color: #e2e8f0;
  color: #0f172a;
}

.btn-restore {
  background-color: #eff6ff;
  color: #1e40af;
  border-color: #bfdbfe;
}
.btn-restore:hover {
  background-color: #dbeafe;
}

.btn-secondary {
  background-color: #f8fafc;
  color: #334155;
  border-color: #cbd5e1;
}
.btn-secondary:hover {
  background-color: #f1f5f9;
  color: #0f172a;
}

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

/* Main Container */
.main-container {
  max-width: 1400px;
  margin: 20px auto;
  padding: 0 20px 40px;
}

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-blue {
  background: #eff6ff;
  color: #2563eb;
}
.icon-green {
  background: #f0fdf4;
  color: #16a34a;
}
.icon-amber {
  background: #fffbeb;
  color: #d97706;
}
.icon-purple {
  background: #f5f3ff;
  color: #7c3aed;
}

.kpi-content {
  flex-grow: 1;
}

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

.kpi-value {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
  margin: 2px 0;
  font-family: 'Montserrat', sans-serif;
}

.kpi-note {
  font-size: 11px;
  color: var(--text-muted);
}

/* Workspace Card */
.workspace-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.toolbar-header {
  padding: 16px 20px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.club-select-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.club-dropdown {
  min-width: 260px;
  max-width: 380px;
  font-weight: 600;
  font-size: 14px;
  color: #1e293b;
}

/* Tab Navigation */
.tab-nav {
  display: flex;
  gap: 6px;
  border-bottom: 2px solid #f1f5f9;
  padding-bottom: 0px;
  overflow-x: auto;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-family: inherit;
}

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

.tab-btn.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  background: #eff6ff;
  border-radius: 6px 6px 0 0;
}

/* Tab Panes */
.tab-pane {
  display: none;
  padding: 20px;
}

.tab-pane.active {
  display: block;
}

.pane-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  min-width: 280px;
  flex: 1;
  max-width: 480px;
}

.search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
}

.search-box input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  font-size: 13.5px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}

.search-box input:focus {
  border-color: var(--border-focus);
}

/* Clubs Grid */
.clubs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.club-card-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.club-card-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: #cbd5e1;
}

.club-badge-category {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
  background: #f1f5f9;
  color: #475569;
}

.club-card-title {
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.club-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #475569;
  margin-bottom: 6px;
}

.club-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  margin: 14px 0 16px;
}

.stat-item-label {
  font-size: 11px;
  color: var(--text-muted);
}

.stat-item-val {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.club-card-actions {
  display: flex;
  gap: 8px;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #ffffff;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  text-align: left;
}

.data-table th {
  background-color: #f8fafc;
  color: #475569;
  font-weight: 700;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  vertical-align: middle;
}

.data-table tr:hover td {
  background-color: #f8fafc;
}

.badge-tag {
  display: inline-block;
  padding: 3px 8px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 4px;
  white-space: nowrap;
}

.badge-role-leader {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.badge-role-sub {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.badge-role-member {
  background: #f1f5f9;
  color: #475569;
}

.badge-status-active {
  background: #dcfce7;
  color: #166534;
}

.badge-status-inactive {
  background: #fee2e2;
  color: #991b1b;
}

/* Attendance Control */
.attendance-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: #f8fafc;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.attendance-date-select {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  flex-wrap: wrap;
}

.quick-check-actions {
  display: flex;
  gap: 8px;
}

.radio-group-att {
  display: inline-flex;
  gap: 12px;
  align-items: center;
}

.radio-att-label {
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

/* Financial Stats Banner */
.budget-summary-banner {
  display: flex;
  gap: 20px;
  align-items: center;
  background: #f8fafc;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.budget-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
}

.stat-num {
  font-weight: 800;
  font-family: 'Montserrat', sans-serif;
  font-size: 15px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.btn-outline {
  background: #ffffff;
  color: #334155;
  border-color: #cbd5e1;
}

.btn-outline:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.btn-danger-outline {
  background: #ffffff;
  color: #dc2626;
  border-color: #fca5a5;
}

.btn-danger-outline:hover {
  background: #fee2e2;
}

.btn-icon {
  padding: 5px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  cursor: pointer;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.btn-icon.delete:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

/* Form Controls */
.form-group {
  margin-bottom: 14px;
}

.form-row {
  display: flex;
  gap: 12px;
}

.col-4 { flex: 4; }
.col-6 { flex: 6; }
.col-8 { flex: 8; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 5px;
}

.form-label.required::after {
  content: " *";
  color: #dc2626;
}

.form-control {
  width: 100%;
  padding: 8px 12px;
  font-size: 13.5px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  outline: none;
  background: #ffffff;
  color: #0f172a;
  transition: border-color 0.2s;
  font-family: inherit;
}

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

textarea.form-control {
  resize: vertical;
}

.font-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12.5px;
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal.active {
  display: flex;
}

.modal-dialog {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #64748b;
  line-height: 1;
}

.modal-close:hover {
  color: #0f172a;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
}

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #f8fafc;
}

/* Helpers */
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }
.text-primary { color: var(--primary-color); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
.flex-gap { display: flex; gap: 8px; }
.flex-grow { flex: 1; }
.mt-3 { margin-top: 14px; }
.mt-4 { margin-top: 20px; }
.mb-2 { margin-bottom: 8px; }
.text-sm { font-size: 12.5px; }

.section-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
  color: #1e293b;
}

/* Print Container (A4 Formatter) */
.print-container {
  display: none;
}

@media print {
  body {
    background: #ffffff;
    color: #000000;
    font-size: 12pt;
    line-height: 1.4;
  }

  .no-print {
    display: none !important;
  }

  .print-container {
    display: block !important;
    width: 100%;
    margin: 0;
    padding: 0;
  }

  .print-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    line-height: 1.3;
  }

  .print-header-left {
    text-align: center;
    width: 45%;
  }

  .school-name {
    font-size: 11pt;
    font-weight: 700;
    text-transform: uppercase;
  }

  .club-unit {
    font-size: 10.5pt;
    font-weight: 700;
  }

  .doc-num {
    font-size: 10pt;
    font-style: italic;
    margin-top: 4px;
  }

  .print-header-right {
    text-align: center;
    width: 50%;
  }

  .national-title {
    font-size: 10.5pt;
    font-weight: 700;
  }

  .national-motto {
    font-size: 10.5pt;
    font-weight: 700;
    border-bottom: 1px solid #000;
    display: inline-block;
    padding-bottom: 2px;
    margin-bottom: 4px;
  }

  .doc-date {
    font-size: 10pt;
    font-style: italic;
  }

  .print-doc-title {
    text-align: center;
    margin: 20px 0 15px;
  }

  .print-doc-title h2 {
    font-size: 15pt;
    font-weight: 800;
    margin-bottom: 4px;
  }

  .print-doc-title p {
    font-size: 12pt;
    font-weight: 700;
  }

  .print-info-block {
    margin-bottom: 15px;
    font-size: 11pt;
    line-height: 1.6;
    border-left: 3px solid #333;
    padding-left: 10px;
  }

  .print-section {
    margin-bottom: 20px;
  }

  .print-sec-title {
    font-size: 12pt;
    font-weight: 700;
    margin-bottom: 8px;
    text-transform: uppercase;
  }

  .print-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 12px;
  }

  .print-table th, .print-table td {
    border: 1px solid #000;
    padding: 6px 8px;
    font-size: 10.5pt;
  }

  .print-table th {
    background: #f0f0f0;
    text-align: center;
    font-weight: 700;
  }

  .print-stat-text {
    font-size: 11pt;
    line-height: 1.6;
  }

  .print-signatures {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    page-break-inside: avoid;
  }

  .sign-box {
    text-align: center;
    width: 30%;
  }

  .sign-role {
    font-weight: 700;
    font-size: 10.5pt;
  }

  .sign-note {
    font-size: 9pt;
    font-style: italic;
  }

  .sign-space {
    height: 70px;
  }

  .sign-name {
    font-weight: 700;
    font-size: 11pt;
  }
}

.btn-danger-outline {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #e11d48;
}

.btn-danger-outline:hover {
  background: #ffe4e6;
  border-color: #fda4af;
}

/* Welcome / First Time Banner */
.welcome-sample-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(135deg, #eff6ff 0%, #e0e7ff 100%);
  border: 1px solid #bfdbfe;
  border-left: 5px solid #2563eb;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
  animation: fadeIn 0.3s ease-in-out;
}

.welcome-banner-content {
  display: flex;
  align-items: center;
  gap: 14px;
}

.welcome-banner-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffffff;
  color: #2563eb;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.15);
  flex-shrink: 0;
}

.welcome-banner-title {
  font-size: 15px;
  font-weight: 700;
  color: #1e3a8a;
  margin-bottom: 2px;
}

.welcome-banner-desc {
  font-size: 13.5px;
  color: #334155;
  margin: 0;
}

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

.btn-banner-empty {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-banner-empty:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.btn-banner-sample {
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  background: #2563eb;
  border: 1px solid #1d4ed8;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
  transition: all 0.2s ease;
}

.btn-banner-sample:hover {
  background: #1d4ed8;
}

@media (max-width: 768px) {
  .welcome-sample-banner {
    flex-direction: column;
    align-items: flex-start;
  }
  .welcome-banner-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

