@import url('https://fonts.googleapis.com/css2?family=Hind+Siliguri:wght@400;600;700;800&display=swap');

:root {
  --text: #0b0b0b;
  --bg-start: #eef3ff;
  --bg-end: #ffffff;
  --card-bg: rgba(255, 255, 255, 0.65);
  --border: rgba(24, 24, 27, 0.08);
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  --accent: #6b8afd;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #fafafa;
    --bg-start: #0f1222;
    --bg-end: #101626;
    --card-bg: rgba(19, 23, 42, 0.55);
    --border: rgba(255, 255, 255, 0.08);
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
    --accent: #89a3ff;
  }
}

.highlighted-message {
  font-weight: 800;
  color: #cf278d;
  background: rgba(207, 39, 141, 0.1);
  padding: 12px 20px;
  border-radius: 12px;
  text-align: center;
  margin: 20px auto;
  display: block;
  width: fit-content;
  border: 1px solid rgba(207, 39, 141, 0.2);
  box-shadow: 0 4px 12px rgba(207, 39, 141, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Hind Siliguri;
  color: var(--text);
  background: radial-gradient(1200px 700px at 10% -10%, var(--bg-start), transparent),
    radial-gradient(1200px 700px at 110% 10%, #f0f4fe, transparent),
    linear-gradient(180deg, var(--bg-end), var(--bg-end));
  min-height: 100vh;
  position: relative;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100000;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-overlay.hidden {
  display: none;
  opacity: 0;
  visibility: hidden;
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.loading-circle-wrapper {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-circle {
  width: 120px;
  height: 120px;
  transform: rotate(-90deg);
}

.loading-circle-bg {
  fill: none;
  stroke: rgba(207, 39, 141, 0.2);
  stroke-width: 8;
}

.loading-circle-progress {
  fill: none;
  stroke: #cf278d;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 339.292;
  stroke-dashoffset: 339.292;
  transition: stroke-dashoffset 0.3s ease-out, stroke 0.5s ease-out;
}

.loading-circle-progress.complete {
  stroke: #10b981;
}

.loading-percentage {
  position: absolute;
  font-size: 24px;
  font-weight: 700;
  color: #cf278d;
  transition: color 0.5s ease-out;
}

.loading-percentage.complete {
  color: #10b981;
}

.loading-text {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.loading-text-secondary {
  font-size: 14px;
  font-weight: 400;
  margin: 0;
  text-align: center;
  max-width: 400px;
  line-height: 1.5;
  display: block;
  opacity: 1;
  visibility: visible;
  background: linear-gradient(90deg, #cf278d, #ff6b9d, #ffa500, #ff6b9d, #cf278d);
  background-size: 200% auto;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: text-shimmer 3s linear infinite;
}

@keyframes text-shimmer {
  0% {
    background-position: 0% center;
  }

  100% {
    background-position: 200% center;
  }
}

@media (prefers-color-scheme: dark) {
  .loading-text-secondary {
    background: linear-gradient(90deg, #ff6b9d, #ffa500, #ffd700, #ffa500, #ff6b9d);
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 1;
    visibility: visible;
  }
}

/* Centered page logo */
.page-logo {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  pointer-events: none;
  opacity: 0.02;
}

.page-logo img {
  max-width: 500px;
  width: auto;
  height: auto;
  display: block;
}

.page {
  max-width: none;
  width: 100%;
  margin: 0 auto;
  padding: 28px 24px 60px;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  position: relative;
  z-index: 2;
}

/* Footer */
.site-footer {
  margin-top: 28px;
  padding: 0 16px 28px;
  color: var(--text);
}

.site-footer .footer-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  padding: 16px 18px;
  background: linear-gradient(180deg, #ffffff 0%, var(--card-surface, #f9fbff) 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.site-footer .footer-title {
  margin: 0;
  font-weight: 800;
  color: #354894;
}

.site-footer .footer-help {
  margin: 0;
  font-weight: 700;
}

.site-footer a {
  color: var(--accent-secondary);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .site-footer {
    padding: 0 12px 20px;
  }
}

/* Two-column layout with left sidebar on wide screens */
.app-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 28px;
  align-items: start;
  margin-top: 32px;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
}

.content {
  min-width: 0;
}

header {
  text-align: center;
  padding: 24px 20px;
  background: linear-gradient(135deg, rgba(53, 72, 148, 0.08) 0%, rgba(53, 72, 148, 0.05) 100%);
  border-radius: 20px;
  border: 1px solid rgba(53, 72, 148, 0.15);
  box-shadow: 0 4px 16px rgba(53, 72, 148, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  margin-bottom: 48px;
  position: relative;
  /* Enabled positioning for absolute children */
}

header h1 {
  margin: 0;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: none;
  text-shadow: 0 2px 8px rgba(53, 72, 148, 0.15);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
  user-select: none;
}

header h1:hover {
  transform: scale(1.02);
  opacity: 0.9;
}

header h1:active {
  transform: scale(0.98);
}

header h1:focus {
  outline: 3px solid rgba(53, 72, 148, 0.3);
  outline-offset: 4px;
  border-radius: 8px;
}

header h1::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -12px;
  width: 120px;
  height: 6px;
  background: linear-gradient(90deg, #354894, #27385f);
  border-radius: 6px;
}

/* User Profile Section in Sidebar */
.user-profile-section {
  text-align: center;
  margin: 20px 0 0;
  padding: 16px;
  background: linear-gradient(180deg, #ffffff 0%, var(--card-surface, #f9fbff) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.user-profile-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.user-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background-color 0.2s ease;
  width: 100%;
}

.user-info:hover {
  background-color: rgba(107, 138, 253, 0.1);
}

.user-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  object-fit: cover;
  cursor: pointer;
  transition: all 0.2s ease;
  display: block;
  min-width: 56px;
  min-height: 56px;
}

.user-avatar:hover {
  border-color: rgba(207, 39, 141, 0.8);
  box-shadow: 0 2px 8px rgba(207, 39, 141, 0.3);
  transform: scale(1.05);
}

#user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
  text-align: center;
  line-height: 1.4;
}

.logout-btn {
  position: relative;
  width: 100%;
  margin-top: 8px;
  padding: 10px 16px;
  background: rgba(207, 39, 141, 0.95);
  border: 1px solid rgba(207, 39, 141, 0.5);
  border-radius: 8px;
  color: #ffffff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
  z-index: 1000;
}

.logout-btn:hover {
  background: rgba(207, 39, 141, 1);
  border-color: rgba(207, 39, 141, 0.8);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.logout-btn:active {
  transform: translateY(0) scale(0.98);
}

@media (max-width: 900px) {
  .user-profile-section {
    margin: 16px 0 0;
    padding: 12px;
  }

  .user-info {
    flex-direction: row;
    justify-content: center;
  }

  .user-avatar {
    width: 40px;
    height: 40px;
  }

  #user-name {
    font-size: 13px;
  }
}

.brand-logo {
  height: 1.1em;
  width: auto;
  display: inline-block;
  vertical-align: middle;
}

.title-main {
  font-size: 48px;
  font-weight: 800;
  line-height: 1;
  display: block;
  background: linear-gradient(135deg, #354894 0%, #5a6ba8 15%, #6b8afd 30%, #cf278d 45%, #8ba3ff 60%, #354894 75%, #27385f 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s linear infinite;
}

.title-sub {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  display: block;
  margin-top: 4px;
  background: linear-gradient(135deg, #354894 0%, #5a6ba8 20%, #6b8afd 40%, #cf278d 60%, #354894 80%, #27385f 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s linear infinite;
  opacity: 0.9;
}

@keyframes gradientShift {
  0% {
    background-position: 200% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

.filters {
  text-align: center;
  margin: 0 0 20px;
  padding: 16px 16px 18px;
  background: linear-gradient(180deg, #ffffff 0%, var(--card-surface, #f9fbff) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  position: relative;
  z-index: 20;
  isolation: isolate;
}

.filters-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  margin-bottom: 20px;
  user-select: none;
}

.filter-toggle-icon {
  font-size: 16px;
  color: var(--accent);
  transition: transform 0.3s ease;
  display: none;
  /* Hidden on desktop by default */
}

/* Mobile styles for filters */
@media (max-width: 900px) {
  .filters-header {
    margin-bottom: 0;
    padding: 8px 0;
  }

  .filter-toggle-icon {
    display: block;
  }

  .filter-row {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease-out, opacity 0.2s ease-out, margin-top 0.3s ease;
    margin-top: 0;
    padding: 0 4px;
    /* Space for focus rings */
  }

  .filter-row.expanded {
    max-height: 1000px;
    /* Increased to accommodate all filters */
    overflow: visible;
    /* Allow suggestions to show on top */
    opacity: 1;
    margin-top: 20px;
  }

  .filters.expanded .filter-toggle-icon {
    transform: rotate(180deg);
  }
}

@media (min-width: 901px) {
  .filters {
    backdrop-filter: blur(8px);
  }
}

.field {
  display: grid;
  gap: 8px;
  text-align: left;
  position: relative;
  transition: z-index 0s linear;
}

.field:hover {
  z-index: 10;
}

.field:focus-within {
  z-index: 100 !important;
}

.field-label {
  font-weight: 800;
  font-size: 13px;
  opacity: .9;
  padding-left: 6px;
}

.field input[type="date"],
.field input[type="text"] {
  width: 100%;
  padding: 12px 44px 12px 14px;
  /* leave space for right icon */
  background: linear-gradient(180deg, #ffffff, var(--card-surface, #fefbfd));
  border: 1px solid rgba(53, 72, 148, 0.14);
  border-radius: 12px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8), var(--shadow);
  font-weight: 700;
  color: var(--text);
}

.field input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0;
  display: none;
}

@supports (-moz-appearance: none) {
  .field input[type="date"] {
    appearance: textfield;
    -moz-appearance: textfield;
  }
}

.field input[type="date"]:focus,
.field input[type="text"]:focus {
  outline: 3px solid #a8b5e0;
  outline-offset: 2px;
}

/* Autocomplete */
.autocomplete {
  position: relative;
  display: grid;
}

.autocomplete .clear-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  opacity: .6;
}

.autocomplete .clear-btn {
  display: none;
}

.autocomplete.has-value .clear-btn {
  display: block;
}

.autocomplete .clear-btn:hover {
  opacity: .95;
}

.field>.clear-btn {
  display: none;
}

.field.has-value>.clear-btn {
  display: block;
  position: absolute;
  right: 12px;
  top: 42px;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: #334;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  opacity: .7;
  border-radius: 8px;
  padding: 2px 4px;
}

.field.has-value>.clear-btn:hover {
  opacity: 1;
}

.autocomplete-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  list-style: none;
  margin: 0;
  padding: 6px 0;
  max-height: 240px;
  overflow: auto;
  z-index: 50;
}

.autocomplete-item {
  padding: 10px 14px;
  cursor: pointer;
}

.autocomplete-item[aria-selected="true"],
.autocomplete-item:hover {
  background: #eef3ff;
}

.filters h2 {
  margin: 0 0 16px 0;
  font-size: 32px;
  font-weight: 800;
}

/* Analytics Section */
.analytics {
  text-align: center;
  margin: 20px 0;
  padding: 18px 16px;
  background: linear-gradient(180deg, #ffffff 0%, var(--card-surface, #f9fbff) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

@media (min-width: 901px) {
  .analytics {
    backdrop-filter: blur(8px);
  }
}

.analytics-title-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px 0;
  padding: 14px 24px;
  background: linear-gradient(135deg, #ffffff, #f9fbff);
  border: 2px solid rgba(207, 39, 141, 0.3);
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(207, 39, 141, 0.1);
  transition: all 0.3s ease;
  user-select: none;
  position: relative;
  /* Added for toggle icon positioning */
}

.analytics-toggle-icon {
  display: none;
  /* Hidden on desktop */
  font-size: 16px;
  color: #cf278d;
  transition: transform 0.3s ease;
  padding: 4px;
}

.year-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 4px;
}

#analytics-year {
  font-size: 26px;
  font-weight: 800;
  color: #354894;
  min-width: 70px;
  text-align: center;
}

.year-nav-btn {
  background: rgba(207, 39, 141, 0.1);
  border: 1px solid rgba(207, 39, 141, 0.2);
  border-radius: 8px;
  color: #cf278d;
  font-size: 28px;
  font-weight: 800;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}

.year-nav-btn:hover {
  background: rgba(207, 39, 141, 0.2);
  border-color: rgba(207, 39, 141, 0.4);
  transform: scale(1.1);
}

.year-nav-btn:active {
  transform: scale(0.95);
}

.year-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
}

.analytics-title-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(207, 39, 141, 0.2);
  border-color: rgba(207, 39, 141, 0.5);
  background: linear-gradient(135deg, #ffffff, #fff5fc);
}

.analytics-title-box:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(207, 39, 141, 0.15);
}

.analytics-title-box:focus {
  outline: 3px solid rgba(207, 39, 141, 0.3);
  outline-offset: 2px;
}

.analytics h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  pointer-events: none;
}

.analytics-total {
  font-size: 18px;
  font-weight: 700;
  color: #cf278d;
  margin: 0 0 18px 0;
  padding: 8px 0;
  border-bottom: 2px solid var(--border);
}

.analytics-total::before {
  content: "📈 ";
}

@media (max-width: 600px) {
  .analytics-total {
    font-size: 16px;
    margin-bottom: 16px;
  }
}

/* Desktop: Vertical stacked layout in sidebar */
.analytics-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.analytics-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #eef3ff, #ffffff);
  border: 1px solid rgba(53, 72, 148, 0.15);
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(53, 72, 148, 0.06);
  transition: all 0.3s ease;
}

.analytics-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(53, 72, 148, 0.1);
  border-color: rgba(53, 72, 148, 0.25);
}

.analytics-card-highlight {
  background: linear-gradient(135deg, #eef3ff, #e0e8ff);
  border-color: var(--accent);
  border-width: 1.5px;
}

.analytics-icon {
  font-size: 28px;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(53, 72, 148, 0.1);
  border-radius: 10px;
}

.analytics-content {
  flex: 1;
  text-align: left;
}

/* Desktop: Put label and status on same row */
@media (min-width: 901px) {
  .analytics-content {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 0 8px;
  }

  .analytics-label {
    grid-column: 1;
    grid-row: 1;
    margin-bottom: 0;
  }

  .analytics-status {
    grid-column: 2;
    grid-row: 1;
    margin-top: 0;
    align-self: center;
  }

  .analytics-value {
    grid-column: 1 / -1;
    grid-row: 2;
    margin-top: 3px;
  }
}

.analytics-label {
  font-size: 18px;
  font-weight: 700;
  color: #354894;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
}

.month-label-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.month-label-container span {
  flex: 1;
  text-align: center;
}

.month-nav-btn {
  background: rgba(53, 72, 148, 0.1);
  border: 1px solid rgba(53, 72, 148, 0.2);
  border-radius: 8px;
  color: #354894;
  font-size: 24px;
  font-weight: 800;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}

.month-nav-btn:hover {
  background: rgba(53, 72, 148, 0.2);
  border-color: rgba(53, 72, 148, 0.3);
  transform: scale(1.1);
}

.month-nav-btn:active {
  transform: scale(0.95);
}

.month-nav-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.month-nav-btn:disabled:hover {
  transform: none;
  background: rgba(53, 72, 148, 0.1);
  border-color: rgba(53, 72, 148, 0.2);
}

.analytics-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  text-align: center;
}

.analytics-card-highlight .analytics-value {
  font-size: 28px;
  color: var(--accent);
}

.analytics-status {
  margin-top: 6px;
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.analytics-status.status-ended {
  background: linear-gradient(135deg, #e0e0e0, #c0c0c0);
  color: #4a4a4a;
}

.analytics-status.status-ongoing {
  background: linear-gradient(135deg, #4ade80, #22c55e);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.analytics-status.status-upcoming {
  background: linear-gradient(135deg, #60a5fa, #3b82f6);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* Section count badge */
.section-count {
  font-size: 0.85em;
  font-weight: 700;
  color: var(--accent);
  opacity: 0.9;
  margin-left: 4px;
}

.filter-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 0;
}

.sidebar .filter-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  justify-items: stretch;
}

.filter {
  font-weight: 700;
  padding: 10px 14px;
  background: linear-gradient(180deg, #eef3ff, #e0e8ff);
  border: 1px solid rgba(53, 72, 148, 0.12);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}

.filter:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(53, 72, 148, 0.15);
}

.filter select {
  appearance: none;
  border: none;
  background: transparent;
  font-weight: 800;
  color: var(--text);
}

.filter select:focus {
  outline: none;
}

.sections {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 24px 32px;
  margin-top: 0;
  justify-content: center;
  /* center the three columns within the container */
  align-items: start;
}

@media (min-width: 901px) {
  .sections {
    position: sticky;
    top: 0;
    z-index: 40;
    padding: 8px 10px 12px;
    margin-bottom: 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(254, 251, 253, 0.95));
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    border-radius: 16px;
  }
}

.section.active {
  align-items: stretch;
}

.section {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.section h3 {
  margin: 0 0 10px 0;
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  display: inline-block;
  padding-bottom: 6px;
  border-bottom: 3px solid transparent;
  transition: color .2s ease, border-color .2s ease, transform .15s ease;
}

.section h3 {
  cursor: pointer;
}

.section h3:focus {
  outline: 3px solid #a8b5e0;
  outline-offset: 3px;
}

.section h3 {
  user-select: none;
}

.section h3 {
  transition: color 0.2s ease;
}

.section h3[aria-selected="true"],
.section.active h3 {
  color: var(--accent);
  border-color: var(--accent);
}

.section h3[aria-selected="false"] {
  color: #1a1a2e;
}

.placeholder {
  width: 100%;
  padding: 8px 0;
  border-radius: 14px;
  background: transparent;
  border: none;
  box-shadow: none;
}

.section .placeholder {
  display: none;
}

.section.active .placeholder {
  display: block;
}

/* Expand All Button Controls */
.expand-all-controls {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
  padding: 0 4px;
}

.expand-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: linear-gradient(135deg, #354894, #5a6ba8);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(53, 72, 148, 0.25);
  transition: all 0.2s ease;
  font-family: 'Hind Siliguri', sans-serif;
}

.expand-all-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(53, 72, 148, 0.35);
}

.expand-all-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(53, 72, 148, 0.2);
}

.expand-all-btn .expand-icon {
  font-size: 12px;
  transition: transform 0.2s ease;
}

.expand-all-btn.expanded .expand-icon {
  transform: rotate(180deg);
}

/* Desktop - expand all controls */
@media (min-width: 901px) {
  .section-content .expand-all-controls {
    display: none;
  }

  .cards.date-groups .expand-all-controls,
  .date-groups .expand-all-controls {
    display: flex;
    margin-bottom: 16px;
  }
}

/* Section content for mobile accordion */
.section-content {
  display: none;
}

@media (max-width: 900px) {
  .section-content {
    display: block;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 16px;
  }

  /* All sections start collapsed on mobile - expanded state only when active class is added via JS */
  .section.active .section-content {
    max-height: 10000px;
    padding: 16px;
  }

  .expand-all-controls {
    margin-bottom: 12px;
  }

  .expand-all-btn {
    font-size: 13px;
    padding: 9px 16px;
  }

  .section-cards {
    display: grid;
    gap: 16px;
  }

  .section-cards.cards {
    grid-template-columns: 1fr;
  }

  .section-cards.date-groups {
    display: block;
  }

  .section-cards.date-groups .date-group {
    margin: 10px 0 16px;
  }
}

/* Cards grid in Today's Classes */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.cards-wrap {
  margin-top: 12px;
}

.empty-state {
  opacity: 0.8;
  text-align: center;
  padding: 18px 8px;
}

/* Class card */
.class-card {
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, var(--card-surface, #f9fbff) 100%);
  box-shadow: 0 6px 18px rgba(27, 45, 94, .10);
  padding: 16px 18px;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}

.class-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
}

.card-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(180deg, #eef3ff, #e0e8ff);
  color: #27385f;
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 800;
  letter-spacing: .3px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge-icon {
  flex: 0 0 auto;
  filter: saturate(120%);
}

.card-title {
  display: none;
}

.card-label {
  display: none;
}

.meta-rows {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.meta-row {
  display: grid;
  grid-template-columns: 26px auto;
  align-items: center;
  column-gap: 10px;
}

.meta-row>span:last-child {
  min-width: 0;
}

.meta-key {
  font-weight: 800;
  opacity: .95;
}

.meta-val.truncate {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.meta-icon {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: #eef3ff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}

.meta-row.is-time {
  background: #eef3ff;
  border: 1px solid rgba(53, 72, 148, 0.15);
  padding: 8px 10px;
  border-radius: 12px;
}

.meta-row.is-time .meta-icon {
  background: #e0e8ff;
}

.meta-row.is-time .meta-val {
  color: var(--accent);
  font-weight: 800;
}

.muted {
  opacity: .8;
  font-weight: 600;
}

.card-extra {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  display: none;
}

.class-card[aria-expanded="true"] .card-extra {
  display: block;
}


@media (max-width: 900px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    display: flex;
    flex-direction: column;
  }

  .page {
    padding: 20px 16px 40px;
  }

  /* Mobile Analytics - appears after filters */
  .analytics {
    order: 2;
    margin: 16px 0 20px 0;
    padding: 16px 14px;
  }

  .filters {
    order: 1;
  }

  .analytics-title-box {
    padding: 12px 20px;
    margin-bottom: 14px;
    cursor: pointer;
    /* Added for tap interaction */
  }

  .analytics-toggle-icon {
    display: block;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
  }

  .analytics.expanded .analytics-toggle-icon {
    transform: translateY(-50%) rotate(180deg);
  }

  .analytics-content-wrapper {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease-out, opacity 0.2s ease-out, margin-top 0.3s ease;
    margin-top: 0;
  }

  .analytics.expanded .analytics-content-wrapper {
    max-height: 1200px;
    /* Large enough for full content */
    opacity: 1;
    margin-top: 16px;
    padding-bottom: 8px;
  }

  .analytics h2 {
    font-size: 20px;
  }

  .analytics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .analytics-card {
    flex-direction: column;
    text-align: center;
    padding: 14px 10px;
    gap: 8px;
  }

  .analytics-card-highlight {
    grid-column: span 2;
    flex-direction: row;
    text-align: left;
    padding: 14px 12px;
  }

  .analytics-content {
    text-align: center;
  }

  .analytics-card-highlight .analytics-content {
    text-align: left;
  }

  .analytics-icon {
    font-size: 26px;
    width: 38px;
    height: 38px;
  }

  .analytics-card-highlight .analytics-icon {
    width: 42px;
    height: 42px;
    font-size: 28px;
  }

  .analytics-label {
    font-size: 10px;
  }

  .analytics-value {
    font-size: 24px;
  }

  .analytics-card-highlight .analytics-value {
    font-size: 28px;
  }

  .analytics-status {
    margin-top: 5px;
    font-size: 9px;
    padding: 3px 8px;
  }

  .filter-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(100px, 1fr));
    gap: 12px 16px;
    justify-items: center;
  }

  /* Hide desktop cards area on mobile */
  .desktop-only {
    display: none !important;
  }

  /* Accordion-style sections for mobile */
  .sections {
    grid-template-columns: 1fr;
    margin-top: 24px;
    gap: 12px;
    position: static;
    padding: 0;
    background: transparent;
    border: none;
  }

  .section {
    background: linear-gradient(180deg, #ffffff 0%, var(--card-surface, #f9fbff) 100%);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 0;
    overflow: hidden;
    transition: border-color 0.3s ease;
  }

  .section h3 {
    margin: 0;
    padding: 16px 20px;
    font-size: 20px;
    cursor: pointer;
    border-bottom: none;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
    -webkit-user-select: none;
  }

  .section h3:active {
    opacity: 0.7;
  }

  .section h3::after {
    content: '▼';
    font-size: 14px;
    transition: transform 0.3s ease;
    color: var(--accent);
    margin-left: 10px;
  }

  .section.active h3::after {
    transform: rotate(180deg);
  }

  .section.active {
    border-color: var(--accent);
  }

  .placeholder {
    display: none !important;
  }

  /* Month bars on mobile */
  .month-bar {
    font-size: 16px;
    padding: 14px 18px 14px 48px;
    border-radius: 12px;
  }

  .month-bar::before {
    left: 16px;
    font-size: 18px;
  }

  .month-count {
    font-size: 13px;
    padding: 5px 10px;
  }

  .month-content .date-group {
    margin-left: 12px;
  }

  header {
    padding: 20px 16px;
    margin-bottom: 32px;
  }

  .title-main {
    font-size: 36px;
  }

  .title-sub {
    font-size: 16px;
  }

  .brand-logo {
    height: 1.1em;
  }

  .filters h2 {
    font-size: 26px;
  }
}

@media (max-width: 600px) {
  .filter-row {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .filters h2 {
    font-size: 22px;
  }

  .analytics-title-box {
    padding: 12px 20px;
    margin-bottom: 12px;
  }

  .analytics h2 {
    font-size: 18px;
  }

  .analytics-card {
    padding: 12px 8px;
  }

  .analytics-value {
    font-size: 20px;
  }

  .analytics-card-highlight .analytics-value {
    font-size: 24px;
  }

  .analytics-label {
    font-size: 9px;
  }

  .month-label-container {
    gap: 6px;
  }

  .month-label-container span {
    font-size: 14px;
  }

  .month-nav-btn {
    width: 24px;
    height: 24px;
    font-size: 20px;
  }

  .analytics-icon {
    font-size: 22px;
    width: 34px;
    height: 34px;
  }

  .analytics-card-highlight .analytics-icon {
    width: 38px;
    height: 38px;
    font-size: 24px;
  }

  .analytics-status {
    font-size: 8px;
    padding: 2px 6px;
    margin-top: 4px;
  }

  /* Smaller month bars */
  .month-bar {
    font-size: 15px;
    padding: 12px 16px 12px 44px;
  }

  .month-bar::before {
    left: 14px;
    font-size: 16px;
  }

  .month-text {
    font-size: 15px;
  }

  .month-count {
    font-size: 12px;
    padding: 4px 8px;
  }

  .month-content .date-group {
    margin-left: 8px;
  }

  .expand-all-btn {
    font-size: 12px;
    padding: 8px 14px;
  }

  header {
    padding: 16px 12px;
  }

  .title-main {
    font-size: 28px;
  }

  .title-sub {
    font-size: 14px;
  }

  .brand-logo {
    height: 1.1em;
  }

  header h1::after {
    width: 60px;
    height: 3px;
  }
}

/* Blue Theme */
:root {
  --text: #1a1a2e;
  /* strong readable text */
  --bg-start: #eef3ff;
  /* soft blue tint */
  --bg-end: #f8f9fe;
  --card-bg: #f0f4ff;
  /* container tint */
  --card-surface: #f5f7ff;
  /* card surface */
  --chip-bg: #eef3ff;
  --border: rgba(53, 72, 148, 0.12);
  --shadow: 0 8px 24px rgba(53, 72, 148, 0.1);
  --accent: #354894;
  /* Primary blue */
  --accent-secondary: #354894;
  /* Secondary blue */
  --accent-light: #5a6ba8;
  --accent-dark: #27385f;
}


/* Date groups for Upcoming/Past */
.date-group {
  display: block;
  margin: 10px 0 16px;
}

.date-groups {
  display: block;
}

.date-groups .date-group {
  margin: 10px 0 16px;
}

/* Month groups */
.month-group {
  display: block;
  margin: 16px 0 20px;
}

.month-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  border-radius: 16px;
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 8px 25px rgba(53, 72, 148, 0.3),
    0 4px 12px rgba(53, 72, 148, 0.2);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
  user-select: none;
  -webkit-user-select: none;
  background: linear-gradient(135deg, #354894, #4a5db8);
  color: #ffffff;
  border: none;
  position: relative;
  overflow: hidden;
}

.month-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
  pointer-events: none;
}

.month-bar:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(53, 72, 148, 0.4),
    0 6px 18px rgba(53, 72, 148, 0.25);
}

.month-bar:active {
  transform: translateY(0);
  box-shadow: 0 6px 20px rgba(53, 72, 148, 0.25),
    0 3px 10px rgba(53, 72, 148, 0.15);
}

.month-bar {
  position: relative;
  padding-left: 52px;
}

.month-bar::before {
  content: '▸';
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.9);
  font-size: 20px;
  transition: transform .2s ease;
  z-index: 1;
}

.month-bar[aria-expanded="true"]::before {
  transform: translateY(-50%) rotate(90deg);
}

.month-text {
  font-weight: 800;
  letter-spacing: 0.5px;
  z-index: 1;
  position: relative;
}

.month-count {
  background: rgba(255, 255, 255, 0.25);
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 14px;
  backdrop-filter: blur(8px);
  color: #ffffff;
  z-index: 1;
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.month-count:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: scale(1.05);
}

.month-content {
  padding: 12px 0 0 0;
}

.month-content[hidden] {
  display: none;
}

.month-content .date-group {
  margin-left: 16px;
  margin-right: 0;
}

.date-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  padding-left: 40px;
  border-radius: 14px;
  font-weight: 800;
  background: linear-gradient(135deg, #cf278d, #a81f6f);
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(207, 39, 141, 0.25),
    0 3px 10px rgba(207, 39, 141, 0.15);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
  user-select: none;
  -webkit-user-select: none;
  border: none;
  position: relative;
}

.date-bar:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(207, 39, 141, 0.3),
    0 5px 15px rgba(207, 39, 141, 0.2);
}

.date-bar:active {
  transform: translateY(0);
  box-shadow: 0 4px 15px rgba(207, 39, 141, 0.2),
    0 2px 8px rgba(207, 39, 141, 0.15);
}

.date-bar::before {
  content: '▸';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.8);
  font-size: 16px;
  transition: transform .15s ease;
}

.date-bar[aria-expanded="true"]::before {
  transform: translateY(-50%) rotate(90deg);
}

.date-bar:focus {
  outline: 3px solid rgba(207, 39, 141, 0.5);
  outline-offset: 2px;
}

.date-count {
  background: transparent;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 800;
  color: #ffffff;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.date-count:hover {
  transform: scale(1.05);
}

.date-cards {
  padding: 12px 4px 0;
}

.date-cards[hidden] {
  display: none;
}

.date-cards .cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* Analytics Modal */
.chart-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.chart-modal[hidden] {
  display: none;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: linear-gradient(180deg, #ffffff 0%, var(--card-surface, #f9fbff) 100%);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 2px solid var(--border);
}

.modal-header h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 32px;
  line-height: 1;
  color: var(--text);
  cursor: pointer;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.modal-close:hover {
  background: var(--chip-bg);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.chart-controls {
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.back-btn {
  padding: 10px 20px;
  border: 2px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.back-btn:hover {
  border-color: var(--accent);
  background: var(--chip-bg);
  color: var(--accent);
}

.back-btn:active {
  transform: scale(0.98);
}

.view-toggle {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.toggle-btn {
  padding: 10px 20px;
  border: 2px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.toggle-btn:hover {
  border-color: var(--accent);
  background: var(--chip-bg);
}

.toggle-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #ffffff;
  border-color: var(--accent);
}

.chart-container {
  min-height: 400px;
  position: relative;
}

.chart-bars {
  display: flex;
  align-items: flex-start;
  justify-content: space-around;
  gap: 12px;
  min-height: 350px;
  padding: 20px 20px 50px 20px;
  position: relative;
}

.chart-bars::before {
  content: '';
  position: absolute;
  bottom: 30px;
  left: 20px;
  right: 20px;
  height: 1px;
  background: rgba(0, 0, 0, 0.2);
  z-index: 0;
}

.chart-bar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  min-width: 60px;
  max-width: 120px;
  position: relative;
  z-index: 1;
  padding-bottom: 0;
}

.chart-bar-wrapper {
  width: 100%;
  height: 300px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
  flex-direction: column;
  padding: 0;
  margin: 0;
  padding-top: 20px;
  flex: 0 0 300px;
  min-height: 300px;
  max-height: 300px;
  border-bottom: 1px solid var(--border, rgba(53, 72, 148, 0.3));
  box-sizing: border-box;
  margin-bottom: 0;
}

.chart-bar {
  width: 100%;
  background: linear-gradient(180deg, #354894 0%, #5a6ba8 50%, #6b8afd 100%);
  border-radius: 0;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
  min-height: 4px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 0;
  margin: 0;
}

.chart-bar:hover {
  opacity: 0.85;
  transform: scaleY(1.05);
}

.chart-bar-value {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text);
  font-weight: 800;
  font-size: 12px;
  white-space: nowrap;
  z-index: 10;
  background: rgba(255, 255, 255, 0.95);
  padding: 2px 6px;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  line-height: 1.2;
}

.chart-bar-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  word-break: break-word;
  margin-top: 10px;
  line-height: 1.3;
  padding: 0 4px;
  margin-bottom: 0;
  flex-shrink: 0;
  width: 100%;
  min-height: auto;
  box-sizing: border-box;
}

.chart-bar-value-top {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text);
  font-weight: 800;
  font-size: 13px;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .modal-content {
    max-width: 95vw;
    max-height: 95vh;
    border-radius: 16px;
  }

  .modal-header {
    padding: 16px 20px;
  }

  .modal-header h3 {
    font-size: 20px;
  }

  .modal-body {
    padding: 20px 16px;
  }

  .chart-bars {
    gap: 8px;
    min-height: 280px;
  }

  .chart-bar-item {
    min-width: 50px;
    max-width: 80px;
  }

  .chart-bar-wrapper {
    height: 250px;
  }

  .chart-bar-label {
    font-size: 11px;
  }

  .toggle-btn {
    padding: 8px 16px;
    font-size: 13px;
  }
}

/* Login Page Styles */
.login-page {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: radial-gradient(1200px 700px at 10% -10%, var(--bg-start), transparent),
    radial-gradient(1200px 700px at 110% 10%, #f0f4fe, transparent),
    linear-gradient(180deg, var(--bg-end), var(--bg-end));
  z-index: 1000;
  padding: 20px;
}

.login-container {
  width: 100%;
  max-width: 450px;
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 48px 40px;
  text-align: center;
}

.login-logo {
  margin-bottom: 32px;
}

.login-logo img {
  max-width: 200px;
  height: auto;
}

.login-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.login-title {
  font-size: 32px;
  font-weight: 800;
  margin: 0;
  background: linear-gradient(135deg, #354894 0%, #5a6ba8 15%, #6b8afd 30%, #cf278d 45%, #8ba3ff 60%, #354894 75%, #27385f 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s linear infinite;
}

.login-subtitle {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
  opacity: 0.8;
}

.login-description {
  font-size: 14px;
  margin: 0;
  color: var(--text);
  opacity: 0.7;
  line-height: 1.6;
}

.google-signin-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 14px 24px;
  background: #ffffff;
  border: 1px solid #dadce0;
  border-radius: 8px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  color: #3c4043;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.google-signin-btn:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
  background: #f8f9fa;
}

.google-signin-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.google-signin-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.google-icon {
  width: 20px;
  height: 20px;
}

.login-error {
  width: 100%;
  padding: 12px 16px;
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.3);
  border-radius: 8px;
  color: #dc2626;
  font-size: 14px;
  text-align: left;
  margin-top: -8px;
}

.login-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(107, 138, 253, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-color-scheme: dark) {
  .google-signin-btn {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text);
  }

  .google-signin-btn:hover {
    background: rgba(255, 255, 255, 0.15);
  }

  .login-error {
    background: rgba(220, 38, 38, 0.2);
    border-color: rgba(220, 38, 38, 0.4);
    color: #f87171;
  }
}

@media (max-width: 600px) {
  .login-container {
    padding: 32px 24px;
    max-width: 100%;
  }

  .login-title {
    font-size: 28px;
  }

  .login-subtitle {
    font-size: 16px;
  }

  .google-signin-btn {
    padding: 12px 20px;
    font-size: 15px;
  }
}

/* Mobile Header Customization */
.mobile-profile-container {
  display: none;
  /* Hidden by default (desktop) */
}

@media (max-width: 900px) {

  /* Reduce title size */
  .title-main {
    font-size: 20px;
    padding-right: 48px;
    /* Space for avatar */
    padding-left: 48px;
  }

  header {
    padding: 16px 12px;
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Show mobile profile */
  .mobile-profile-container {
    display: block;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
  }

  .mobile-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
  }

  .mobile-user-avatar:active {
    transform: scale(0.95) translateY(-50%);
  }

  /* Mobile Dropdown */
  .mobile-dropdown-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 200px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    z-index: 1000;
  }

  .mobile-dropdown-menu[hidden] {
    display: none;
  }

  .mobile-user-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
    text-align: center;
    word-break: break-word;
  }

  .mobile-logout-btn {
    width: 100%;
    padding: 8px 16px;
    background: #cf278d;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
  }

  /* Hide original profile section on mobile */
  .user-profile-section {
    display: none;
  }
}

/* Filter Split Row */
.filter-split-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.filter-split-row .field {
  flex: 1;
  min-width: 0;
}