@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Plus+Jakarta+Sans:ital,wght@0,200..800;1,200..800&family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --bg-primary: #f8fafc;
  /* Slate 50 */
  --bg-secondary: #ffffff;
  /* Pure white */
  --bg-secondary-translucent: rgba(255, 255, 255, 0.8);
  --border-color: #e2e8f0;
  /* Slate 200 */
  --border-focus: #cbd5e1;
  /* Slate 300 */

  --text-primary: #0f172a;
  /* Slate 900 */
  --text-secondary: #334155;
  /* Slate 700 */
  --text-muted: #64748b;
  /* Slate 500 */

  --primary: #2563eb;
  /* Royal Blue */
  --primary-subtle: #eff6ff;
  --secondary: #475569;
  /* Cool Slate */

  --success: #059669;
  /* Emerald */
  --success-subtle: #ecfdf5;
  --danger: #dc2626;
  /* Rose */
  --danger-subtle: #fff5f5;
  --warning: #d97706;
  /* Amber */
  --warning-subtle: #fef3c7;
  --info: #0891b2;
  /* Cyan */
  --info-subtle: #ecfeff;
}

[data-theme="dark"] {
  --bg-primary: #000000;
  --bg-secondary: #0d0d0d;
  --bg-secondary-translucent: rgba(13, 13, 13, 0.8);
  --border-color: #262626;
  --border-focus: #404040;

  --text-primary: #f8fafc;
  --text-secondary: #e2e8f0;
  --text-muted: #94a3b8;

  --primary: #3b82f6;
  --primary-subtle: rgba(59, 130, 246, 0.1);
  --secondary: #a3a3a3;

  --success: #10b981;
  --success-subtle: rgba(16, 185, 129, 0.1);
  --danger: #ef4444;
  --danger-subtle: rgba(239, 68, 68, 0.1);
  --warning: #f59e0b;
  --warning-subtle: rgba(245, 158, 11, 0.1);
  --info: #06b6d4;
  --info-subtle: rgba(6, 182, 212, 0.1);
}

