/* ===================================================
   Main Variables - White Base & Soft Pastel Accents
   =================================================== */
:root {
  --bg-primary: #fdfdfd;
  --bg-secondary: #f5f7f6;
  --bg-tertiary: #ffffff;
  --bg-card: #fafbfa;

  --border-color: #e2e8e5;
  --border-strong: #cbd5d0;

  /* Text colors */
  --text-primary: #1a2420;
  --text-secondary: #4a5750;
  --text-muted: #96a39c;

  /* Soft pastel accents */
  --pastel-blue: #ddf0fd;
  --pastel-blue-hover: #b9e3fb;
  --pastel-blue-text: #0c6b9e;

  --pastel-purple: #f1e8ff;
  --pastel-purple-hover: #e3d3fe;
  --pastel-purple-text: #5b1fa8;

  --pastel-yellow: #fef5d4;
  --pastel-yellow-hover: #fde980;
  --pastel-yellow-text: #976010;

  --pastel-green: #d4fae7;
  --pastel-green-hover: #a8f2cc;
  --pastel-green-text: #0d5e35;

  --pastel-red: #fde8e8;
  --pastel-red-hover: #fbc8c8;
  --pastel-red-text: #891414;

  --pastel-indigo: #dde3ff;
  --pastel-indigo-hover: #c0ccff;
  --pastel-indigo-text: #2d31a0;

  /* Workspace backgrounds */
  --workspace-bg: #edf1f8;
  --workspace-dots: #c9d4e8;

  /* Shadows */
  --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.03);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 6px 24px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.07);

  /* Fonts */
  --font-sans: 'Inter', 'Sarabun', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Customized sheet variables - controlled by JS */
  --sheet-header-bg: #fbbf24;
  --sheet-header-text: #000000;
  --sheet-font: 'Sarabun', sans-serif;
  --sheet-border-weight: 1px;
}

/* ===================================================
   Dark Mode Variables
   =================================================== */
body.dark-mode {
  --bg-primary: #0b110e;
  --bg-secondary: #121815;
  --bg-tertiary: #19211c;
  --bg-card: #202a24;

  --border-color: #2b3631;
  --border-strong: #3f4e46;

  /* Text colors */
  --text-primary: #f2f4f3;
  --text-secondary: #c2ceca;
  --text-muted: #7f928a;

  /* Soft pastel accents in dark mode - richer, luminous tones */
  --pastel-blue: #162a45;
  --pastel-blue-hover: #213c5f;
  --pastel-blue-text: #60a5fa;

  --pastel-purple: #2c1a4d;
  --pastel-purple-hover: #3d296c;
  --pastel-purple-text: #c084fc;

  --pastel-yellow: #3c2a07;
  --pastel-yellow-hover: #543b0a;
  --pastel-yellow-text: #fbbf24;

  --pastel-green: #073822;
  --pastel-green-hover: #0c5635;
  --pastel-green-text: #34d399;

  --pastel-red: #3f1212;
  --pastel-red-hover: #5c1b1b;
  --pastel-red-text: #f87171;

  --pastel-indigo: #1d1b4c;
  --pastel-indigo-hover: #29266c;
  --pastel-indigo-text: #818cf8;

  /* Workspace backgrounds */
  --workspace-bg: #0e1412;
  --workspace-dots: #23312b;

  /* Shadows for dark mode */
  --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 6px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* ===================================================
   Reset & Scrollbar
   =================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: var(--border-strong);
  border-radius: 20px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--pastel-indigo-text);
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ===================================================
   App Shell
   =================================================== */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 1680px;
  margin: 0 auto;
  background-color: var(--bg-primary);
  box-shadow: var(--shadow-lg);
}

/* ===================================================
   Header
   =================================================== */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 28px;
  height: 66px;
  background-color: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
  position: relative;
  flex-shrink: 0;
}

/* Subtle accent bar on top of header */
.app-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #a5b4fc, #93c5fd, #86efac, #fde68a);
  border-radius: 0;
}

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

.logo-icon {
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  color: var(--pastel-indigo-text);
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.12);
}

