/* Naqeeb Action Plan Style Sheet */

/* CSS Variables for Premium Dark Forest Theme */
:root {
  --bg-color: #080f0c;
  --surface-color: rgba(13, 26, 20, 0.65);
  --surface-border: rgba(16, 185, 129, 0.15);
  --surface-hover-border: rgba(16, 185, 129, 0.35);
  
  --primary-color: #10b981; /* Emerald */
  --primary-glow: rgba(16, 185, 129, 0.3);
  --primary-hover: #34d399;
  
  --secondary-color: #1e293b; /* Slate */
  --secondary-border: rgba(148, 163, 184, 0.1);
  --secondary-hover: rgba(148, 163, 184, 0.2);
  
  --warning-color: #f59e0b; /* Amber */
  --error-color: #ef4444; /* Rose */
  --success-color: #10b981; /* Emerald */
  
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  --font-heading: 'Outfit', 'Inter', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  
  --header-height: 70px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* Radial gradients for forest theme */
  --radial-1: rgba(4, 120, 87, 0.15);
  --radial-2: rgba(6, 95, 70, 0.15);
}

/* Midnight Slate Theme */
body.theme-dark {
  --bg-color: #090c15;
  --surface-color: rgba(20, 27, 45, 0.65);
  --surface-border: rgba(56, 189, 248, 0.12);
  --surface-hover-border: rgba(56, 189, 248, 0.35);
  --primary-color: #38bdf8; /* Cyan-blue */
  --primary-hover: #7dd3fc;
  --primary-glow: rgba(56, 189, 248, 0.25);
  --secondary-color: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --radial-1: rgba(56, 189, 248, 0.12);
  --radial-2: rgba(30, 41, 59, 0.25);
}

/* Ocean Blue Theme */
body.theme-blue {
  --bg-color: #030a1c;
  --surface-color: rgba(13, 27, 58, 0.7);
  --surface-border: rgba(0, 180, 216, 0.15);
  --surface-hover-border: rgba(0, 180, 216, 0.35);
  --primary-color: #00b4d8; /* Cyan */
  --primary-hover: #90e0ef;
  --primary-glow: rgba(0, 180, 216, 0.25);
  --secondary-color: #0d1e3d;
  --text-primary: #edf2f4;
  --text-secondary: #a2d2ff;
  --radial-1: rgba(0, 180, 216, 0.15);
  --radial-2: rgba(3, 105, 161, 0.18);
}

/* Classic Light Theme */
body.theme-light {
  --bg-color: #f8fafc;
  --surface-color: rgba(255, 255, 255, 0.85);
  --surface-border: rgba(148, 163, 184, 0.18);
  --surface-hover-border: rgba(4, 120, 87, 0.4);
  --primary-color: #047857; /* Dark Emerald */
  --primary-hover: #065f46;
  --primary-glow: rgba(4, 120, 87, 0.12);
  --secondary-color: #e2e8f0;
  --secondary-border: rgba(148, 163, 184, 0.2);
  --secondary-hover: rgba(148, 163, 184, 0.35);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --radial-1: rgba(16, 185, 129, 0.05);
  --radial-2: rgba(148, 163, 184, 0.06);
}

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

body {
  background-color: var(--bg-color);
  background-image: 
    radial-gradient(at 10% 10%, var(--radial-1) 0px, transparent 50%),
    radial-gradient(at 90% 90%, var(--radial-2) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  overflow-x: hidden;
}

/* App Layout Container */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: calc(40px + var(--safe-bottom));
}

/* Glassmorphism Panel Template */
.glass-panel {
  background-color: var(--surface-color);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

/* App Header styling */
.app-header {
  height: var(--header-height);
  background-color: var(--surface-color);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--surface-border);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 0 24px;
}

.header-main {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.brand-logo {
  font-size: 28px;
  color: var(--primary-color);
  text-shadow: 0 0 10px var(--primary-glow);
  animation: pulse 3s infinite ease-in-out;
}

.brand-text h1 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.2;
}

