/* =========================================================
   DESIGN SYSTEM — Rugby Identity Platform
   Harlequins Brand Theme
   ========================================================= */

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

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

:root {
  /* Harlequins Brand Palette */
  --harlequins-purple: #5B2C83;
  --harlequins-magenta: #C2185B;
  --harlequins-crimson: #C62828;
  --harlequins-green: #2E7D32;
  --harlequins-teal: #00897B;
  --harlequins-blue: #42A5F5;
  --harlequins-yellow: #F9A825;
  --harlequins-brown: #5D4037;

  /* Semantic Variables */
  --primary: #C2185B;
  --primary-hover: #A0144D;
  --primary-light: rgba(194, 24, 91, 0.08);
  --primary-50: rgba(194, 24, 91, 0.05);
  --secondary: #5B2C83;
  --secondary-hover: #4A2370;
  --secondary-light: rgba(91, 44, 131, 0.08);
  --accent: #42A5F5;
  --accent-hover: #1E88E5;
  --success: #2E7D32;
  --success-hover: #1B5E20;
  --success-bg: #E8F5E9;
  --success-light: rgba(46, 125, 50, 0.1);
  --warning: #F9A825;
  --warning-hover: #F57F17;
  --warning-bg: #FFF8E1;
  --danger: #C62828;
  --danger-hover: #B71C1C;
  --danger-bg: #FFEBEE;
  --danger-light: rgba(198, 40, 40, 0.1);
  --info: #42A5F5;
  --info-bg: #E3F2FD;
  --teal: #00897B;
  --teal-bg: #E0F2F1;
  --muted: #6B7280;
  --surface: #FFFFFF;
  --surface-hover: #F8FAFC;
  --bg: #F8FAFC;
  --bg-alt: #F1F5F9;
  --border: #E5E7EB;
  --border-light: #F1F5F9;
  --text: #111827;
  --text-secondary: #6B7280;
  --text-muted: #9CA3AF;
  --text-inverse: #FFFFFF;

  /* Dark Mode Overrides (set via .dark) */
  --dark-bg: #111827;
  --dark-surface: #1F2937;
  --dark-surface-hover: #374151;
  --dark-border: #374151;
  --dark-border-light: #2D3748;
  --dark-text: #F9FAFB;
  --dark-text-secondary: #9CA3AF;
  --dark-text-muted: #6B7280;

  /* Layout */
  --sidebar-width: 280px;
  --sidebar-collapsed: 72px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 8px 30px rgba(15, 23, 42, 0.06);
  --shadow-xl: 0 20px 60px rgba(15, 23, 42, 0.08);
  --shadow-sidebar: 4px 0 24px rgba(15, 23, 42, 0.06);
  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-elevated: 0 8px 30px rgba(15, 23, 42, 0.08);

  /* Transitions */
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);

  /* Font */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html { font-size: 15px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* -------- Dark Mode -------- */
body.dark {
  --bg: var(--dark-bg);
  --surface: var(--dark-surface);
  --surface-hover: var(--dark-surface-hover);
  --border: var(--dark-border);
  --border-light: var(--dark-border-light);
  --text: var(--dark-text);
  --text-secondary: var(--dark-text-secondary);
  --text-muted: var(--dark-text-muted);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.3);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.4);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.2);
  --primary-light: rgba(91, 44, 131, 0.15);
  --primary-50: rgba(91, 44, 131, 0.08);
  --success-bg: rgba(46, 125, 50, 0.15);
  --warning-bg: rgba(249, 168, 37, 0.15);
  --danger-bg: rgba(198, 40, 40, 0.15);
}

/* -------- Layout -------- */
.app-layout { display: flex; min-height: 100vh; }

/* -------- Sidebar -------- */
.left_panel {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 100;
  transition: width var(--transition-slow);
  overflow: hidden;
  box-shadow: var(--shadow-sidebar);
}

.left_panel.collapsed { width: var(--sidebar-collapsed); }
.left_panel.collapsed .sidebar-toggle i { transform: rotate(180deg); }