.logo-text h1 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.logo-text p {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

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

.theme-toggle-btn {
  border-radius: 50% !important;
  width: 36px !important;
  height: 36px !important;
  background-color: var(--bg-secondary) !important;
  color: var(--text-secondary) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: var(--shadow-xs);
}

.theme-toggle-btn:hover {
  background-color: var(--border-color) !important;
  color: var(--text-primary) !important;
  transform: rotate(15deg);
}

/* ===================================================
   Status Badges
   =================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.badge-mock {
  background-color: var(--pastel-blue);
  color: var(--pastel-blue-text);
}

.badge-connected {
  background-color: var(--pastel-green);
  color: var(--pastel-green-text);
}

.badge-disconnected {
  background-color: var(--pastel-red);
  color: var(--pastel-red-text);
}

.badge-beta {
  background-color: var(--pastel-yellow);
  color: var(--pastel-yellow-text);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.62rem;
  font-weight: 700;
}

/* ===================================================
   Main 3-Column Grid
   =================================================== */
.app-main {
  display: grid;
  grid-template-columns: 360px 1fr 480px;
  flex: 1;
  overflow: hidden;
  height: calc(100vh - 66px);
}

/* ===================================================
   Panels
   =================================================== */
.panel {
  display: flex;
  flex-direction: column;
  background-color: var(--bg-tertiary);
  overflow-y: auto;
  border-right: 1px solid var(--border-color);
  padding: 24px 20px;
}

.panel:last-child {
  border-right: none;
}

/* Sticky Panel Header */
.panel-header-sticky {
  position: sticky;
  top: 0;
  background-color: var(--bg-tertiary);
  z-index: 10;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 22px;
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

h2 {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

h2 i {
  font-size: 0.8rem;
  color: var(--pastel-indigo-text);
}

.section-subtitle {
  font-size: 0.73rem;
  color: var(--text-muted);
  margin-top: 5px;
}

/* Panel Section Card styling - each section gets a subtle card look */
.panel-section {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
}

.panel-section:last-child {
  margin-bottom: 0;
}

.panel-section > h2 {
  margin-bottom: 14px;
}

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

/* ===================================================
   Forms & Inputs
   =================================================== */
.form-group {
  margin-bottom: 12px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-control {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 9px 12px;
  font-family: var(--font-sans);
  font-size: 0.83rem;
  background-color: var(--bg-tertiary);
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  transition: all 0.2s ease;
  outline: none;
}

.form-control-sm {
  padding: 6px 10px;
  font-size: 0.78rem;
  border-radius: 6px;
}

.form-control:focus,
.form-control-sm:focus {
  border-color: #a5b4fc;
  box-shadow: 0 0 0 3px rgba(165, 180, 252, 0.2);
}

.form-group-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.form-group-row > .form-group {
  min-width: 0;
  margin-bottom: 0;
}

input[type="date"].form-control,
input[type="datetime-local"].form-control {
  padding: 8px 8px;
  font-size: 0.8rem;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  padding: 0;
  margin: 0;
  font-size: 14px;
}

/* ===================================================
   Student Quick Info Card
   =================================================== */
.student-quick-info {
  background-color: var(--bg-tertiary);
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.student-quick-info-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 7px;
}

.student-quick-info-row:last-child {
  margin-bottom: 0;
}

.student-quick-info-label {
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ===================================================
   Buttons
   =================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  border: none;
  letter-spacing: -0.01em;
}

.btn:active {
  transform: scale(0.98);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.72rem;
  border-radius: 6px;
}

.btn-lg {
  padding: 13px 20px;
  font-size: 0.92rem;
}

.btn-full {
  width: 100%;
}

.btn-primary {
  background-color: var(--pastel-indigo);
  color: var(--pastel-indigo-text);
}

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

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

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

/* Prominent export button */
.btn-accent {
  background: linear-gradient(135deg, #bbf7d0, #86efac);
  color: var(--pastel-green-text);
  box-shadow: 0 2px 8px rgba(134, 239, 172, 0.3);
}

.btn-accent:hover {
  background: linear-gradient(135deg, #86efac, #4ade80);
  box-shadow: 0 4px 12px rgba(74, 222, 128, 0.35);
}

.btn-danger-outline {
  background-color: transparent;
  color: var(--pastel-red-text);
  border: 1.5px solid var(--pastel-red);
}

.btn-danger-outline:hover {
  background-color: var(--pastel-red);
}

/* Row layout for buttons (MISSING from previous version!) */
.btn-group-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-group-row .btn {
  flex: 1;
}

.btn-icon-only {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  border: none;
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
  flex-shrink: 0;
}

.btn-icon-only:hover {
  background-color: var(--border-color);
  color: var(--text-primary);
}

/* ===================================================
   Preset Date Range Buttons
   =================================================== */
.preset-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.btn-preset {
  background-color: var(--bg-tertiary);
  border: 1.5px solid var(--border-color);
  border-radius: 7px;
  padding: 7px 4px;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: center;
}

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

.btn-preset.active {
  background-color: var(--pastel-indigo);
  color: var(--pastel-indigo-text);
  border-color: var(--pastel-indigo-hover);
  font-weight: 700;
}

/* ===================================================
   Template Customizer Controls
   =================================================== */
.color-preset-picker {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.color-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2.5px solid #ffffff;
  box-shadow: 0 0 0 1.5px #d1d5db;
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s;
  outline: none;
  position: relative;
}

.color-dot:hover {
  transform: scale(1.18);
  box-shadow: 0 0 0 2px var(--border-strong);
}

.color-dot.active {
  box-shadow: 0 0 0 2.5px var(--pastel-indigo-text);
  transform: scale(1.12);
}

/* Color dot name labels appear on hover */
.color-dot::after {
  content: attr(title);
  position: absolute;
  bottom: -24px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.6rem;
  font-family: var(--font-sans);
  color: var(--text-muted);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}

.color-dot:hover::after {
  opacity: 1;
}

.toggle-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.toggle-control {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.toggle-control input[type="checkbox"] {
  accent-color: var(--pastel-indigo-text);
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* ===================================================
   User Profile Info Card
   =================================================== */
.user-profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f0f4ff, #e8f5e9);
  border: 1px solid var(--border-color);
  margin-bottom: 12px;
}

#user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ffffff;
  box-shadow: var(--shadow-sm);
}

.user-info-text {
  flex: 1;
  min-width: 0;
}

#user-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#user-email {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===================================================
   Collapsible Section (Google API)
   =================================================== */
.collapsible-section .collapsible-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.collapsible-section .toggle-icon {
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: transform 0.25s ease;
}

.collapsible-section.collapsed .collapsible-content {
  display: none;
}

.collapsible-section:not(.collapsed) .toggle-icon {
  transform: rotate(180deg);
}

.collapsible-content {
  margin-top: 12px;
}

.hidden {
  display: none !important;
}

/* ===================================================
   Schedule Panel - Event Cards
   =================================================== */
.events-container {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
}

.events-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Event Card */
.event-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: 10px;
  border: 1.5px solid var(--border-color);
  background-color: var(--bg-tertiary);
  transition: all 0.18s ease;
  position: relative;
}

.event-card:hover {
  border-color: #a5b4fc;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.05);
}

.event-card.excluded {
  opacity: 0.45;
  background-color: var(--bg-secondary);
  border-color: var(--border-color);
}

.event-card.manual-added {
  border-style: dashed;
  border-color: #a78bfa;
}

.event-card-checkbox {
  margin-top: 9px;
  cursor: pointer;
  accent-color: var(--pastel-indigo-text);
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

/* Weekday Circle Badges */
.day-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
  margin-top: 1px;
}

.day-sun { background: linear-gradient(135deg, #f87171, #ef4444); }
.day-mon { background: linear-gradient(135deg, #fde68a, #fbbf24); color: #78350f; }
.day-tue { background: linear-gradient(135deg, #f9a8d4, #ec4899); }
.day-wed { background: linear-gradient(135deg, #6ee7b7, #10b981); }
.day-thu { background: linear-gradient(135deg, #fdba74, #f97316); }
.day-fri { background: linear-gradient(135deg, #93c5fd, #3b82f6); }
.day-sat { background: linear-gradient(135deg, #c4b5fd, #8b5cf6); }
.day-manual { background: linear-gradient(135deg, #94a3b8, #64748b); }

.event-card-content {
  flex: 1;
  min-width: 0;
}

.event-card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 4px;
}

.event-card-title {
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Status Badges (on event cards) */
.status-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

.status-badge-attended {
  background-color: var(--pastel-green);
  color: var(--pastel-green-text);
}

.status-badge-zoom {
  background-color: var(--pastel-blue);
  color: var(--pastel-blue-text);
}

.status-badge-absent {
  background-color: var(--pastel-red);
  color: var(--pastel-red-text);
}

.status-badge-makeup {
  background-color: var(--pastel-purple);
  color: var(--pastel-purple-text);
}

.event-card-time {
  font-size: 0.73rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.event-card-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
}

.event-hours-input {
  width: 72px;
  flex-shrink: 0;
}

.event-hours-input input {
  padding: 5px 8px;
  font-size: 0.75rem;
  text-align: center;
}

.event-card-status {
  flex: 1;
}

.status-select {
  padding: 5px 8px;
  font-size: 0.73rem;
  border-radius: 6px;
  background-color: var(--bg-secondary);
  border: 1.5px solid var(--border-color);
  width: 100%;
  font-family: var(--font-sans);
}

.status-select:focus {
  border-color: #a5b4fc;
  outline: none;
}

.btn-delete-event {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.18s;
  padding: 4px 6px;
  border-radius: 4px;
}

.btn-delete-event:hover {
  color: var(--pastel-red-text);
  background-color: var(--pastel-red);
}

/* ===================================================
   Add Manual Event Section
   =================================================== */
.add-manual-event {
  border-top: 1px solid var(--border-color);
  padding-top: 18px;
  margin-top: 16px;
}

.add-manual-event h3 {
  font-size: 0.75rem;
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.manual-event-form .form-group-row {
  grid-template-columns: 1.5fr 80px auto;
  gap: 8px;
  margin-bottom: 0;
}

/* ===================================================
   Preview Panel - Invoice Workspace
   =================================================== */
.invoice-container-outer {
  background-color: var(--workspace-bg);
  background-image:
    radial-gradient(circle, var(--workspace-dots) 1px, transparent 1px);
  background-size: 18px 18px;
  padding: 24px;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: auto;
  flex: 1;
  min-height: 380px;
  position: relative;
}

/* ===================================================
   Invoice Summary Bar (between preview and export buttons)
   =================================================== */
.invoice-summary-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: linear-gradient(135deg, var(--pastel-indigo), #dde7ff);
  border: 1px solid var(--pastel-indigo-hover);
  border-radius: 10px;
  padding: 12px 20px;
  margin-top: 14px;
}

.summary-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.summary-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--pastel-indigo-text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.75;
}

.summary-value {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--pastel-indigo-text);
  letter-spacing: -0.02em;
}

.summary-price {
  font-size: 1rem;
  color: #1e3a8a;
}

.summary-divider {
  width: 1px;
  height: 32px;
  background-color: var(--pastel-indigo-hover);
  margin: 0 8px;
}

/* Modal form body padding */
.modal-form-body {
  padding: 18px 20px 6px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Zoom wrapper */
.invoice-zoom-wrapper {
  transform-origin: top center;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-block;
}

/* ===================================================
   Invoice Sheet Preview (Simulated Google Sheets)
   =================================================== */
.invoice-sheet-preview {
  width: 720px;
  min-width: 720px;
  background-color: #ffffff;
  padding: 36px 36px 28px;
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.04),
    0 8px 24px rgba(0, 0, 0, 0.07),
    0 20px 50px rgba(0, 0, 0, 0.04);
  font-family: var(--sheet-font);
  color: #111827;
  display: flex;
  flex-direction: column;
  transition: font-family 0.15s ease;
  border-radius: 16px;
}

.sheet-invoice-box {
  width: 100%;
}

.sheet-title-row {
  width: 100%;
  margin-bottom: 6px;
}

.sheet-cell-title {
  font-size: 17px;
  font-weight: 800;
  color: #111827;
  text-align: center;
  padding: 10px 12px;
  border: 1.5px solid #cbd5e1;
  background-color: #f8fafc;
  letter-spacing: -0.02em;
  border-radius: 10px;
}

.sheet-billing-period-row {
  width: 100%;
  margin-bottom: 18px;
}

.sheet-cell-subtitle {
  font-size: 12.5px;
  font-weight: 600;
  color: #6b7280;
  text-align: center;
  padding: 5px 10px;
  border: 1.5px solid #e2e8f0;
  background-color: #ffffff;
  letter-spacing: 0.02em;
  border-radius: 8px;
}

/* Main Table */
.sheet-table {
  width: 100%;
  display: flex;
  flex-direction: column;
  border: var(--sheet-border-weight) solid #9ca3af;
  margin-bottom: 14px;
  border-radius: 10px;
  overflow: hidden;
}

.sheet-row {
  display: flex;
  width: 100%;
}

.sheet-header-row {
  background-color: var(--sheet-header-bg);
  color: var(--sheet-header-text);
  font-weight: 800;
  font-size: 12.5px;
  border-bottom: 2px solid #9ca3af;
  transition: background-color 0.15s, color 0.15s;
}

.sheet-header-row div {
  padding: 9px 8px;
  border-right: var(--sheet-border-weight) solid #a8a29e;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sheet-header-row div:last-child {
  border-right: none;
}

/* Column widths */
.sheet-col-num { width: 9%; text-align: center; }
.sheet-col-datetime { width: 51%; }
.sheet-col-hours { width: 20%; text-align: center; }
.sheet-col-price { width: 20%; text-align: center; }

.sheet-body-container {
  display: flex;
  flex-direction: column;
  position: relative;
}

.sheet-body-row {
  display: flex;
  width: 100%;
  font-size: 12.5px;
  border-bottom: var(--sheet-border-weight) solid #e5e7eb;
  background-color: #ffffff;
}

.sheet-body-row:nth-child(even) {
  background-color: #fafafa;
}

.sheet-body-row:last-child {
  border-bottom: none;
}

.sheet-body-row > div {
  padding: 9px 8px;
  border-right: var(--sheet-border-weight) solid #e5e7eb;
  display: flex;
  align-items: center;
}

.sheet-body-row .sheet-col-num { justify-content: center; font-weight: 600; color: #6b7280; }
.sheet-body-row .sheet-col-datetime { padding-left: 12px; }
.sheet-body-row .sheet-col-hours { justify-content: center; font-weight: 600; }

/* Merged price column */
.sheet-price-container {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 20%;
  border-left: var(--sheet-border-weight) solid #9ca3af;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  background-color: #ffffff;
  letter-spacing: -0.02em;
}

/* Borderless style variation */
.sheet-table.borderless-style {
  border: 1px solid #f0f0f0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}
.sheet-table.borderless-style .sheet-header-row {
  border-bottom: none;
}
.sheet-table.borderless-style .sheet-header-row div {
  border-right: none;
}
.sheet-table.borderless-style .sheet-body-row {
  border-bottom: 1px solid #f5f5f5;
}
.sheet-table.borderless-style .sheet-body-row > div {
  border-right: none;
}
.sheet-table.borderless-style .sheet-price-container {
  border-left: 1px solid #f5f5f5;
}

/* Warning Note Box */
.sheet-warning-box {
  background: linear-gradient(135deg, #fef9ec, #fef3c7);
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 12px 16px;
  text-align: center;
}

.sheet-warning-box p {
  color: #92400e;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.7;
}

/* ===================================================
   Preview Zoom Controls
   =================================================== */
.zoom-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: var(--bg-secondary);
  padding: 3px 5px;
  border-radius: 7px;
  border: 1.5px solid var(--border-color);
}

.btn-zoom {
  width: 22px;
  height: 22px;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 0.65rem;
  transition: background-color 0.15s, color 0.15s;
}

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

#zoom-value {
  font-size: 0.72rem;
  font-weight: 700;
  min-width: 34px;
  text-align: center;
  color: var(--text-secondary);
}

/* ===================================================
   Export Action Buttons
   =================================================== */
.action-buttons-group {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

/* ===================================================
   Modal
   =================================================== */
.modal {
  display: none;
  position: fixed;
  z-index: 200;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 20, 18, 0.2);
  backdrop-filter: blur(3px);
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background-color: var(--bg-tertiary);
  border-radius: 14px;
  width: 92%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  animation: modalFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-header {
  padding: 16px 20px;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
}

.modal-header h3 {
  font-size: 0.9rem;
  font-weight: 800;
}

.close-modal {
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  transition: background-color 0.15s;
}

.close-modal:hover {
  color: var(--text-primary);
  background-color: var(--border-color);
}

/* Modal form body padding */
#student-form > div.form-group,
#student-form > div.form-group-row {
  padding: 0 20px;
}

#student-form > div.form-group:first-of-type {
  padding-top: 18px;
}

.required {
  color: var(--pastel-red-text);
}

.field-help {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.5;
}

.modal-footer {
  padding: 14px 20px;
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  position: sticky;
  bottom: 0;
}

/* ===================================================
   Empty States
   =================================================== */
.empty-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 20px;
  color: var(--text-muted);
  text-align: center;
  gap: 10px;
  border: 1.5px dashed var(--border-color);
  border-radius: 10px;
  background-color: var(--bg-secondary);
}

.empty-placeholder i {
  font-size: 1.8rem;
  opacity: 0.4;
}

/* ===================================================
   Step Badges for Flow Guide
   =================================================== */
.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--pastel-indigo);
  color: var(--pastel-indigo-text);
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  margin-right: 6px;
  line-height: 1;
}

/* ===================================================
   Responsive Layout
   =================================================== */
@media (max-width: 1300px) {
  .app-main {
    grid-template-columns: 330px 1fr;
    grid-template-rows: auto auto;
    overflow-y: auto;
    height: auto;
  }
  .panel {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    overflow-y: visible;
  }
  .preview-panel {
    grid-column: span 2;
  }
}

@media (max-width: 768px) {
  .app-main {
    grid-template-columns: 1fr;
  }
  .preview-panel {
    grid-column: span 1;
  }
  .form-group-row {
    grid-template-columns: 1fr;
  }
}

/* ===================================================
   New Features Styling
   =================================================== */

/* Header User Avatar */
.header-avatar-container {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border-color);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-xs);
  flex-shrink: 0;
}

.header-avatar-container:hover {
  transform: scale(1.08);
  border-color: var(--pastel-indigo-text);
}

#header-user-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Advanced API Settings Toggle */
.advanced-settings-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  background-color: transparent;
  border: none;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease;
  margin-top: 10px;
}

.advanced-settings-toggle:hover {
  color: var(--pastel-indigo-text);
  text-decoration: underline;
}

.advanced-settings-toggle i {
  font-size: 0.62rem;
  transition: transform 0.2s ease;
}

.advanced-settings-toggle.active i {
  transform: rotate(180deg);
}

/* Fullscreen Preview Modal */
.preview-modal .preview-modal-content {
  max-width: 900px;
  width: 90%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.preview-modal-body {
  flex: 1;
  overflow: auto;
  background-color: var(--workspace-bg);
  background-image: radial-gradient(circle, var(--workspace-dots) 1px, transparent 1px);
  background-size: 18px 18px;
  padding: 30px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 400px;
}

.modal-invoice-wrapper {
  position: relative;
  width: 720px;
  margin: 0 auto;
  transition: width 0.2s, height 0.2s;
}

.preview-modal-body #modal-invoice-sheet {
  width: 720px;
  min-width: 720px;
  transform-origin: top left;
  position: absolute;
  top: 0;
  left: 0;
  transition: transform 0.2s;
}

/* Notion-Style Multi-Select Day Selector */
.notion-tag-select {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: var(--bg-tertiary);
  padding: 4px 8px;
  cursor: pointer;
  width: 100%;
  user-select: none;
  transition: all 0.2s ease;
}

.notion-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex: 1;
  align-items: center;
}

.placeholder-text {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.notion-select-arrow {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-left: 6px;
  transition: transform 0.2s ease;
}

.notion-tag-select.active .notion-select-arrow {
  transform: rotate(180deg);
}

.notion-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 1px;
  border: 1px solid rgba(0, 0, 0, 0.03);
  animation: tagFadeIn 0.15s ease;
}

@keyframes tagFadeIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.notion-tag-remove {
  cursor: pointer;
  font-size: 0.65rem;
  opacity: 0.45;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s;
  margin-left: 2px;
}

.notion-tag-remove:hover {
  opacity: 1;
}

/* Notion weekday color tags */
.notion-tag-mon { background-color: #fef3c7; color: #78350f; }
.notion-tag-tue { background-color: #fbcfe8; color: #9d174d; }
.notion-tag-wed { background-color: #d1fae5; color: #065f46; }
.notion-tag-thu { background-color: #ffedd5; color: #9a3412; }
.notion-tag-fri { background-color: #dbeafe; color: #1e40af; }
.notion-tag-sat { background-color: #f3e8ff; color: #5b21b6; }
.notion-tag-sun { background-color: #fee2e2; color: #991b1b; }

body.dark-mode .notion-tag-mon { background-color: #543b0a; color: #fbbf24; }
body.dark-mode .notion-tag-tue { background-color: #5c1b3c; color: #f9a8d4; }
body.dark-mode .notion-tag-wed { background-color: #0c5635; color: #34d399; }
body.dark-mode .notion-tag-thu { background-color: #6a3005; color: #fdba74; }
body.dark-mode .notion-tag-fri { background-color: #1e40af; color: #93c5fd; }
body.dark-mode .notion-tag-sat { background-color: #4c1d95; color: #c4b5fd; }
body.dark-mode .notion-tag-sun { background-color: #7f1d1d; color: #fca5a5; }

.notion-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  z-index: 150;
  display: none;
  margin-top: 6px;
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
  animation: modalFadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.notion-tag-select.active .notion-dropdown {
  display: block;
}

.notion-dropdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  margin: 2px;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--text-primary);
  transition: background-color 0.15s;
}

.notion-dropdown-item:hover {
  background-color: var(--bg-secondary);
}

.notion-dropdown-item.selected {
  background-color: var(--bg-secondary);
  font-weight: 700;
}

.notion-item-tag {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
}

/* Invoice Sheet Header Layout */
.sheet-header-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: stretch;
  margin-bottom: 6px;
  position: relative;
  width: 100%;
}

/* When student box is visible, layout becomes two columns */
.sheet-header-layout:not(.single-col) {
  grid-template-columns: 1fr auto;
}

.sheet-cell-title {
  font-size: 17px;
  font-weight: 800;
  color: #111827;
  text-align: center;
  padding: 10px 12px;
  border: 1.5px solid #cbd5e1;
  background-color: #f8fafc;
  letter-spacing: -0.02em;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

/* Student Name Box in Top-Right of sheet */
.sheet-student-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
  background-color: var(--sheet-student-box-bg, #f0fdf4);
  border: 1.5px solid var(--sheet-student-box-border, #bbf7d0);
  border-radius: 10px;
  color: var(--sheet-student-box-text, #166534);
  min-width: 130px;
  max-width: 220px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  font-family: inherit;
  transition: all 0.15s ease;
}

.student-box-label {
  font-size: 8.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.7;
  margin-bottom: 1px;
}

.student-box-name {
  font-size: 13.5px;
  font-weight: var(--sheet-student-box-font-weight, 800);
  font-style: var(--sheet-student-box-font-style, normal);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

/* Color Presets for Student Box Customizer */
.color-dot-student {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2.5px solid #ffffff;
  box-shadow: 0 0 0 1.5px #d1d5db;
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s;
  outline: none;
  position: relative;
}

.color-dot-student:hover {
  transform: scale(1.18);
  box-shadow: 0 0 0 2px var(--border-strong);
}

.color-dot-student.active {
  box-shadow: 0 0 0 2.5px var(--pastel-indigo-text);
  transform: scale(1.12);
}

.color-dot-student::after {
  content: attr(title);
  position: absolute;
  bottom: -24px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.6rem;
  font-family: var(--font-sans);
  color: var(--text-muted);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}

.color-dot-student:hover::after {
  opacity: 1;
}

/* ===================================================
   Invoice Template Styles & Backgrounds
   =================================================== */

/* Select-All Row Styling */
.select-all-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 16px 5px 16px;
  font-size: 0.8rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

/* Background Options */
.invoice-sheet-preview.bg-white {
  background-color: #ffffff;
}
.invoice-sheet-preview.bg-warm-cream {
  background-color: #fdfbf7;
}
.invoice-sheet-preview.bg-pastel-blue {
  background-color: #f0f9ff;
}
.invoice-sheet-preview.bg-pastel-sage {
  background-color: #f0fdf4;
}
.invoice-sheet-preview.bg-pastel-lilac {
  background-color: #faf5ff;
}
.invoice-sheet-preview.bg-pastel-pink {
  background-color: #fff5f5;
}

/* Subtitle shading adjustments for background contrast */
.invoice-sheet-preview.bg-warm-cream .sheet-cell-subtitle { background-color: #fdfbf7; }
.invoice-sheet-preview.bg-pastel-blue .sheet-cell-subtitle { background-color: #f0f9ff; }
.invoice-sheet-preview.bg-pastel-sage .sheet-cell-subtitle { background-color: #f0fdf4; }
.invoice-sheet-preview.bg-pastel-lilac .sheet-cell-subtitle { background-color: #faf5ff; }
.invoice-sheet-preview.bg-pastel-pink .sheet-cell-subtitle { background-color: #fff5f5; }

/* --- 1. Classic (Default Spreadsheet) --- */
/* (Uses standard spreadsheet lines) */

/* --- 2. Modern Receipt --- */
.invoice-sheet-preview.style-modern {
  border-radius: 20px;
}
.invoice-sheet-preview.style-modern .sheet-cell-title {
  border: none;
  background-color: transparent;
  font-size: 19px;
  font-weight: 700;
  text-align: left;
  padding: 4px 0;
  color: #111827;
}
.invoice-sheet-preview.style-modern .sheet-billing-period-row {
  margin-bottom: 24px;
}
.invoice-sheet-preview.style-modern .sheet-cell-subtitle {
  border: none;
  background-color: transparent;
  font-size: 13px;
  font-weight: 500;
  color: #4b5563;
  text-align: left;
  padding: 0;
}
.invoice-sheet-preview.style-modern .sheet-table {
  border: none;
  border-bottom: 2px solid #e5e7eb;
  border-radius: 0;
  overflow: visible;
}
.invoice-sheet-preview.style-modern .sheet-header-row {
  background-color: var(--sheet-header-bg) !important;
  color: var(--sheet-header-text) !important;
  border-radius: 8px;
  border-bottom: none;
}
.invoice-sheet-preview.style-modern .sheet-header-row div {
  border-right: none;
  font-weight: 700;
  padding: 10px 8px;
}
.invoice-sheet-preview.style-modern .sheet-body-row {
  background-color: transparent !important;
  border-bottom: 1px solid #e5e7eb;
  font-size: 13px;
}
.invoice-sheet-preview.style-modern .sheet-body-row div {
  border-right: none;
  padding: 12px 8px;
}
.invoice-sheet-preview.style-modern .sheet-body-row:last-child {
  border-bottom: 2px solid #cbd5e1;
}

/* --- 3. Playful Cards --- */
.invoice-sheet-preview.style-playful {
  border-radius: 24px;
}
.invoice-sheet-preview.style-playful .sheet-cell-title {
  border: 1.5px dashed var(--sheet-header-bg);
  background-color: rgba(254, 243, 199, 0.4);
  font-size: 18px;
  font-weight: 700;
  border-radius: 14px;
  padding: 12px;
}
.invoice-sheet-preview.style-playful .sheet-cell-subtitle {
  border: 1.5px dashed #cbd5e1;
  background-color: rgba(248, 250, 252, 0.4);
  font-size: 13px;
  border-radius: 12px;
  padding: 8px;
}
.invoice-sheet-preview.style-playful .sheet-table {
  border: none;
  border-radius: 0;
  overflow: visible;
  gap: 8px;
}
.invoice-sheet-preview.style-playful .sheet-header-row {
  background-color: var(--sheet-header-bg) !important;
  color: var(--sheet-header-text) !important;
  border-radius: 12px;
  border-bottom: none;
}
.invoice-sheet-preview.style-playful .sheet-header-row div {
  border-right: none;
  font-weight: 700;
  padding: 10px 8px;
}
.invoice-sheet-preview.style-playful .sheet-body-row {
  background-color: #ffffff !important;
  border: 1.5px solid var(--border-color);
  border-radius: 14px;
  margin-bottom: 2px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.015);
  font-size: 13px;
}
.invoice-sheet-preview.style-playful .sheet-body-row div {
  border-right: none;
  padding: 12px 8px;
}
.invoice-sheet-preview.style-playful .sheet-body-row:last-child {
  border-bottom: 1.5px solid var(--border-color);
}

/* ===================================================
   Google Sheets DB Panel & Bulk Invoice styles
   =================================================== */
.sheets-db-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sheets-db-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--pastel-blue-text) !important;
  background-color: var(--pastel-blue);
  padding: 8px 12px;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  width: fit-content;
}

.sheets-db-link:hover {
  background-color: var(--pastel-blue-hover);
  border-color: var(--pastel-blue-text);
}

.bulk-preview-selector-container {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 12px;
  border-radius: 8px;
  box-shadow: var(--shadow-xs);
}

.bulk-preview-selector-container select {
  margin-top: 4px;
}

.bulk-actions-section {
  display: flex;
  flex-direction: column;
}

.btn-accent-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  background-color: transparent;
  color: var(--pastel-green-text);
  border: 2px solid var(--pastel-green-hover);
  transition: all 0.2s ease;
}

.btn-accent-outline:hover {
  background-color: var(--pastel-green);
  border-color: var(--pastel-green-hover);
}

.btn-accent-outline:disabled, .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Dynamic Student Rows inside Modal */
.modal-student-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  animation: modalRowSlideIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalRowSlideIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-student-row input.form-control,
.modal-student-row select.form-control {
  padding: 6px 10px;
  font-size: 0.8rem;
}

.modal-student-row .btn-danger-outline {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  height: 34px;
  width: 34px;
  flex-shrink: 0;
}

/* Quick Info Table & Badges */
.student-quick-info-section {
  display: flex;
  flex-direction: column;
}

.quick-info-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 4px;
  background-color: var(--bg-secondary);
  border-radius: 8px;
  overflow: hidden;
  border: 1.5px solid var(--border-color);
}

.quick-info-table th {
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 8px 10px;
  border-bottom: 1.5px solid var(--border-color);
}

.quick-info-table td {
  padding: 8px 10px;
  font-size: 0.76rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
}

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

.quick-info-badge {
  display: inline-block;
  padding: 2px 6px;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 4px;
  text-align: center;
  border: 1px solid transparent;
}

.quick-info-badge.badge-flat {
  background-color: var(--pastel-yellow);
  color: var(--pastel-yellow-text);
  border-color: var(--pastel-yellow-hover);
}

.quick-info-badge.badge-hourly {
  background-color: var(--pastel-blue);
  color: var(--pastel-blue-text);
  border-color: var(--pastel-blue-hover);
}

.quick-info-badge.badge-billing-monthly {
  background-color: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.quick-info-badge.badge-billing-prepaid {
  background-color: #fff7ed;
  color: #c2410c;
  border-color: #fed7aa;
}

/* Batch Results Modal Styles */
.batch-result-card {
  border: 1px solid var(--border-color);
  border-left: 5px solid #d1d5db; /* Default gray left border */
  border-radius: 8px;
  background-color: var(--bg-secondary);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: box-shadow 0.2s, transform 0.2s;
}

.batch-result-card:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.batch-result-card.success {
  border-left-color: #10b981; /* Green */
}

.batch-result-card.anomaly {
  border-left-color: #f97316; /* Orange */
  background-color: #fffbeb; /* Soft light yellow warm background tint */
}

.batch-result-card.needs-input {
  border-left-color: #9ca3af; /* Gray */
  background-color: #f9fafb; /* Light gray tint */
}

.batch-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.batch-result-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.batch-result-student-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary);
}

.batch-result-group-name {
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.batch-result-meta {
  display: flex;
  gap: 6px;
  align-items: center;
}

.batch-result-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-primary);
  border-top: 1px dashed var(--border-color);
  padding-top: 8px;
}

.batch-result-sessions {
  font-weight: 500;
}

.batch-result-price {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--pastel-indigo-text);
}

.batch-result-anomaly-msg {
  font-size: 0.72rem;
  color: #d97706; /* Dark orange */
  font-weight: 600;
  margin-top: 4px;
}

.batch-result-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 8px;
  margin-top: 4px;
}

.batch-checkbox-container {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.batch-card-checkbox {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  cursor: pointer;
  accent-color: #10b981;
}

.batch-inline-picker-container {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
  background: var(--bg-primary);
  padding: 8px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.batch-inline-picker-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.batch-inline-picker-input {
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.batch-preview-wrapper {
  width: 100%;
  max-width: 490px;
  height: 350px;
  overflow: hidden;
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.05);
}

.batch-preview-scale-wrapper {
  transform: scale(0.68);
  transform-origin: top left;
  width: 720px;
  min-width: 720px;
  height: auto;
  display: block;
}