.brand-text span {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Common Buttons styling */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 8px;
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  outline: none;
  gap: 6px;
}

.btn-primary {
  background-color: var(--primary-color);
  color: #080f0c;
  box-shadow: 0 4px 12px var(--primary-glow);
}

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

.btn-secondary {
  background-color: var(--secondary-color);
  color: var(--text-primary);
  border-color: var(--secondary-border);
}

.btn-secondary:hover {
  background-color: var(--secondary-hover);
  border-color: rgba(148, 163, 184, 0.25);
}

/* Main content layout */
.app-content {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Summary Snapshot Table Card */
.summary-card {
  padding: 20px;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s ease, opacity 0.3s ease;
}

.summary-card.collapsed {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-color: transparent;
  opacity: 0;
  pointer-events: none;
  margin-bottom: -24px;
}

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

.card-header h2 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
}

.muted-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.summary-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.summary-table th, 
.summary-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(16, 185, 129, 0.08);
  font-size: 0.875rem;
}

.summary-table th {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.summary-table tr:last-child td {
  border-bottom: none;
  font-weight: 700;
  font-size: 0.9rem;
  background-color: rgba(16, 185, 129, 0.06);
}

.summary-table tr:hover td {
  background-color: rgba(16, 185, 129, 0.03);
}

.text-center {
  text-align: center;
}

/* Badge values */
.variance-val {
  font-weight: 600;
}
.variance-val.positive {
  color: #34d399; /* Positive variance green */
}
.variance-val.negative {
  color: #f87171; /* Negative variance red */
}
.variance-val.zero {
  color: var(--text-secondary);
}

/* Controls card (Search & Filters) */
.controls-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  font-size: 16px;
  color: var(--text-secondary);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  background-color: var(--bg-color);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s ease;
}

.search-box input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* Tabs list styling */
.filter-tabs-container {
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none;  /* IE */
}

.filter-tabs-container::-webkit-scrollbar {
  display: none; /* Safari/Chrome */
}

.filter-tabs {
  display: flex;
  gap: 8px;
  min-width: max-content;
}

.tab-btn {
  background-color: rgba(148, 163, 184, 0.05);
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: 8px;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  background-color: rgba(148, 163, 184, 0.1);
  color: var(--text-primary);
}

.tab-btn.active {
  background-color: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.25);
  color: var(--primary-color);
}

.badge {
  background-color: rgba(148, 163, 184, 0.2);
  color: var(--text-primary);
  padding: 2px 6px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
}

.badge-warning {
  background-color: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.badge-error {
  background-color: rgba(239, 68, 68, 0.25);
  color: #f87171;
}

.badge-success {
  background-color: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

/* Roster section list & grid */
.roster-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.roster-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px;
}

.roster-header h3 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.student-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 768px) {
  .student-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .student-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Student Cards styling */
/* ===== FLUENT DESIGN CARDS ===== */
.student-card {
  padding: 0;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  position: relative;
  border-radius: 12px;
  border: 1px solid var(--surface-border);
  background-color: var(--surface-color);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08);
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.2s ease,
              border-color 0.2s ease;
  /* Fluent Reveal highlight — subtle radial gradient that follows mouse */
  --reveal-x: 50%;
  --reveal-y: 50%;
}

/* Fluent reveal border highlight overlay */
.student-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    180px circle at var(--reveal-x) var(--reveal-y),
    rgba(255,255,255,0.06) 0%,
    transparent 70%
  );
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.student-card:hover::after {
  opacity: 1;
}

.student-card:hover {
  border-color: var(--primary-color);
  box-shadow:
    0 4px 16px rgba(0,0,0,0.18),
    0 1px 4px rgba(0,0,0,0.1),
    0 0 0 1px rgba(16, 185, 129, 0.25) inset;
  transform: translateY(-2px);
}