.sidebar-header {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.sidebar-logo { width: 40px; height: 40px; object-fit: contain; flex-shrink: 0; }

.sidebar-brand { flex: 1; overflow: hidden; }

.company_name {
  font-size: 15px; font-weight: 700; color: var(--text);
  margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.system_name {
  font-size: 11px; color: var(--text-secondary);
  margin: 1px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.sidebar-toggle {
  background: none; border: 1px solid var(--border-light);
  border-radius: var(--radius-sm); width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-secondary); font-size: 14px;
  transition: var(--transition); flex-shrink: 0;
}
.sidebar-toggle:hover { background: var(--bg); color: var(--text); }

.sidebar-nav {
  flex: 1; overflow-y: auto;
  padding: 16px 12px;
  display: flex; flex-direction: column; gap: 2px;
}

.nav { display: flex; flex-direction: column; gap: 2px; padding: 0; margin: 0; list-style: none; }

.nav-section-label {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 16px 12px 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.nav_button, .nav-link.nav_button {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none; font-size: 14px; font-weight: 500;
  transition: var(--transition);
  border: none; background: transparent;
  white-space: nowrap; overflow: hidden;
}
.nav_button i, .nav_button .bi { font-size: 18px; width: 20px; text-align: center; flex-shrink: 0; }
.nav_button:hover { background: var(--secondary-light); color: var(--secondary); }
.nav_button.active, .nav-link[aria-current="page"] {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--primary);
}

.log_out_button { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--border-light); }
.log_out_button .nav_button { color: var(--danger); }
.log_out_button .nav_button:hover { background: var(--danger-bg); }

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border-light);
  display: flex; align-items: center; gap: 12px; flex-shrink: 0;
}

.sidebar-footer-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 14px; flex-shrink: 0;
}

.sidebar-footer-info { flex: 1; overflow: hidden; }
.sidebar-footer-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-footer-role { font-size: 11px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-theme-btn {
  width: 32px; height: 32px; flex-shrink: 0;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-secondary); font-size: 14px;
  transition: var(--transition);
}
.sidebar-theme-btn:hover { background: var(--primary-50); color: var(--primary); border-color: var(--primary); }

/* -------- Main Content Area -------- */
.right_panel {
  margin-left: var(--sidebar-width);
  flex: 1; padding: 32px;
  min-height: 100vh;
  transition: margin-left var(--transition-slow);
  background: var(--bg);
}
.left_panel.collapsed + .right_panel,
.left_panel.collapsed ~ .right_panel,
.right_panel.sidebar-collapsed { margin-left: var(--sidebar-collapsed); }

/* -------- Top Navigation Bar -------- */
.topnav {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0 0 24px; gap: 16px;
}
.topnav-left { display: flex; align-items: center; gap: 12px; flex: 1; }

.topnav-search { position: relative; max-width: 360px; width: 100%; }
.topnav-search input {
  width: 100%; padding: 10px 14px 10px 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface);
  font-size: 14px; color: var(--text);
  transition: var(--transition); outline: none;
}
.topnav-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91, 44, 131, 0.1);
}
.topnav-search input::placeholder { color: var(--text-muted); }
.topnav-search i {
  position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted); font-size: 16px;
}

.topnav-right { display: flex; align-items: center; gap: 8px; }

.topnav-btn {
  width: 38px; height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-secondary); font-size: 16px;
  transition: var(--transition); position: relative;
}
.topnav-btn:hover { background: var(--primary-50); color: var(--primary); border-color: var(--primary); }
.topnav-btn .badge-dot {
  position: absolute; top: 8px; right: 8px;
  width: 8px; height: 8px;
  background: var(--danger); border-radius: 50%;
  border: 2px solid var(--surface);
}

.topnav-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 14px;
  cursor: pointer; transition: var(--transition);
  border: 2px solid transparent;
}
.topnav-avatar:hover { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(91, 44, 131, 0.15); }

/* -------- Page Header -------- */
.page-header { margin-bottom: 28px; }
.header_title { font-size: 28px; font-weight: 700; color: var(--text); margin: 0; line-height: 1.3; }
.blue_title { color: var(--primary); }
.admin_name, .member_name { color: var(--primary); font-weight: 700; }
.page-subtitle { font-size: 14px; color: var(--text-secondary); margin: 4px 0 0; }

/* -------- Cards -------- */
.card, .white_container, .grey_container, .date_container, .clock_container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: var(--transition);
  box-shadow: var(--shadow-card);
}
.card:hover, .white_container:hover {
  box-shadow: var(--shadow-elevated);
  border-color: rgba(91, 44, 131, 0.15);
}

