/* The Upskill Space Portal CSS Design System */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&display=swap');

:root {
  /* Color System */
  --bg-primary: #ffffff;
  --bg-secondary: rgba(255, 255, 255, 0.45);
  --bg-canvas: #ffffff;
  
  --sidebar-bg: #000000;
  --sidebar-hover: #111111;
  --sidebar-active: #222222;
  --sidebar-text: #888888;
  --sidebar-text-active: #ffffff;
  
  --text-main: #000000;
  --text-muted: #555555;
  --text-light: #777777;
  
  --primary: #000000;
  --primary-hover: #222222;
  --primary-light: rgba(0, 0, 0, 0.05);
  
  --success: #000000;
  --success-hover: #111111;
  --success-light: rgba(0, 0, 0, 0.03);
  
  --warning: #333333;
  --warning-hover: #444444;
  --warning-light: rgba(0, 0, 0, 0.02);
  
  --danger: #000000;
  --danger-hover: #111111;
  --danger-light: rgba(0, 0, 0, 0.03);
  
  --info: #000000;
  --info-light: rgba(0, 0, 0, 0.03);
  
  /* Layout Constants */
  --sidebar-width: 280px;
  --border-radius-sm: 8px;
  --border-radius-md: 14px;
  --border-radius-lg: 24px;
  
  /* Shadows & Depth */
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.1);
  
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg-canvas);
  color: var(--text-main);
  font-family: 'Roboto', sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

img {
  max-width: 100%;
  display: block;
}

button, input, textarea, select {
  font-family: inherit;
  font-size: 0.95rem;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

.hidden {
  display: none !important;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* --- AUTH SHELL / CARDS --- */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(172deg, #ffffff 80%, #000000 20%);
  padding: 24px;
  position: relative;
}

/* Floating Page Logo in Top Left Corner */
.auth-page-logo {
  position: absolute;
  top: 40px;
  left: 40px;
  z-index: 10;
}

.auth-page-logo img {
  height: 36px;
  object-fit: contain;
}

.auth-card {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.22);
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  border-radius: 28px;
  padding: 48px 40px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  /* justify-content: center; */
  text-align: center;
  /* align-items: center; */
  flex-direction: column;
}

.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 32px;
}

.auth-brand img {
  height: 48px;
  object-fit: contain;
  margin-bottom: 24px;
}

.auth-brand h1 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #000000;
  text-transform: uppercase;
}

.auth-brand p {
  margin: 8px 0 0;
  color: #555555;
  font-size: 0.95rem;
  font-weight: 400;
}

.auth-form {
  display: grid;
  gap: 20px;
}

.auth-form label {
  display: none !important; /* Hide labels on auth screen */
}

/* Translucent Inputs inside Auth Shell */
.auth-form input {
  width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.6);
  padding: 14px 16px;
  color: #000000;
  font-size: 0.95rem;
  transition: var(--transition-fast);
  outline: none;
}

.auth-form input::placeholder {
  color: #888888;
}

.auth-form input:focus {
  border-color: #000000;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
  background: #ffffff;
}

/* Password Toggle and Icons styling */
.password-field-wrapper {
  position: relative;
  width: 100%;
}

.password-field-wrapper input {
  padding-right: 48px;
}

.password-toggle-btn {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #555555;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  cursor: pointer;
}

.password-toggle-btn i {
  font-size: 1.1rem;
}

/* Auth Specific Primary Button styling */
.auth-form .primary-button {
  background: #000000;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 8px;
  padding: 14px 24px;
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  cursor: pointer;
  transition: all var(--transition-normal);
  box-shadow: none;
}

.auth-form .primary-button:hover {
  background: #222222;
  border-color: #222222;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.auth-form .primary-button:active {
  transform: translateY(0);
}

.auth-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  font-size: 0.88rem;
  color: #000000;
  font-weight: 400;
}

.auth-links a {
  color: #000000;
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition-fast);
}

.auth-links a:hover {
  opacity: 0.7;
}

.auth-signup-prompt {
  color: #080808;
  font-weight: 600;
}

.auth-signup-prompt a {
  text-decoration: underline !important;
  color: #000000;
  font-weight: 600;
}

.status-text {
  text-align: center;
  font-weight: 500;
  font-size: 0.9rem;
  margin-top: 8px;
  color: #dc2626; /* Make status messages clear red */
}