/* Top accent bar — Fluent color bar by status */
.student-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary-color);
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.student-card.status-completed::before  { background: var(--success-color); opacity: 0.8; }
.student-card.status-no-actual::before  { background: #f59e0b; opacity: 0.8; }
.student-card.status-no-plan::before    { background: var(--error-color); opacity: 0.8; }

.student-card:hover::before {
  opacity: 1;
}

/* Card header section */
.card-top {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.student-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  overflow: hidden;
}

.student-name {
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.student-id-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
  font-family: 'Cascadia Code', 'Consolas', monospace;
  letter-spacing: 0.03em;
}

/* Status badges — Fluent pill style */
.status-indicator {
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.status-indicator.no-plan {
  background-color: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.status-indicator.no-actual {
  background-color: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.status-indicator.completed {
  background-color: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

/* Card details (Planned/Actual rows) */
.card-details {
  background-color: rgba(148, 163, 184, 0.05);
  border-radius: 0;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.8rem;
  border: none;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.row-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.row-value {
  color: var(--text-primary);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.row-value.empty {
  color: var(--text-muted);
  font-weight: 400;
  font-style: italic;
}

.day-badge {
  background-color: rgba(148, 163, 184, 0.12);
  color: var(--text-secondary);
  padding: 1px 4px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
}

/* Remarks item on card */
.remarks-preview {
  font-size: 0.75rem;
  color: var(--text-secondary);
  padding: 0 4px;
  line-height: 1.4;
  word-break: break-word;
}

.remarks-label {
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 4px;
}

/* Card quick complete button — Fluent command button */
.card-actions {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid rgba(16, 185, 129, 0.06);
  padding-top: 10px;
}

.btn-quick-complete {
  background-color: transparent;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-quick-complete:hover {
  background-color: var(--primary-color);
  color: #080f0c;
  transform: scale(1.02);
}


/* Bottom Edit Drawer and Backdrop */
.drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1000;
}

.drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.edit-drawer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 85vh;
  overflow-y: auto;
  z-index: 1001;
  border-radius: 24px 24px 0 0;
  border-bottom: none;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 24px;
  padding-bottom: calc(24px + var(--safe-bottom));
}

@media (min-width: 768px) {
  .edit-drawer {
    left: auto;
    right: 0;
    top: 0;
    bottom: 0;
    width: 480px;
    max-height: 100vh;
    border-radius: 20px 0 0 20px;
    border-right: none;
    transform: translateX(100%);
    padding-bottom: 24px;
  }
}

.edit-drawer.active {
  transform: none;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.drawer-header h2 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.close-btn:hover {
  background-color: rgba(148, 163, 184, 0.1);
  color: var(--text-primary);
}

/* Drawer student banner */
.student-info-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background-color: rgba(16, 185, 129, 0.05);
  border-radius: 10px;
  margin-bottom: 20px;
  border: 1px solid rgba(16, 185, 129, 0.08);
}

.banner-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: #080f0c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
}

.student-info-banner h4 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.student-id {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

/* Form inputs & styling */
.drawer-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background-color: rgba(148, 163, 184, 0.05);
  padding: 16px;
  border-radius: 12px;
  border: 1px solid rgba(16, 185, 129, 0.04);
}

.form-section h3 {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary-color);
  letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(16, 185, 129, 0.1);
  padding-bottom: 6px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.form-group select, 
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  background-color: var(--bg-color);
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
  transition: all 0.2s ease;
}

.form-group select:focus, 
.form-group textarea:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.12);
}

.date-picker-wrapper {
  display: flex;
  gap: 8px;
  align-items: center;
}

.date-picker-wrapper input[type="date"] {
  flex: 1;
  padding: 10px 12px;
  background-color: var(--bg-color);
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
  min-height: 40px;
}

.date-picker-wrapper input[type="date"]:focus {
  border-color: var(--primary-color);
}

.day-indicator {
  background-color: rgba(148, 163, 184, 0.1);
  color: var(--text-secondary);
  padding: 10px 14px;
  border-radius: 8px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  min-width: 50px;
  text-align: center;
  border: 1px solid var(--surface-border);
}

.drawer-actions {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}

.drawer-actions .btn {
  flex: 1;
  padding: 12px;
}

/* Spinner and loading */
.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  grid-column: 1 / -1;
  padding: 60px 0;
  gap: 16px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(16, 185, 129, 0.1);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s infinite linear;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

/* Toast Notifications styling */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1010;
  pointer-events: none;
}

@media (min-width: 480px) {
  .toast-container {
    left: auto;
    width: 320px;
  }
}

.toast {
  padding: 12px 16px;
  border-radius: 8px;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transform: translateY(20px);
  animation: slideIn 0.3s forwards ease, slideOut 0.3s 3.5s forwards ease;
  pointer-events: auto;
}

.toast.success {
  background-color: var(--success-color);
  border: 1px solid rgba(255,255,255,0.1);
}

.toast.error {
  background-color: var(--error-color);
  border: 1px solid rgba(255,255,255,0.1);
}

@keyframes slideIn {
  to { opacity: 1; transform: none; }
}

@keyframes slideOut {
  to { opacity: 0; transform: translateY(-20px); }
}

/* Subtitle Inline Editor */
.subtitle-container {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
}

.last-updated {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 8px;
  padding-left: 8px;
  border-left: 1px solid var(--surface-border);
  display: inline-flex;
  align-items: center;
  font-weight: 500;
}

.subtitle-input {
  background-color: var(--bg-color);
  border: 1px solid var(--surface-border);
  color: var(--text-primary);
  padding: 2px 8px;
  font-size: 0.75rem;
  border-radius: 6px;
  width: 260px;
  outline: none;
  font-family: var(--font-body);
  transition: all 0.2s ease;
}

body.theme-light .subtitle-input {
  background-color: rgba(255, 255, 255, 0.9);
}

.subtitle-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.15);
}