.date_container {
  background: linear-gradient(135deg, var(--primary-light), transparent);
  border-color: var(--primary-light);
}
.clock_container { background: var(--bg); border-color: var(--border-light); }
.grey_container { background: var(--bg); border-color: var(--border-light); }

/* -------- Card Typography -------- */
.date_subtitle { font-size: 13px; color: var(--text-secondary); font-weight: 500; margin: 0; }
.date_title, .day_title { font-size: 22px; font-weight: 700; color: var(--text); margin: 4px 0 0; }
.day_title { font-size: 16px; color: var(--primary); }

.clock_elements { display: flex; align-items: center; justify-content: center; gap: 2px; }
.clock_elements span { font-size: 32px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }

/* -------- Legend -------- */
.legend_title { font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }
.legend_red, .legend_blue, .legend_green { font-size: 12px; display: flex; align-items: center; gap: 6px; padding: 3px 0; }
.legend_red { color: var(--danger); }
.legend_blue { color: var(--info); }
.legend_green { color: var(--success); }
.legend_red i, .legend_blue i, .legend_green i { font-size: 10px; }

/* -------- Stats Cards -------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  opacity: 0;
  transition: var(--transition);
}
.stat-card:hover {
  box-shadow: var(--shadow-elevated);
  transform: translateY(-2px);
}
.stat-card:hover::before { opacity: 1; }

.stat-card-label { font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: 8px; }
.stat-card-value { font-size: 32px; font-weight: 700; color: var(--text); line-height: 1; }
.stat-card-change { font-size: 12px; font-weight: 500; margin-top: 6px; }
.stat-card-change.up { color: var(--success); }
.stat-card-change.down { color: var(--danger); }

/* -------- Tables -------- */
.table-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.table { width: 100%; border-collapse: collapse; margin: 0; }

.table thead {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.table th {
  padding: 14px 20px;
  font-size: 12px; font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.05em;
  text-align: left; white-space: nowrap;
}

.table td {
  padding: 14px 20px;
  font-size: 14px; color: var(--text);
  border-bottom: 1px solid var(--border-light);
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--bg); }
.table_body td { font-size: 14px; }

/* -------- Buttons -------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 14px; font-weight: 600;
  font-family: var(--font);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none; line-height: 1.4;
}
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(91, 44, 131, 0.3); }

.btn-primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn-primary:hover {
  background: var(--primary-hover); border-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(91, 44, 131, 0.3);
}

.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg); border-color: var(--border); transform: translateY(-1px); }

.btn-success { background: var(--success); color: white; border-color: var(--success); }
.btn-success:hover { background: var(--success-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(46, 125, 50, 0.3); }

.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(198, 40, 40, 0.3); }

.btn-warning { background: var(--warning); color: white; border-color: var(--warning); }
.btn-warning:hover { background: var(--warning-hover); transform: translateY(-1px); }

.btn-info { background: var(--info); color: white; border-color: var(--info); }
.btn-info:hover { background: var(--accent-hover); transform: translateY(-1px); }

.btn-ghost { background: transparent; color: var(--text-secondary); border-color: transparent; }
.btn-ghost:hover { background: var(--bg); color: var(--text); }

.btn-outline-primary { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary-light); color: var(--primary-hover); }

.btn-outline-success { background: transparent; color: var(--success); border-color: var(--success); }
.btn-outline-success:hover { background: var(--success-bg); color: var(--success-hover); }

.btn-outline-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-outline-danger:hover { background: var(--danger-bg); color: var(--danger-hover); }

.btn-outline-secondary { background: transparent; color: var(--text-secondary); border-color: var(--border); }
.btn-outline-secondary:hover { background: var(--bg); color: var(--text); }

.in_button {
  background: var(--success); color: white; border: none;
  padding: 12px 32px;
  border-radius: var(--radius-md);
  font-weight: 700; font-size: 14px; cursor: pointer;
  transition: var(--transition);
}
.in_button:hover {
  background: var(--success-hover); transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(46, 125, 50, 0.3);
}

.out_button {
  background: var(--danger); color: white; border: none;
  padding: 12px 32px;
  border-radius: var(--radius-md);
  font-weight: 700; font-size: 14px; cursor: pointer;
  transition: var(--transition);
}
.out_button:hover {
  background: var(--danger-hover); transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(198, 40, 40, 0.3);
}

.in_out_button { display: flex; gap: 12px; justify-content: center; }

/* btn-sm */
.btn-sm { padding: 6px 14px; font-size: 13px; border-radius: var(--radius-sm); }