/* Inputs & Buttons Styling */
input, textarea, select {
  width: 100%;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--border-radius-sm);
  background: var(--bg-primary);
  padding: 12px 16px;
  color: var(--text-main);
  transition: var(--transition-fast);
  outline: none;
}

input:focus, textarea:focus, select:focus {
  border-color: #000000;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
  background: #ffffff;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.primary-button, .secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 500;
  border-radius: var(--border-radius-sm);
  padding: 12px 24px;
  transition: var(--transition-normal);
  text-align: center;
  min-height: 48px;
}

.primary-button {
  background: #000000;
  color: #ffffff;
  border: 1.5px solid #000000;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.primary-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.1);
  background: #222222;
  border-color: #222222;
}

.primary-button:active {
  transform: translateY(0);
}

.secondary-button {
  background: var(--bg-secondary);
  border: 1.5px solid #cbd5e1;
  color: var(--text-muted);
}

.secondary-button:hover {
  background: #f8fafc;
  color: var(--text-main);
  border-color: #94a3b8;
}

/* --- APP LAYOUT (SHELL & SIDEBAR) --- */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
  display: contents;
}

.sidebar-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--sidebar-bg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.brand-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  height: 56px;
}

.brand-bar img {
  height: 32px;
  object-fit: contain;
}

/* Hide attendance widget inside sidebar on mobile */
#sidebarAttendanceCard {
  display: none !important;
}

/* Attendance Widget in Sidebar (backup desktop style) */
.attendance-card {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  padding: 16px;
  border-radius: var(--border-radius-md);
  margin: 16px;
  color: #fff !important;
  box-shadow: none !important;
}

.attendance-card h3 {
  margin: 0 0 8px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #cbd5e1 !important;
  display: flex;
  align-items: center;
  gap: 8px;
}

.attendance-card h3 svg {
  color: var(--primary-light);
  width: 18px;
  height: 18px;
}
.attendance-card h3 i {
  color: var(--primary-light);
  font-size: 1.1rem;
  width: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.attendance-card p {
  font-size: 0.82rem;
  color: var(--sidebar-text);
  margin: 0 0 12px;
}

.attendance-card button {
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  font-size: 0.85rem;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 500;
  transition: var(--transition-fast);
}

.btn-signout,
#btnSignOutAttendanceMain {
  background: #ffffff !important;
  color: #000000 !important;
  border: 1.5px solid #000000 !important;
}
.btn-signout:hover,
#btnSignOutAttendanceMain:hover {
  background: #eeeeee !important;
  color: #000000 !important;
}
.btn-signout i,
.btn-signout svg,
#btnSignOutAttendanceMain i,
#btnSignOutAttendanceMain svg {
  color: #000000 !important;
}

.attendance-card .btn-signin {
  background: var(--success);
  color: #fff;
}
.attendance-card .btn-signin:hover {
  background: var(--success-hover);
  transform: scale(1.02);
}

.attendance-card .btn-signout {
  background: var(--danger);
  color: #fff;
}
.attendance-card .btn-signout:hover {
  background: var(--danger-hover);
  transform: scale(1.02);
}

.sidebar-bottom {
  display: contents;
}

.sidebar-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  align-items: center;
  padding: 0 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  overflow: visible;
}

.nav-link {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 10px;
  color: var(--sidebar-text);
  font-weight: 500;
  font-size: 0.9rem;
  transition: var(--transition-fast);
  white-space: nowrap;
  flex: 1;
  height: 100%;
}

