/* ============================================================
   DESKTOP LEFT SIDEBAR
============================================================ */

.side-panel {
  position: fixed;

  top: 0;
  left: 0;
  bottom: 0;

  width: 320px;

  z-index: 100;

  background: linear-gradient(180deg, #090e15 0%, #080d15 100%);

  border-right: 1px solid rgba(255, 255, 255, 0.07);

  box-shadow: 15px 0 45px rgba(0, 0, 0, 0.18);

  display: flex;
  flex-direction: column;
}

/* ============================================================
   SIDEBAR HEADER
============================================================ */

.side-panel-header {
  height: 72px;

  padding: 0 20px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.side-panel-title {
  display: flex;
  align-items: center;
  gap: 10px;

  color: var(--text-primary);

  font-size: 14px;
  font-weight: 600;
}

.side-panel-dot {
  width: 8px;
  height: 8px;

  border-radius: 50%;

  background: var(--blue);

  box-shadow: 0 0 12px rgba(245, 158, 11, 0.35);
}

/* ============================================================
   SIDEBAR CONTENT
============================================================ */

.side-panel-content {
  flex: 1;

  padding: 20px;
}

.side-panel-placeholder {
  display: flex;
  align-items: center;
  gap: 12px;

  padding: 14px;

  border: 1px dashed rgba(255, 255, 255, 0.08);

  border-radius: var(--radius-md);

  color: var(--text-secondary);

  font-size: 13px;
}

.side-panel-placeholder small {
  display: block;

  margin-top: 3px;

  color: var(--text-muted);

  font-size: 11px;
}

.placeholder-icon {
  width: 32px;
  height: 32px;

  display: grid;
  place-items: center;

  border-radius: 9px;

  background: rgba(245, 158, 11, 0.08);

  color: var(--blue);

  font-size: 18px;
}

/* ============================================================
   WORK HOURS PANEL
============================================================ */

.work-hours-panel {
  margin-bottom: 12px;
  padding: 10px;

  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;

  background: linear-gradient(180deg, rgba(14, 18, 28, 0.95), rgba(10, 14, 22, 0.98));

  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.work-hours-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.work-hours-header h2 {
  margin: 0;

  font-size: 14px;
  letter-spacing: -0.03em;
}

.work-hours-edit-button {
  padding: 6px 9px;

  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;

  background: rgba(255, 255, 255, 0.03);

  color: var(--text-primary);

  font-size: 10px;
  font-weight: 700;

  cursor: pointer;
}

.work-hours-edit-button:hover {
  background: rgba(245, 158, 11, 0.12);

  border-color: rgba(245, 158, 11, 0.22);
}

.work-hours-header-actions {
  display: flex;

  align-items: center;

  gap: 6px;

  flex-shrink: 0;
}

.work-hours-analytics-button {
  display: inline-flex;

  align-items: center;

  gap: 5px;

  padding: 6px 9px;

  border: 1px solid rgba(245, 158, 11, 0.22);
  border-radius: 999px;

  background: rgba(245, 158, 11, 0.1);

  color: var(--blue-light, #fbbf24);

  font-size: 10px;
  font-weight: 700;

  cursor: pointer;

  transition: background 160ms ease, border-color 160ms ease;
}

.work-hours-analytics-button svg {
  width: 13px;
  height: 13px;
}

.work-hours-analytics-button:hover {
  background: rgba(245, 158, 11, 0.2);

  border-color: rgba(245, 158, 11, 0.4);
}

.work-hours-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));

  gap: 6px;

  margin-top: 10px;
}

.work-hours-stat {
  padding: 5px 4px;

  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;

  background: rgba(255, 255, 255, 0.02);

  text-align: center;
}

.work-hours-stat span {
  display: block;

  margin-bottom: 3px;

  color: var(--text-muted);

  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.work-hours-stat strong {
  font-size: 10px;
  letter-spacing: -0.02em;
}

.work-hours-chart-shell {
  margin-top: 10px;
  padding: 4px 4px 2px;

  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;

  background: rgba(0, 0, 0, 0.12);
}

.work-hours-chart {
  width: 100%;
  height: 64px;
}

.work-hours-svg {
  width: 100%;
  height: 100%;

  overflow: visible;

}

.work-hours-line {
  fill: none;

  stroke: rgba(255, 255, 255, 0.28);
  stroke-width: 0.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.work-hours-average-line {
  stroke: rgba(164, 255, 8, 0.612);
  stroke-width: 0.3;
  stroke-dasharray: 2 2;
}

.work-hours-point {
  stroke: rgba(10, 14, 22, 0.95);
  stroke-width: 0.5;

  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.45));

  transition: r 0.15s ease;
}

.work-hours-interactive-point:hover .work-hours-point,
.work-hours-interactive-point:focus-visible .work-hours-point {
  r: 1.7;
}

.work-hours-hit-area {
  fill: transparent;

  cursor: pointer;
}

.work-hours-point-tick {
  stroke: rgba(255, 255, 255, 0.16);
  stroke-width: 0.1;
  stroke-dasharray: 0.8 0.8;

  transition: stroke 0.15s ease;
}

.work-hours-point-tick-active {
  stroke: rgba(255, 255, 255, 0.284);
  stroke-dasharray: none;
}

.work-hours-interactive-point:hover .work-hours-point-tick,
.work-hours-interactive-point:focus-visible .work-hours-point-tick {
  stroke: rgba(255, 255, 255, 0.4);
  stroke-dasharray: none;
}

.work-hours-axis-label {
  fill: var(--text-secondary);

  font-size: 2.3px;
  font-family: inherit;
}

.work-hours-axis-label-active {
  fill: var(--text-secondary);

  font-weight: 800;
}

.work-hours-average-label {
  fill: rgba(164, 255, 8, 0.612);

  font-size: 2.5px;
  font-weight: 500;
  font-family: inherit;
}

.work-hours-caption {
  margin: 8px 0 0;

  color: var(--text-secondary);

  font-size: 10px;
  line-height: 1.45;
}

.work-hours-dialog {
  width: min(560px, calc(100vw - 32px));
}

.work-hours-dialog-card {
  padding: 18px;
}

.work-hours-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.work-hours-form .full-width {
  grid-column: 1 / -1;
}

.side-panel-content .academic-calendar {
  margin-top: 14px;
  padding-top: 14px;

  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ============================================================
   DESKTOP: MOVE DASHBOARD TO THE RIGHT OF SIDEBAR
============================================================ */

@media (min-width: 901px) {
  .app-shell {
    margin-left: 320px;
  }
}

/* ============================================================
   MOBILE MENU BUTTON
============================================================ */

.menu-button {
  display: none;

  width: 42px;
  height: 42px;

  padding: 9px;

  border: 1px solid var(--border);

  border-radius: 10px;

  background: var(--surface);

  cursor: pointer;

  flex-shrink: 0;
}

.menu-button span {
  display: block;

  width: 100%;
  height: 2px;

  margin: 4px 0;

  border-radius: 2px;

  background: var(--text-primary);

  transition:
    transform 180ms ease,
    opacity 180ms ease;
}

/* ============================================================
   MOBILE CLOSE BUTTON
============================================================ */

.side-panel-close {
  display: none;

  width: 34px;
  height: 34px;

  border: 0;

  border-radius: 8px;

  background: transparent;

  color: var(--text-secondary);

  font-size: 25px;

  cursor: pointer;
}

.side-panel-close:hover {
  background: rgba(255, 255, 255, 0.06);

  color: var(--text-primary);
}

/* ============================================================
   BACKDROP
============================================================ */

.side-panel-backdrop {
  display: none;
}

/* ============================================================
   MOBILE SIDEBAR
============================================================ */

@media (max-width: 900px) {
  .menu-button {
    display: block;
  }

  .side-panel {
    width: min(82vw, 320px);

    transform: translateX(-105%);

    transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1);

    box-shadow: 20px 0 60px rgba(0, 0, 0, 0.45);
  }

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

  .side-panel-close {
    display: grid;

    place-items: center;
  }

  .side-panel-backdrop {
    position: fixed;

    inset: 0;

    z-index: 90;

    background: rgba(0, 0, 0, 0.55);

    backdrop-filter: blur(3px);

    opacity: 0;

    pointer-events: none;

    display: block;

    transition: opacity 280ms ease;
  }

  .side-panel-backdrop.is-visible {
    opacity: 1;

    pointer-events: auto;
  }

  /* Prevent page from scrolling while menu is open */

  body.menu-open {
    overflow: hidden;
  }
}

/* ============================================================
   MOBILE TOPBAR — CLEAN RESPONSIVE LAYOUT
============================================================ */

@media (max-width: 600px) {
  .topbar {
    display: grid;

    grid-template-columns: auto minmax(0, 1fr);

    grid-template-areas:
      "menu brand"
      "status status";

    align-items: center;

    column-gap: 12px;
    row-gap: 12px;

    width: 100%;
  }

  /* ========================================================
       MENU BUTTON
    ======================================================== */

  .menu-button {
    grid-area: menu;

    width: 44px;
    height: 44px;

    flex-shrink: 0;
  }

  /* ========================================================
       BRAND
    ======================================================== */

  .brand-area {
    grid-area: brand;

    min-width: 0;

    display: flex;

    align-items: center;

    gap: 10px;
  }

  .brand-area>div:last-child {
    min-width: 0;
  }

  .brand-area h1 {
    margin: 0;

    font-size: 20px;

    line-height: 1.1;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
  }

  .brand-area p {
    display: none;
  }

  /* ========================================================
       EXAM + LIVE ROW
    ======================================================== */

  .topbar-status-area {
    grid-area: status;

    width: 100%;

    min-width: 0;

    display: flex;

    align-items: center;

    justify-content: stretch;

    gap: 8px;
  }

  /* ========================================================
       EXAM COUNTDOWN
    ======================================================== */

  .exam-countdown {
    flex: 1 1 auto;

    min-width: 0;

    width: auto;

    padding: 8px 10px;

    gap: 8px;
    height: 60px;
  }

  .exam-countdown-icon {
    flex-shrink: 0;

    font-size: 16px;
  }

  .exam-countdown-info {
    min-width: 0;
  }

  .exam-countdown-label {
    max-width: none;

    font-size: 0.7rem;
  }

  .exam-countdown-time {
    font-size: 0.66rem;

    white-space: nowrap;
  }

  /* ========================================================
       LIVE STATUS
    ======================================================== */

  .connection-status {
    display: none;

    flex: 0 0 auto;

    margin-top: 0;

    padding: 8px 10px;
  }
}