/* -------- Forms -------- */
.form-control, .form-select {
  width: 100%; padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px; font-family: var(--font);
  color: var(--text); background: var(--surface);
  transition: var(--transition); outline: none;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91, 44, 131, 0.1);
}
.form-control::placeholder { color: var(--text-muted); }

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

select.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236B7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 36px;
}

.input-group { display: flex; align-items: stretch; }
.input-group > .form-control,
.input-group > .form-select { flex: 1; border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group > .btn,
.input-group > .input-group-text {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-left: -1px;
}
.input-group-text {
  display: flex; align-items: center; padding: 12px 16px;
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 14px;
}

/* -------- Badges -------- */
.badge {
  display: inline-flex; align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px; font-weight: 600; line-height: 1.4;
  white-space: nowrap;
}
.badge.bg-success { background: var(--success) !important; color: white; }
.badge.bg-warning { background: var(--warning) !important; color: white; }
.badge.bg-danger { background: var(--danger) !important; color: white; }
.badge.bg-info { background: var(--info) !important; color: white; }
.badge.bg-primary { background: var(--primary) !important; color: white; }
.badge.bg-secondary { background: var(--text-secondary) !important; color: white; }
.badge.bg-teal { background: var(--teal) !important; color: white; }

/* -------- Alerts / Messages -------- */
.alert {
  padding: 16px 20px; border-radius: var(--radius-md);
  font-size: 14px; font-weight: 500; margin-bottom: 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.alert-success { background: var(--success-bg); color: #1B5E20; border: 1px solid #C8E6C9; }
.alert-danger { background: var(--danger-bg); color: #B71C1C; border: 1px solid #FFCDD2; }
.alert-warning { background: var(--warning-bg); color: #E65100; border: 1px solid #FFE082; }
.alert-info { background: var(--info-bg); color: #1565C0; border: 1px solid #90CAF9; }
.alert_mes { font-size: 14px; }

.btn-close { background: none; border: none; font-size: 18px; cursor: pointer; padding: 4px; opacity: 0.6; transition: var(--transition); color: inherit; }
.btn-close:hover { opacity: 1; }

/* -------- Modal -------- */
.modal-content { border: none; border-radius: var(--radius-lg); box-shadow: var(--shadow-xl); background: var(--surface); }
.modal-header { padding: 24px 24px 0; border: none; }
.modal-body { padding: 20px 24px; }
.modal-footer { padding: 0 24px 24px; border: none; gap: 8px; }
.modal-backdrop { background: rgba(17, 24, 39, 0.5); }

/* -------- Punch Title -------- */
.am_title, .pm_title, .punch_title {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white; font-size: 16px; font-weight: 700;
  padding: 10px 24px; border-radius: var(--radius-sm); text-align: center;
}

/* -------- Player Info Panel -------- */
.emp_title { font-size: 18px; font-weight: 700; color: var(--text); }
.member_info label { font-size: 12px; color: var(--text-secondary); font-weight: 600; }
.member_info input { font-size: 14px; }

/* -------- Search -------- */
.search_register {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  box-shadow: var(--shadow-card);
}
.search_button input, .search_button button {
  background: var(--primary); color: white; border: none;
  border-radius: var(--radius-sm); padding: 10px 20px;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: var(--transition);
}
.search_button input:hover, .search_button button:hover { background: var(--primary-hover); }

.register_button button {
  background: var(--primary); color: white; border: none;
  border-radius: var(--radius-sm); padding: 10px 24px;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: var(--transition);
}
.register_button button:hover { background: var(--primary-hover); box-shadow: 0 4px 12px rgba(91, 44, 131, 0.3); }

/* -------- Calendar Icon -------- */
.calendar_icon { cursor: pointer; color: var(--text-secondary); transition: var(--transition); }
.calendar_icon:hover { color: var(--primary); }

/* -------- Grid Layouts -------- */
.dashboard-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
.dashboard-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.dashboard-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px; }
.dashboard-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

/* -------- Utility Classes -------- */
.gap-0 { gap: 0; } .gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 16px; } .gap-4 { gap: 24px; } .gap-5 { gap: 32px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 16px; } .mt-4 { margin-top: 24px; } .mt-5 { margin-top: 32px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 16px; } .mb-4 { margin-bottom: 24px; } .mb-5 { margin-bottom: 32px; }
.m-0 { margin: 0; } .p-0 { padding: 0; } .p-1 { padding: 4px; } .p-2 { padding: 8px; } .p-3 { padding: 16px; } .p-4 { padding: 24px; } .p-5 { padding: 32px; }
.text-center { text-align: center; } .text-left { text-align: left; } .text-right { text-align: right; }
.text-muted { color: var(--text-secondary); }
.font-bold { font-weight: 700; } .font-semibold { font-weight: 600; } .font-medium { font-weight: 500; }
.d-flex { display: flex; } .flex-column { flex-direction: column; }
.align-items-center { align-items: center; } .align-items-start { align-items: flex-start; }
.justify-content-center { justify-content: center; } .justify-content-between { justify-content: space-between; }
.justify-content-end { justify-content: flex-end; } .flex-wrap { flex-wrap: wrap; }
.flex-shrink-0 { flex-shrink: 0; } .w-100 { width: 100%; }

/* -------- Animations -------- */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.animate-fade-in { animation: fadeIn 0.3s ease; }
.animate-slide-up { animation: slideUp 0.35s ease; }
.animate-fade-in-down { animation: fadeInDown 0.3s ease; }
.animate-scale-in { animation: scaleIn 0.3s ease; }

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--border-light) 25%, var(--bg) 50%, var(--border-light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
  border-radius: var(--radius-sm);
}

/* -------- Page transition -------- */
.page-enter { animation: fadeIn 0.3s ease, slideUp 0.35s ease; }

/* -------- Chart accent colors -------- */
.chart-brand { color: var(--primary); }
.chart-magenta { color: var(--secondary); }
.chart-green { color: var(--success); }
.chart-red { color: var(--danger); }
.chart-yellow { color: var(--warning); }
.chart-blue { color: var(--info); }
.chart-teal { color: var(--teal); }
.chart-brown { color: var(--harlequins-brown); }

/* -------- Responsive -------- */
@media (max-width: 1024px) {
  .right_panel { padding: 24px; }
  .dashboard-grid-2, .dashboard-grid-3, .dashboard-grid-4 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .left_panel { width: var(--sidebar-collapsed); }
  .left_panel .sidebar-brand, .left_panel .sidebar-footer-info,
  .left_panel .nav-section-label, .left_panel .nav_button span { display: none; }
  .left_panel .nav_button { justify-content: center; padding: 10px; }
  .left_panel .sidebar-header { justify-content: center; padding: 16px 12px; }
  .left_panel .sidebar-toggle { display: none; }
  .right_panel { margin-left: var(--sidebar-collapsed); padding: 20px; }
  .dashboard-grid-2, .dashboard-grid-3, .dashboard-grid-4 { grid-template-columns: 1fr; }
  .topnav-search { display: none; }
}

/* -------- Bootstrap Overrides -------- */
.container-fluid { padding: 0; margin: 0; }
.row { margin: 0; }
.col, [class*="col-"] { padding: 0; }
a { text-decoration: none; color: var(--primary); }
a:hover { color: var(--primary-hover); }

/* -------- Scrollbar -------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* -------- Clock -------- */
#hour, #minute, #second, #am_pm { font-weight: 700; }

/* -------- Player Panel -------- */
.member_name2 input { font-weight: 600; }
.message { font-style: italic; text-align: center; font-size: 14px; margin-bottom: 0; }
.message_container { background: var(--bg); border-radius: var(--radius-md); padding: 16px; }
.pop_out_text { font-size: 14px; color: var(--text-secondary); font-style: italic; }
.exit_button button { background: var(--surface); color: var(--text-secondary); border: 1px solid var(--border); overflow: hidden; font-size: 14px; }
.exit_button button:hover { background: var(--bg); }

.custom_font1 { font-size: 28px; }
.custom_font2 { font-size: 15px; }
.bold_title { font-weight: 700; }
.footer_title { font-size: 12px; }

/* -------- Auth Pages (Login / Sign-up) -------- */
.auth-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg); padding: 24px;
  background-image: radial-gradient(ellipse at 20% 50%, rgba(91,44,131,0.06) 0%, transparent 50%),
                    radial-gradient(ellipse at 80% 50%, rgba(194,24,91,0.06) 0%, transparent 50%);
}
.auth-container { width: 100%; max-width: 440px; }
.auth-card {
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl); padding: 40px;
  position: relative; animation: slideUp 0.4s ease;
}
.auth-back { position: absolute; top: 16px; left: 16px; width: 36px; height: 36px; border-radius: 50%; background: var(--bg); display: flex; align-items: center; justify-content: center; color: var(--text-secondary); transition: var(--transition); }
.auth-back:hover { background: var(--border-light); color: var(--text); }
.auth-title { font-size: 24px; font-weight: 700; color: var(--text); text-align: center; margin: 0 0 24px; }
.auth-form label { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; display: block; }