.nav-link svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}
.nav-link i {
  font-size: 1.35rem;
  width: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-link:hover {
  color: var(--sidebar-text-active);
  background: transparent;
}

.nav-link span {
  display: none; /* Hide text on mobile navbar */
}

.nav-link.active {
  color: #000000 !important;
  background: #ffffff !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
  border-radius: var(--border-radius-sm);
  position: relative;
}

.nav-link.active i,
.nav-link.active svg {
  color: #000000 !important;
  filter: none !important;
}

.nav-link.active::after {
  display: none !important;
}

.sidebar-actions {
  display: none !important; /* Hide actions panel on mobile */
}

.logout-link-mobile {
  display: flex !important;
}

.sidebar-user {
  font-size: 0.85rem;
  color: var(--sidebar-text);
}
.sidebar-user strong {
  color: var(--sidebar-text-active);
}

.team-lead-tag {
  background: var(--success-light);
  color: var(--success-hover);
  font-weight: 600;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(16, 185, 129, 0.2);
  align-self: flex-start;
  text-transform: uppercase;
}

.logout-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #ffffff !important;
  color: #000000 !important;
  border-radius: var(--border-radius-sm);
  font-weight: 500;
  font-size: 0.9rem;
  transition: var(--transition-fast);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.logout-button i,
.logout-button svg,
.logout-button span {
  color: #000000 !important;
}
.logout-button:hover {
  background: #eeeeee !important;
  color: #000000 !important;
}

/* --- MAIN CONTENT & TAB CANVAS --- */
.content {
  flex: 1;
  padding: 80px 16px 88px; /* Spacing for fixed header (56px) and bottom nav (64px) */
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.page-head {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 20px;
  margin-bottom: 8px;
}

.eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--primary);
  letter-spacing: 0.08em;
  margin: 0 0 6px;
}

.page-head h1 {
  font-size: 1.6rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.025em;
  color: var(--text-main);
}

.page-head p {
  color: var(--text-muted);
  margin: 4px 0 0;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Metrics Dashboard Cards Grid */
.metric-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.metric-card {
  background: var(--bg-secondary);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--border-radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  transition: var(--transition-normal);
}

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

.metric-card-content {
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--text-light);
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.metric-card strong {
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.1;
}

.metric-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.metric-card-icon.primary { background: var(--primary-light); color: var(--primary); }
.metric-card-icon.success { background: var(--success-light); color: var(--success); }
.metric-card-icon.warning { background: var(--warning-light); color: var(--warning); }
.metric-card-icon.danger { background: var(--danger-light); color: var(--danger); }
.metric-card-icon.info { background: var(--info-light); color: var(--info); }

/* --- PANELS & CARDS CONTAINER --- */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.panel {
  background: var(--bg-secondary);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #f1f5f9;
}

.panel-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-header h2 svg {
  color: var(--primary);
  width: 20px;
  height: 20px;
}
.panel-header h2 i {
  color: var(--primary);
  font-size: 1.25rem;
  width: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.panel-tag {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 500;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
}

.panel-body {
  padding: 24px;
  flex: 1;
}

/* --- PLAYERS & COMMITMENTS --- */
.player-list {
  display: grid;
  gap: 16px;
}

.player-card {
  background: var(--bg-primary);
  border: 1.5px dashed #cbd5e1;
  border-radius: var(--border-radius-sm);
  padding: 20px;
  transition: var(--transition-normal);
  display: flex;
  flex-direction: column;
  position: relative;
}

.player-card:hover {
  border-color: var(--primary);
  border-style: solid;
  box-shadow: var(--shadow-sm);
}

.player-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.player-avatar-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.player-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #000000;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
}

.player-name-wrapper {
  display: flex;
  flex-direction: column;
}

.player-name-wrapper strong {
  color: var(--text-main);
  font-size: 0.95rem;
}

.meta-text {
  font-size: 0.75rem;
  color: var(--text-light);
}

.player-card p.commitment-content {
  font-size: 1rem;
  color: var(--text-muted);
  margin: 0 0 14px;
  font-weight: 500;
  line-height: 1.5;
}

.badge {
  font-weight: 600;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge.active { background: var(--info-light); color: var(--info); }
.badge.completed { background: var(--success-light); color: var(--success-hover); }
.badge.recommitted { background: var(--warning-light); color: var(--warning-hover); }
.badge.overdue { background: var(--danger-light); color: var(--danger-hover); }

/* Quick Action Row in Commitments */
.commitment-card-actions {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid #e2e8f0;
  padding-top: 12px;
  margin-top: auto;
}

.commitment-card-actions button {
  padding: 6px 12px;
  font-size: 0.82rem;
  height: auto;
  min-height: auto;
  border-radius: 6px;
}

/* Feed filters row */
.feed-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  background: var(--bg-primary);
  padding: 16px;
  border-radius: var(--border-radius-sm);
  border: 1px solid #e2e8f0;
}

.feed-filters input, .feed-filters select {
  flex: 1;
  min-width: 180px;
  background: #fff;
  padding: 10px 14px;
  font-size: 0.88rem;
}

/* --- LEADERBOARD & RANKINGS --- */
.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
}