.edit-title-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 4px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.edit-title-btn:hover {
  background-color: rgba(148, 163, 184, 0.12);
  color: var(--text-primary);
}

.hidden {
  display: none !important;
}

/* Inline Editing Styles */
.student-card.modified {
  border-color: #f59e0b !important;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.15) !important;
}

/* Modified badge — uses ::after so it doesn't conflict with the ::before accent bar */
.student-card.modified::after {
  content: "● Modified";
  position: absolute;
  bottom: 8px;
  left: 12px;
  font-size: 0.58rem;
  color: #fbbf24;
  background-color: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  pointer-events: none;
  z-index: 2;
  opacity: 1 !important; /* override the ::after reveal overlay reset */
}

/* Inline Edit Card Details Grid — Fluent card body */
.inline-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  padding: 16px;
}

.inline-remarks-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 1px solid rgba(148,163,184,0.08);
  padding-top: 10px;
  margin-top: 2px;
}

.inline-remarks-container label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.inline-field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.inline-field-group label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.inline-controls {
  display: flex;
  gap: 8px;
  width: 100%;
}

/* Custom styled inputs */
.inline-select, 
.inline-date,
.inline-remarks {
  background-color: var(--bg-color);
  border: 1px solid var(--surface-border);
  color: var(--text-primary);
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  outline: none;
  font-family: var(--font-body);
  transition: all 0.2s ease;
  min-height: 38px;
}

body.theme-light .inline-select, 
body.theme-light .inline-date,
body.theme-light .inline-remarks {
  background-color: rgba(255, 255, 255, 0.85);
  color: #0c120f;
  border-color: rgba(0,0,0,0.15);
}

.inline-select {
  flex: 1.3;
  cursor: pointer;
}

.inline-date {
  flex: 1;
  min-width: 120px;
}

/* Make calendar icon visible on dark themes */
.inline-date::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.8);
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.inline-date::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

body.theme-light .inline-date::-webkit-calendar-picker-indicator {
  filter: none;
  opacity: 0.6;
}

body.theme-light .inline-date::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

.inline-remarks {
  width: 100%;
  padding: 8px 12px;
}

.inline-select:focus, 
.inline-date:focus,
.inline-remarks:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.12);
}