/* -------- Landing Page -------- */
.landing-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg); padding: 24px;
  background-image: radial-gradient(ellipse at 20% 50%, rgba(91,44,131,0.08) 0%, transparent 50%),
                    radial-gradient(ellipse at 80% 50%, rgba(194,24,91,0.08) 0%, transparent 50%);
}
.landing-container { width: 100%; max-width: 900px; }
.landing-card { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-xl); overflow: hidden; display: flex; animation: slideUp 0.5s ease; }
.landing-left { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: white; padding: 48px; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.landing-left img { width: 80px; height: 80px; margin-bottom: 24px; }
.landing-left h3 { font-size: 36px; font-weight: 700; line-height: 1.2; margin: 0; }
.landing-footer { font-size: 12px; opacity: 0.8; margin-top: 32px; }
.landing-right { padding: 48px; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.landing-welcome { font-size: 28px; font-weight: 700; color: var(--text); margin: 0; }
.landing-subtitle { font-size: 15px; color: var(--text-secondary); margin: 8px 0 24px; }
.landing-buttons { display: flex; flex-direction: column; gap: 8px; }
.landing-buttons a { text-decoration: none; }
.landing-buttons .btn-primary { padding: 14px; font-size: 15px; }
.landing-buttons .btn-outline { background: var(--bg); color: var(--text); border: 1px solid var(--border); padding: 14px; font-size: 15px; }
.landing-buttons .btn-outline:hover { background: var(--border-light); border-color: var(--border); transform: translateY(-1px); }

@media (max-width: 768px) {
  .landing-card { flex-direction: column; }
  .landing-left { padding: 32px; text-align: center; align-items: center; }
  .landing-left h3 { font-size: 28px; }
  .landing-right { padding: 32px; }
}

/* -------- Dark mode auth pages -------- */
body.dark .auth-body {
  background: var(--dark-bg);
  background-image: radial-gradient(ellipse at 20% 50%, rgba(91,44,131,0.12) 0%, transparent 50%),
                    radial-gradient(ellipse at 80% 50%, rgba(194,24,91,0.12) 0%, transparent 50%);
}

/* =========================================================
   DataTables Overrides — clean, modern, design-system match
   ========================================================= */

div.dt-container .dt-length select,
div.dt-container .dt-search input {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 13px; font-family: 'Inter', sans-serif;
  color: var(--text); background: var(--surface);
  outline: none; transition: border-color 0.15s;
}
div.dt-container .dt-length select:focus,
div.dt-container .dt-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91,44,131,0.1);
}
div.dt-container .dt-search input { min-width: 200px; }
div.dt-container .dt-length label, div.dt-container .dt-info {
  font-size: 13px; color: var(--text-secondary); font-family: 'Inter', sans-serif;
}