.leaderboard-table th, .leaderboard-table td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
}

.leaderboard-table th {
  color: var(--text-light);
  font-weight: 500;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg-primary);
}

.leaderboard-table tr:hover {
  background: #fafafa;
}

.leaderboard-table tr:last-child td {
  border-bottom: none;
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-weight: 600;
  font-size: 0.85rem;
}

.rank-1 { background: #fef08a; color: #854d0e; box-shadow: 0 2px 5px rgba(234, 179, 8, 0.2); }
.rank-2 { background: #e2e8f0; color: #475569; }
.rank-3 { background: #ffedd5; color: #c2410c; }
.rank-other { background: #f1f5f9; color: #64748b; }

.leaderboard-ratio-bar-outer {
  background: #e2e8f0;
  height: 8px;
  border-radius: 999px;
  width: 100px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
}

.leaderboard-ratio-bar-inner {
  height: 100%;
  border-radius: 999px;
  background: var(--success);
}

/* --- PERFORMANCE CHARTS CONTAINER --- */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.chart-card {
  padding: 24px;
  background: var(--bg-secondary);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.chart-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-card h3 svg {
  color: var(--primary);
  width: 18px;
  height: 18px;
}
.chart-card h3 i {
  color: var(--primary);
  font-size: 1.1rem;
  width: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chart-container {
  position: relative;
  height: 280px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- MODAL DRAWER SLIDE-OVER --- */
.commitment-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 480px;
  background: #ffffff;
  z-index: 2000;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  outline: none;
}

.commitment-panel.open {
  transform: translateX(0);
}

.commitment-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.commitment-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.commitment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 1px solid #f1f5f9;
}

.commitment-header h2 {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-main);
}

.commitment-header p {
  margin: 4px 0 0;
  color: var(--text-light);
  font-size: 0.88rem;
}

.close-button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--text-light);
  border: 1px solid #cbd5e1;
  transition: var(--transition-fast);
}

.close-button:hover {
  background: var(--danger-light);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.2);
}

.commitment-form {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
  overflow-y: auto;
}

.commitment-form label {
  font-weight: 500;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: -12px;
}

.form-note {
  font-weight: 400;
  font-size: 0.85rem;
  color: #e90000;
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

.status-message {
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  min-height: 20px;
}

/* Sign out modal/card report */
.attendance-eod-wrapper {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8fafc;
  padding: 12px;
  border-radius: var(--border-radius-sm);
  border: 1.5px solid #cbd5e1;
}

.attendance-eod-wrapper label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.attendance-eod-wrapper textarea {
  font-size: 0.85rem;
  min-height: 80px;
  background: #fff;
}

/* --- ADMIN PANEL SPECIFICS --- */
.admin-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

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

.admin-table th, .admin-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

.admin-table th {
  background: var(--bg-primary);
  font-weight: 500;
  color: var(--text-light);
  font-size: 0.8rem;
  text-transform: uppercase;
}

.admin-table tr:hover {
  background: #fafafa;
}

/* Tab Content Switching */
.tab-content {
  display: none !important;
}

.tab-content.active {
  display: flex !important;
  flex-direction: column;
  gap: 24px;
}

/* Responsive Overrides */
@media (min-width: 900px) {
  .app-shell {
    flex-direction: row;
    height: 100vh;
    overflow: hidden;
  }
  
  .sidebar {
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width);
    height: 100%;
    border-bottom: none;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    background: var(--sidebar-bg);
  }
  
  .sidebar-top {
    position: static;
    z-index: auto;
    background: transparent;
    border-bottom: none;
  }
  
  .brand-bar {
    height: auto;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    justify-content: center;
  }
  
  .brand-bar img {
    height: 40px;
  }
  
  #sidebarAttendanceCard {
    display: block !important;
  }
  
  .sidebar-bottom {
    display: flex;
    flex-direction: column;
    flex: 1;
  }
  
  .sidebar-nav {
    position: static;
    height: auto;
    flex-direction: column;
    justify-content: flex-start;
    padding: 20px 16px;
    gap: 8px;
    overflow-x: visible;
    border-top: none;
    box-shadow: none;
    background: transparent;
  }
  
  .nav-link {
    width: 100%;
    font-size: 0.95rem;
    flex-direction: row;
    justify-content: flex-start;
    padding: 10px 14px;
    gap: 10px;
    height: auto;
    border-radius: var(--border-radius-sm);
  }
  
  .nav-link:hover {
    color: var(--sidebar-text-active);
    background: var(--sidebar-hover);
  }
  
  .nav-link span {
    display: inline;
  }
  
  .nav-link i {
    font-size: 1.1rem;
    width: 18px;
  }
  
  .nav-link.active {
    color: #000000 !important;
    background: #ffffff !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
  }
  
  .nav-link.active i,
  .nav-link.active svg {
    color: #000000 !important;
    filter: none !important;
  }
  
  .nav-link.active::after {
    display: none !important;
  }
  
  .sidebar-actions {
    display: flex !important;
    padding: 16px;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    flex-direction: column;
    gap: 10px;
  }
  
  .logout-link-mobile {
    display: none !important;
  }
  
  .content {
    height: 100vh;
    overflow-y: auto;
    padding: 40px;
  }
  
  .page-head {
    flex-direction: row;
    align-items: center;
  }
  
  .page-head h1 {
    font-size: 2rem;
  }
  
  .dashboard-grid {
    grid-template-columns: 2fr 1fr;
  }
  
  .charts-grid {
    grid-template-columns: 2fr 1.2fr;
  }
  
  .admin-grid {
    grid-template-columns: 1.2fr 1fr;
  }
}