/* Desktop Horizontal Layout */
@media (min-width: 1024px) {
  .student-grid {
    grid-template-columns: 1fr !important; /* Single column of horizontal rows on desktop */
  }
  
  .student-card {
    flex-direction: row !important;
    align-items: center;
    gap: 20px;
    padding: 12px 20px;
    cursor: default !important;
  }
  
  .student-card:hover {
    transform: none !important;
  }
  
  .card-top {
    flex: 0 0 260px;
    margin-bottom: 0;
    border-bottom: none;
    padding: 0 16px 0 0;
  }
  
  .inline-fields {
    flex-direction: row;
    flex: 1;
    gap: 20px;
    align-items: center;
  }
  
  .inline-field-group {
    flex: 1;
  }
  
  .inline-remarks-container {
    flex: 1.5;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
}

/* Floating Save Footer Bar styling */
.save-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 990;
  border-radius: 16px 16px 0 0;
  border-bottom: none;
  border-left: none;
  border-right: none;
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  padding: 16px 24px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
  border-top: 1px solid rgba(251, 191, 36, 0.2);
}

body.theme-light .save-footer {
  background-color: rgba(255, 255, 255, 0.95) !important;
  border-top: 1px solid rgba(245, 158, 11, 0.3);
}

.save-footer.active {
  transform: translateY(0);
  opacity: 1;
  background-color: var(--surface-color) !important;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.changes-count {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.9rem;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #fbbf24;
  animation: pulse-indicator 1.5s infinite;
}

@keyframes pulse-indicator {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(251, 191, 36, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(251, 191, 36, 0); }
}

.footer-actions {
  display: flex;
  gap: 12px;
}

.footer-actions button {
  min-height: 40px;
  padding: 8px 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* Sync Button Animation */
.spin-icon {
  display: inline-block;
  animation: spin-animation 1.2s linear infinite;
}

@keyframes spin-animation {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (max-width: 600px) {
  .app-header {
    height: auto !important;
    padding: 12px 16px !important;
  }
  
  .header-main {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .brand {
    gap: 8px;
  }
  
  .brand-logo {
    font-size: 24px;
  }
  
  .brand-text h1 {
    font-size: 1.1rem;
    line-height: 1.3;
  }
  
  .subtitle-container {
    flex-wrap: wrap;
    gap: 4px 8px;
    margin-top: 2px;
    display: flex;
    align-items: center;
  }
  
  .last-updated {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
    width: 100%;
    font-size: 0.72rem;
    margin-top: 4px;
    display: block;
  }
  
  .header-actions {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 6px !important;
  }
  
  .header-actions select,
  .header-actions button {
    flex: 1;
    font-size: 0.72rem !important;
    padding: 6px 4px !important;
    height: 36px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  
  .app-content {
    padding: 16px;
    gap: 16px;
  }
  
  .controls-card {
    padding: 12px;
    gap: 12px;
  }
  
  .filter-tabs {
    gap: 4px;
  }
  
  .tab-btn {
    padding: 6px 8px;
    font-size: 0.75rem;
    gap: 4px;
  }
}

/* Login Screen Overlay */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(4, 8, 6, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  transition: opacity 0.3s ease;
}

.login-overlay.hidden {
  display: none !important;
  opacity: 0;
  pointer-events: none;
}

.login-card {
  width: 100%;
  max-width: 380px;
  padding: 32px;
  text-align: center;
  border-radius: 20px;
}

.login-logo-container {
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
}

.login-logo {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.login-card h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.login-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.login-card .form-group {
  text-align: left;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-card label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.login-card input {
  padding: 10px 14px;
  background-color: var(--bg-color);
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s ease;
}

.login-card input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.login-error {
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 16px;
  text-align: left;
}

.login-error.hidden {
  display: none !important;
}

.login-btn {
  width: 100%;
  padding: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  margin-top: 8px;
}

/* ===== Scroll To Top Button ===== */
#scroll-top-btn {
  position: fixed;
  bottom: 90px; /* above the save footer */
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-color);
  color: #080f0c;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px var(--primary-glow);
  z-index: 980;
  opacity: 0;
  transform: translateY(20px) scale(0.8);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#scroll-top-btn.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

#scroll-top-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px) scale(1.05);
}