div.dt-container .dt-paging { display: flex; gap: 4px; }
div.dt-container .dt-paging button {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 13px; font-family: 'Inter', sans-serif;
  padding: 4px 12px; cursor: pointer; transition: all 0.15s;
}
div.dt-container .dt-paging button:hover { background: var(--primary-50); border-color: var(--primary); color: var(--primary); }
div.dt-container .dt-paging button.current { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
div.dt-container .dt-paging button.disabled { opacity: 0.4; pointer-events: none; }

div.dt-container table.dataTable { border-collapse: separate; border-spacing: 0; }
div.dt-container table.dataTable thead th {
  border-bottom: 2px solid var(--border);
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-secondary);
  padding: 12px 16px; background: var(--surface);
}
div.dt-container table.dataTable tbody td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px; color: var(--text);
}
div.dt-container table.dataTable tbody tr:hover td { background: var(--bg); }
div.dt-container table.dataTable tbody tr:last-child td { border-bottom: none; }

div.dt-container table.dataTable thead th.dt-orderable-asc span.dt-column-order,
div.dt-container table.dataTable thead th.dt-orderable-desc span.dt-column-order,
div.dt-container table.dataTable thead th.dt-ordering-asc span.dt-column-order,
div.dt-container table.dataTable thead th.dt-ordering-desc span.dt-column-order { opacity: 0.4; }
div.dt-container table.dataTable thead th.dt-ordering-asc span.dt-column-order,
div.dt-container table.dataTable thead th.dt-ordering-desc span.dt-column-order { opacity: 1; color: var(--primary); }