/* Mobile footer defaults (hidden on desktop) */
.auth-mobile-footer {
  display: none;
}

.tm-circle {
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.5rem;
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  font-weight: 600;
  vertical-align: middle;
  line-height: 1;
  font-family: 'Roboto', sans-serif;
}

/* Mobile Auth Screens Overrides */
@media (max-width: 900px) {
  .auth-shell {
    background: #ffffff !important;
    padding: 40px 16px 80px !important; /* spacing for absolute footer */
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    position: relative !important;
  }

  .auth-page-logo {
    display: none !important;
  }

  .auth-card {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    max-width: 500px !important;
    width: 100% !important;
    margin: 0 auto 40px auto !important;
  }

  .auth-links {
    color: #000000 !important;
  }

  .auth-links a {
    color: #000000 !important;
  }

  .auth-signup-prompt {
    color: #000000 !important;
    font-weight: 600 !important;
  }

  .auth-signup-prompt a {
    color: #000000 !important;
  }

  .auth-mobile-footer {
    display: flex !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    margin-left: 0 !important;
    background: #000000 !important;
    color: #ffffff !important;
    padding: 16px 20px !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.05em !important;
    justify-content: center !important;
    align-items: center !important;
  }

  .status-text {
    color: #ff3333 !important;
  }
}

/* User Profile Header Double Circle Avatar */
.profile-avatar-header-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.profile-avatar-header {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--text-main);
  position: relative;
  text-transform: uppercase;
}

.profile-avatar-header::after {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  border: 1.5px solid var(--text-main);
}