/* Global Bootstrap overrides for Dark Mode */
[data-theme="dark"] .bg-white {
  background-color: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .bg-light {
  background-color: var(--bg-primary) !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .text-dark {
  color: var(--text-primary) !important;
}

[data-theme="dark"] .text-secondary {
  color: var(--text-secondary) !important;
}

[data-theme="dark"] .text-muted {
  color: var(--text-muted) !important;
}

[data-theme="dark"] .table {
  --bs-table-bg: var(--bg-secondary) !important;
  --bs-table-striped-bg: var(--bg-primary) !important;
  --bs-table-hover-bg: var(--bg-primary) !important;
  --bs-table-border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .table th,
[data-theme="dark"] .table td {
  background-color: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

[data-theme="dark"] .table thead th {
  background-color: var(--bg-primary) !important;
  color: var(--text-secondary) !important;
}

[data-theme="dark"] .card {
  background-color: var(--bg-secondary) !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .list-group-item {
  background-color: var(--bg-secondary) !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .modal-content {
  background-color: var(--bg-secondary) !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .dropdown-menu {
  background-color: var(--bg-secondary) !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .form-floating>.form-control {
  background-color: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .form-select {
  background-color: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .nav-tabs {
  border-color: var(--border-color) !important;
}

[data-theme="dark"] .nav-tabs .nav-link {
  color: var(--text-secondary) !important;
  background: transparent !important;
  border: none !important;
}

[data-theme="dark"] .nav-tabs .nav-link:hover {
  color: var(--text-primary) !important;
}

[data-theme="dark"] .nav-tabs .nav-link.active {
  background-color: var(--bg-secondary) !important;
  color: var(--primary) !important;
  border-bottom: 2px solid var(--primary) !important;
}

/* Base resets and defaults */
body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  letter-spacing: -0.015em;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Standard containers are centered; fluid layout applies within app-layout */
.app-layout .container {
  max-width: 98% !important;
  width: 98% !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Zero-radius, flat borders, no shadow style (Industrial-Swiss) */
.glass-card,
.subject-table-wrapper,
.timetable-grid-wrapper,
.timetable-cell-card,
.form-control,
.form-select,
.btn,
.badge,
.dropdown-menu,
.profile-avatar-container,
.profile-avatar-container span,
.alert,
.progress,
.progress-bar,
.modal-content,
.subtab-link {
  border-radius: 0px !important;
}

.glass-card,
.subject-table-wrapper,
.timetable-grid-wrapper,
.timetable-cell-card,
.dropdown-menu,
.btn-glow,
.btn-glass,
.app-sidebar,
.modal-content,
.shadow,
.shadow-sm,
.shadow-lg {
  box-shadow: none !important;
}

.glass-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  transition: border-color 80ms ease;
}

.glass-card:hover {
  border-color: var(--border-focus);
}

/* Minimalist Navbar */
.glass-nav {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
}

/* Premium Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Outfit', 'Plus Jakarta Sans', -apple-system, sans-serif;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.03em;
}

.gradient-text,
.gradient-accent-text {
  /* Remove gradients for an ultra-professional slate layout */
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: unset;
  background-clip: unset;
  color: var(--text-primary);
}

/* Monospace font styling for statistics and metrics (Tabular) */
.mono-stat,
.percentage-val,
.credits,
.time,
.stats,
.num,
.attendance-val,
.timetable-table th,
.timetable-table td.day-cell,
.timetable-table td.break-cell,
.slot-code,
.slot-room,
.timetable-cell-card.empty-cell {
  font-family: 'IBM Plex Mono', monospace !important;
  font-variant-numeric: tabular-nums;
}

/* Minimalist Inputs */
.form-floating>.form-control {
  background-color: var(--bg-secondary) !important;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  transition: all 80ms ease-in-out;
}

.form-floating>.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-floating>label {
  color: var(--text-muted);
}

.form-floating>.form-control:focus~label,
.form-floating>.form-control:not(:placeholder-shown)~label {
  color: var(--primary);
}

.form-select {
  background-color: var(--bg-secondary) !important;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.85rem 0.75rem;
}

.form-select:focus {
  border-color: var(--primary);
  outline: none;
}

/* Minimal Buttons with Snap Interaction */
.btn {
  transition: transform 30ms ease-out, background-color 80ms ease, border-color 80ms ease, color 80ms ease !important;
}

.btn:active {
  transform: scale(0.97) !important;
}

.btn-glow {
  background: var(--primary);
  border: 1px solid var(--primary);
  color: #ffffff;
  font-weight: 600;
  padding: 0.65rem 1.5rem;
  box-shadow: none;
}

.btn-glow::before {
  display: none;
}

.btn-glow:hover {
  background-color: #1d4ed8;
  border-color: #1d4ed8;
  color: #ffffff;
}

.btn-glass {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-weight: 600;
  padding: 0.65rem 1.5rem;
  box-shadow: none;
}

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

/* Table Timetable Grid Layout (Spreadsheet style) */
.timetable-grid-wrapper {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

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

.timetable-table th {
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border: 1px solid var(--border-color);
  padding: 0.75rem;
  text-align: center;
  vertical-align: middle;
}

.timetable-table td {
  border: 1px solid var(--border-color);
  padding: 0.5rem;
  vertical-align: middle;
  text-align: center;
  background: var(--bg-secondary);
  height: 105px;
}

.timetable-table td.day-cell {
  background: var(--bg-primary);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
  width: 110px;
  border-right: 2px solid var(--border-color);
}

.timetable-table td.break-cell {
  background: var(--bg-primary);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  width: 32px;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  border-left: 2px solid var(--border-color);
  border-right: 2px solid var(--border-color);
  padding: 0;
  height: 105px;
}

/* Inner cell class block details card */
.timetable-cell-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.5rem;
  height: 90px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  transition: all 0.15s ease;
}

.timetable-cell-card:hover {
  background: var(--bg-secondary);
  border-color: var(--border-focus);
}

.timetable-cell-card.empty-cell {
  background: transparent;
  border: 1px dashed var(--border-focus);
  justify-content: center;
  align-items: center;
  color: var(--text-muted);
  cursor: pointer;
}

.timetable-cell-card.empty-cell:hover {
  background: var(--primary-subtle);
  border-color: var(--primary);
  color: var(--primary);
}

/* Badges */
.badge-present {
  background-color: var(--success-subtle);
  color: var(--success);
  border: 1px solid rgba(5, 150, 105, 0.15);
}

.badge-absent {
  background-color: var(--danger-subtle);
  color: var(--danger);
  border: 1px solid rgba(220, 38, 38, 0.15);
}

/* Alerts */
.alert {
  border-radius: 8px;
  background-color: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color) !important;
}

.alert-danger {
  border-left: 4px solid var(--danger) !important;
}

.alert-success {
  border-left: 4px solid var(--success) !important;
}

.alert-info {
  border-left: 4px solid var(--info) !important;
}

/* Animations */
.animate-fade-in-up {
  animation: fadeInUp 0.4s ease-out forwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Enterprise Application Layout */
.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100vw;
  overflow: hidden;
}

.app-sidebar {
  width: 250px;
  background-color: var(--bg-secondary);
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid var(--border-color);
  height: 100vh;
  position: sticky;
  top: 0;
  transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  overflow: hidden;
}

.sidebar-collapsed .app-sidebar {
  width: 70px !important;
}

.sidebar-collapsed .sidebar-logo {
  padding: 1.5rem 0 !important;
  justify-content: center !important;
}

.sidebar-collapsed .sidebar-logo img {
  content: url("/assets/images/favicon.webp") !important;
  height: 28px !important;
}

.sidebar-collapsed .sidebar-link {
  justify-content: center !important;
  padding: 0.75rem 0 !important;
  gap: 0 !important;
}

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

.sidebar-logo {
  padding: 1.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-menu {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex-grow: 1;
  overflow-y: auto;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 80ms ease;
}

.sidebar-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform 80ms ease;
}

.profile-avatar-container {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.profile-avatar-container span {
  border: 2px solid var(--border-color) !important;
  transition: all 80ms ease !important;
}

.app-header-profile:hover .profile-avatar-container span {
  transform: scale(1.05);
}

.sidebar-link:hover {
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

.sidebar-link.active {
  background-color: var(--primary-subtle) !important;
  color: var(--primary) !important;
  font-weight: 600;
}

.sidebar-link.logout-link {
  color: #ef4444;
  margin-top: auto;
}

.sidebar-link.logout-link:hover {
  background-color: #7f1d1d;
  color: #ffffff;
}

/* Horizontal Sub-tabs Navigation for Attendance Section */
.scrollable-subtabs {
  display: flex;
  border-bottom: 2px solid var(--border-color);
  gap: 1.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1.5rem;
}

.subtab-link {
  padding: 0.75rem 0.25rem;
  color: var(--text-muted);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: all 80ms ease;
  font-size: 0.9rem;
  white-space: nowrap;
}

.subtab-link:hover {
  color: var(--text-primary);
}

.subtab-link.active {
  color: var(--primary) !important;
  border-bottom-color: var(--primary) !important;
}

/* Section Separator */
.section-separator {
  border-bottom: 2px solid var(--text-primary);
  padding-bottom: 0.25rem;
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 800;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.app-main-wrapper {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  height: 100vh;
  overflow-y: auto;
  background-color: var(--bg-primary);
}

.app-header {
  height: 70px;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  flex-shrink: 0;
}

.app-header-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.app-header-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.app-content {
  padding: 2rem;
  flex-grow: 1;
}

/* Adjust general cards inside app layout */
.app-content .glass-card {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Responsive Overrides for Mobile-Friendliness */
@media (max-width: 768px) {

  /* Switch app layout to stacked columns */
  .app-layout {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    width: 100%;
    overflow: visible;
  }

  /* Transform sidebar into a mobile bottom navigation bar (flat, non-floating) */
  .app-sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    width: 100% !important;
    height: 60px !important;
    background: var(--bg-secondary) !important;
    border-top: 1px solid var(--border-color) !important;
    border-right: none !important;
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .sidebar-logo {
    display: none !important;
  }

  .sidebar-menu {
    flex-direction: row !important;
    justify-content: space-around !important;
    align-items: center !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100%;
    height: 100%;
    overflow: visible !important;
  }

  .sidebar-link {
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0.25rem 0.25rem 0 0.25rem !important;
    font-size: 0.65rem !important;
    font-weight: 600 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: var(--text-muted) !important;
    flex-grow: 1;
    height: 100%;
    gap: 0.15rem !important;
    border-top: 3px solid transparent !important;
    border-left: none !important;
    transition: all 80ms ease;
  }

  .sidebar-link.active {
    color: var(--primary) !important;
    background: transparent !important;
    border-top-color: var(--primary) !important;
  }

  .sidebar-link svg {
    width: 18px !important;
    height: 18px !important;
    stroke: currentColor !important;
    stroke-width: 2px !important;
  }

  .sidebar-link.logout-link {
    display: none !important;
  }

  /* Adjust main wrapper to fill screen and accommodate bottom navbar */
  .app-main-wrapper {
    height: auto !important;
    min-height: 100vh;
    padding-bottom: 84px !important;
    width: 100%;
  }

  .app-header {
    position: sticky;
    top: 0;
    z-index: 999;
    background: var(--bg-secondary-translucent) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    height: 60px !important;
    padding: 0 1.25rem !important;
    border-bottom: 1px solid var(--border-color) !important;
  }

  .app-header-title {
    font-size: 1.15rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.02em;
  }

  .app-content {
    padding: 1.25rem 1rem !important;
  }

  /* Stack columns cleanly in content area */
  .row>* {
    margin-bottom: 1rem;
  }

  .row>*:last-child {
    margin-bottom: 0;
  }

  /* Scale charts correctly */
  canvas {
    max-width: 100% !important;
  }

  /* Fix tables on mobile view */
  .table-responsive {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* Flat Apple-segmented subtabs navigation for mobile viewports */
  .scrollable-subtabs {
    background-color: var(--bg-primary);
    padding: 0.25rem;
    gap: 0.25rem !important;
    border-bottom: none !important;
    margin-bottom: 1.25rem;
    overflow-x: visible;
  }

  .subtab-link {
    flex: 1;
    text-align: center;
    padding: 0.5rem 0.25rem !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    border-bottom: none !important;
    color: var(--text-muted) !important;
    transition: all 80ms ease;
  }

  .subtab-link.active {
    background-color: var(--bg-secondary) !important;
    color: var(--primary) !important;
    font-weight: 800 !important;
    border-bottom-color: transparent !important;
  }

  /* History Logs Table Mobile Optimizations */
  .table th:nth-child(4),
  .table td:nth-child(4) {
    display: none !important; /* Hide Remarks on mobile */
  }

  .table th, .table td {
    padding: 0.75rem 0.5rem !important;
    font-size: 0.75rem !important;
  }

  .table td .btn {
    padding: 0.25rem 0.4rem !important;
    font-size: 0.65rem !important;
  }
}

/* Compulsively normalize logo scaling between light/dark themes to account for native padding differences */
[data-theme="dark"] img[src*="logo_dark.webp"] {
  height: 38px !important;
  margin-top: -3px;
}

[data-theme="dark"] img.mobile-header-logo {
  height: 38px !important;
  margin-top: -3px;
}

/* Ensure the header profile avatar is a perfect circular symbol, overriding bootstrap badge styles */
.profile-avatar-container span {
  width: 36px !important;
  height: 36px !important;
  border-radius: 50% !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Rolling Days Calendar Strip (Apple/Stripe Style Extended Sliding Track) */
.day-strip-container {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  padding: 6px 4px;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
}

.day-strip-container::-webkit-scrollbar {
  display: none; /* Hide scrollbar for a clean Apple look */
}

.day-strip-card {
  flex: 0 0 58px;
  min-width: 58px;
  height: 74px;
  scroll-snap-align: center;
  border-radius: 12px !important;
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  transition: all 0.2s cubic-bezier(0.32, 0.72, 0, 1);
  padding: 5px 4px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02) !important;
}

.day-strip-card:hover {
  border-color: var(--border-focus);
  transform: translateY(-1px);
}

.day-strip-card.active-day-card {
  background-color: var(--primary) !important;
  color: #ffffff !important;
  border-color: var(--primary) !important;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2) !important;
}

.day-strip-card .day-month-lbl {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.75;
  line-height: 1;
  margin-bottom: 3px;
}

.day-strip-card.active-day-card .day-month-lbl {
  opacity: 0.95;
}

.day-strip-card .day-name-lbl {
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.7;
  line-height: 1;
  margin-top: 3px;
}

.day-strip-card.active-day-card .day-name-lbl {
  opacity: 0.9;
}

.day-strip-card .day-num-lbl {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1;
  font-family: 'Outfit', sans-serif;
}

/* Custom Calendar Icon Trigger */
.calendar-trigger-btn {
  width: 48px;
  height: 70px;
  border-radius: 12px !important;
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.32, 0.72, 0, 1);
  position: relative;
}

.calendar-trigger-btn:hover {
  border-color: var(--border-focus);
  background-color: var(--bg-primary);
}

.calendar-trigger-btn input[type="date"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 10;
}

/* Toast Spring Animations (Apple / Stripe HUD Style) */
@keyframes toastSpringIn {
  0% {
    opacity: 0;
    transform: translateY(-20px) scale(0.92);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastSpringOut {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-15px) scale(0.95);
  }
}

/* Apple-Style Segmented Pill Control */
.apple-segmented-pill {
  display: inline-flex;
  align-items: center;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 9999px !important;
  padding: 3px;
  gap: 2px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

.segmented-item {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.78rem;
  padding: 6px 14px;
  border-radius: 9999px !important;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.32, 0.72, 0, 1);
  font-family: 'Plus Jakarta Sans', sans-serif;
  line-height: 1.2;
}

.segmented-item:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .segmented-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.segmented-item:active {
  transform: scale(0.95);
}

/* Active Highlight States */
.segmented-item.active-present {
  background-color: var(--success) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35) !important;
}

.segmented-item.active-absent {
  background-color: var(--danger) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35) !important;
}

.segmented-item.active-od {
  background-color: var(--primary) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.35) !important;
}

/* Edit Pencil Icon Button on Card */
.edit-pencil-btn {
  opacity: 0.6;
  transition: all 0.2s cubic-bezier(0.32, 0.72, 0, 1);
  cursor: pointer;
  background: transparent;
}

.edit-pencil-btn:hover {
  opacity: 1;
  color: var(--primary) !important;
  transform: scale(1.12);
}