@media (max-width: 768px) {
  div.dt-container .dt-search input { min-width: 120px; }
  div.dt-container .dt-paging button { padding: 4px 8px; font-size: 12px; }
}

/* -------- Dark Mode DataTables Overrides -------- */
body.dark div.dt-container table.dataTable,
body.dark div.dt-container table.dataTable tbody tr {
  background: transparent !important;
}
body.dark div.dt-container table.dataTable thead th {
  background: var(--surface) !important;
  color: var(--text-secondary) !important;
  border-bottom-color: var(--border) !important;
}
body.dark div.dt-container table.dataTable tbody td {
  background: var(--surface) !important;
  color: var(--text) !important;
  border-bottom-color: var(--border-light) !important;
}
body.dark div.dt-container table.dataTable tbody tr.even,
body.dark div.dt-container table.dataTable tbody tr.odd,
body.dark div.dt-container table.dataTable tbody tr.even td,
body.dark div.dt-container table.dataTable tbody tr.odd td {
  background: var(--surface) !important;
}
body.dark div.dt-container table.dataTable tbody tr:hover td {
  background: var(--bg) !important;
}
body.dark div.dt-container .dt-length label,
body.dark div.dt-container .dt-search label,
body.dark div.dt-container .dt-info {
  color: var(--text-secondary) !important;
}
body.dark div.dt-container .dt-input {
  background: var(--surface) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}
body.dark div.dt-container .dt-paging button {
  background: var(--surface) !important;
  border-color: var(--border) !important;
  color: var(--text-secondary) !important;
}
body.dark div.dt-container .dt-paging button:hover {
  background: var(--bg) !important;
  color: var(--text) !important;
}
body.dark div.dt-container .dt-paging button.current {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #fff !important;
}

/* -------- KPI icon containers -------- */
.kpi-icon {
  width: 48px; height: 48px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: white; flex-shrink: 0;
}
.kpi-icon.purple { background: linear-gradient(135deg, var(--primary), #7C3AED); }
.kpi-icon.magenta { background: linear-gradient(135deg, var(--secondary), #E91E63); }
.kpi-icon.green { background: linear-gradient(135deg, var(--success), #43A047); }
.kpi-icon.blue { background: linear-gradient(135deg, var(--info), #1E88E5); }
.kpi-icon.teal { background: linear-gradient(135deg, var(--teal), #26A69A); }
.kpi-icon.red { background: linear-gradient(135deg, var(--danger), #E53935); }
.kpi-icon.yellow { background: linear-gradient(135deg, var(--warning), #FBC02D); }
.kpi-icon.brown { background: linear-gradient(135deg, var(--harlequins-brown), #8D6E63); }

/* -------- Game/Status badges extended -------- */
.status-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 14px; border-radius: var(--radius-full);
  font-size: 12px; font-weight: 600;
}
.status-badge.verified { background: var(--success-bg); color: var(--success); }
.status-badge.admin { background: var(--primary-light); color: var(--primary); }
.status-badge.coach { background: var(--info-bg); color: var(--info); }
.status-badge.medical { background: var(--danger-bg); color: var(--danger); }
.status-badge.performance { background: var(--teal-bg); color: var(--teal); }
.status-badge.attendance { background: var(--warning-bg); color: var(--warning); }
.status-badge.inactive { background: var(--bg); color: var(--text-secondary); }