/* --- RESPONSIVE MOBILE PORTAL LAYOUT OVERRIDES (max-width: 900px) --- */
@media (max-width: 900px) {
  /* Prevent horizontal layout overflow */
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }
  
  .app-shell {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }

  /* Fix display: contents browser bug that breaks position: fixed */
  .sidebar, .sidebar-bottom {
    display: block !important;
    position: static !important;
  }

  /* Hide Brand Bar / Sidebar Top on mobile */
  .sidebar-top {
    display: none !important;
  }

  /* Add space at the bottom to prevent navbar overlap */
  .content {
    padding: 24px 16px 96px !important;
  }

  /* Centered Header Layout: Logo left, greeting center, avatar right */
  .page-head {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 8px !important;
    border-bottom: none !important;
    padding-bottom: 12px !important;
    margin-bottom: 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .mobile-logo-header {
    display: block !important;
    flex: 0 0 auto !important;
  }

  .mobile-logo-header img {
    height: 24px !important;
    width: auto !important;
    object-fit: contain !important;
  }

  .header-title-container {
    flex: 1 !important;
    text-align: center !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    max-width: 180px !important;
    overflow: hidden !important;
  }

  .header-title-container .eyebrow {
    display: none !important;
  }

  .header-title-container h1 {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    margin: 0 !important;
    color: #000000 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
    text-transform: none !important;
  }

  .header-right-actions {
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
  }

  #btnLogCommitmentMain, .page-actions {
    display: none !important;
  }

  /* 3-Column Metrics Grid (using minmax to prevent horizontal stretching) */
  .metric-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 12px !important;
    margin-bottom: 20px !important;
  }

  .metric-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    padding: 10px 8px !important;
    box-shadow: none !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    min-height: 76px !important;
    justify-content: center !important;
    overflow: hidden !important;
  }

  .metric-card-icon {
    display: none !important;
  }

  .metric-label {
    font-size: 0.65rem !important;
    margin-bottom: 2px !important;
    text-transform: lowercase !important;
    color: #555555 !important;
  }

  .metric-card strong {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    color: #000000 !important;
  }

  /* Panel Overrides - Clean white panels without icons or extra headers */
  .panel {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 16px !important;
    box-shadow: none !important;
    padding: 16px !important;
    margin-bottom: 16px !important;
  }

  .panel-header {
    padding: 0 0 12px 0 !important;
    border-bottom: none !important;
  }

  .panel-header h2 {
    font-size: 1rem !important;
    font-weight: 500 !important;
    color: #000000 !important;
    display: flex !important;
    align-items: center !important;
  }

  .panel-header h2 svg, .panel-header h2 i {
    display: none !important;
  }

  .panel-header .panel-tag, .panel-header .badge {
    display: none !important;
  }

  /* lowercase performance card header text */
  #tabDashboard .panel:nth-of-type(1) .panel-header h2 span {
    text-transform: lowercase !important;
  }

  /* Capitalized Attendance card header text */
  #tabDashboard .panel:nth-of-type(2) .panel-header h2 span {
    text-transform: capitalize !important;
  }

  /* Force panel-body local scroll for overflow contents (e.g. charts/tables) */
  .panel-body {
    padding: 0 !important;
    overflow-x: auto !important;
    width: 100% !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .chart-container {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }
  
  canvas {
    max-width: 100% !important;
  }

  /* Feed filters stacked vertically to prevent side overflow */
  .feed-filters {
    flex-direction: column !important;
    gap: 8px !important;
  }

  .feed-filters input, .feed-filters select {
    min-width: 0 !important;
    width: 100% !important;
  }

  /* Floating Action Button (FAB) */
  .mobile-fab {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: fixed !important;
    bottom: 96px !important;
    right: 20px !important;
    width: 64px !important;
    height: 64px !important;
    background: #000000 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3) !important;
    z-index: 1000 !important;
    transition: transform var(--transition-fast), background-color var(--transition-fast) !important;
  }

  .mobile-fab:hover {
    background-color: #222222 !important;
  }

  .mobile-fab:active {
    transform: scale(0.95) !important;
  }

  .mobile-fab svg, .mobile-fab i {
    width: 32px !important;
    height: 32px !important;
    stroke-width: 1.5 !important;
    color: #ffffff !important;
  }

  /* Floating Bottom Navbar Pill-Dock (fixed to the viewport) */
  .sidebar-nav {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 72px !important;
    background: #000000 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-around !important;
    padding: 0 12px !important;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.3) !important;
    z-index: 10000 !important; /* Force high index */
    overflow-x: auto !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .sidebar-nav::-webkit-scrollbar {
    display: none !important;
  }

  .nav-link {
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 48px !important;
    height: 48px !important;
    background: #000000 !important;
    border: none !important; /* Removed white border outlines */
    border-radius: 8px !important;
    color: #ffffff !important;
    padding: 0 !important;
    margin: 0 4px !important;
    transition: all var(--transition-fast) !important;
  }

  .nav-link svg, .nav-link i {
    width: 20px !important;
    height: 20px !important;
    color: #ffffff !important;
  }

  .nav-link span {
    display: none !important;
  }

  .nav-link:hover {
    background: #111111 !important;
  }

  .nav-link.active {
    background: #ffffff !important;
    border: none !important;
    color: #000000 !important;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2) !important;
  }

  .nav-link.active svg, .nav-link.active i {
    color: #000000 !important;
  }
}
