/* =========================================================================
   FSHS IT Department — Frontier Schools brand theme
   Single source of truth for brand tokens. Reuse these variables/classes
   instead of inventing new colors or spacing per page.
   ========================================================================= */

:root {
  /* Brand colors */
  --fs-navy: #001842;
  --fs-navy-hover: #0b2a5c;
  --fs-navy-soft: #e9edf4;   /* tinted navy for selected rows / subtle fills */
  --fs-gold: #ffb504;
  --fs-gold-soft: #fff2d6;
  --fs-bg-main: #fffcff;
  --fs-bg-secondary: #ece7e5;
  --fs-white: #ffffff;
  --fs-text: #1b2534;        /* dark navy/charcoal body text, not pure black */
  --fs-text-muted: #5b6474;
  --fs-border: #e3e0e6;
  --fs-danger: #c0362c;

  /* Radii */
  --fs-radius-sm: 8px;
  --fs-radius-md: 12px;
  --fs-radius-lg: 18px;
  --fs-radius-xl: 22px;
  --fs-radius-pill: 999px;

  /* Layout */
  --fs-sidebar-width: 264px;
  --fs-topbar-height: 72px;

  --fs-font: "Bricolage Grotesque", Arial, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--fs-font);
  background: var(--fs-bg-main);
  color: var(--fs-text);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--fs-font);
  font-weight: 700;
  color: var(--fs-navy);
}

a {
  color: var(--fs-navy);
}

/* =========================================================================
   App shell
   ========================================================================= */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-left: var(--fs-sidebar-width);
}

/* =========================================================================
   Sidebar
   ========================================================================= */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--fs-sidebar-width);
  background: var(--fs-navy);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  z-index: 1030;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 20px 8px;
  text-decoration: none;
}

.sidebar-brand:hover .sidebar-wordmark-line1,
.sidebar-brand:hover .sidebar-wordmark-line2 {
  opacity: 0.85;
}

.sidebar-logo-badge {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  background: var(--fs-white);
  border-radius: var(--fs-radius-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

.frontier-mark {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sidebar-wordmark {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.sidebar-wordmark-line1 {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--fs-white);
}

.sidebar-wordmark-line2 {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fs-gold);
}

.sidebar-nav {
  padding: 20px 12px 16px;
  overflow-y: auto;
  flex: 1;
}

.sidebar-section-label {
  list-style: none;
  padding: 16px 14px 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.45);
}

.sidebar-section-label:first-child {
  padding-top: 4px;
}

.sidebar-nav .nav-item {
  margin-bottom: 4px;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--fs-radius-md);
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  font-size: 0.925rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.sidebar-nav .nav-link i {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.7);
  width: 20px;
  text-align: center;
}

.sidebar-nav .nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--fs-white);
  text-decoration: none;
}

.sidebar-nav .nav-link.active {
  background: var(--fs-navy-hover);
  color: var(--fs-white);
  box-shadow: inset 3px 0 0 var(--fs-gold);
}

.sidebar-nav .nav-link.active i {
  color: var(--fs-white);
}

.sidebar-nav .nav-link.is-placeholder {
  color: rgba(255, 255, 255, 0.35);
  cursor: default;
}

.sidebar-nav .nav-link.is-placeholder i {
  color: rgba(255, 255, 255, 0.35);
}

.sidebar-nav .nav-link.is-placeholder:hover {
  background: transparent;
}

.nav-badge {
  margin-left: auto;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--fs-bg-secondary);
  color: var(--fs-text-muted);
  padding: 2px 8px;
  border-radius: var(--fs-radius-pill);
}

.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-footer-text {
  color: rgba(255, 255, 255, 0.45);
}

/* =========================================================================
   Top header
   ========================================================================= */

.topbar {
  height: var(--fs-topbar-height);
  background: var(--fs-navy);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 1020;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.topbar-app-title {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--fs-white);
  white-space: nowrap;
}

.topbar-pills {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.topbar-pill {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--fs-radius-md);
  padding: 6px 14px;
  line-height: 1.2;
}

.topbar-pill.dropdown-toggle::after {
  display: none;
}

.topbar-pill:hover {
  background: rgba(255, 255, 255, 0.14);
}

.topbar-pill-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.6);
}

.topbar-pill-value {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--fs-white);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: var(--fs-radius-md);
  border: 1px solid var(--fs-border);
  background: var(--fs-white);
  color: var(--fs-navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
}

.icon-btn:hover {
  background: var(--fs-bg-secondary);
}

/* Variant for icon buttons sitting on the navy topbar instead of a white card. */
.icon-btn-dark {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--fs-white);
}

.icon-btn-dark:hover {
  background: rgba(255, 255, 255, 0.16);
  color: var(--fs-white);
}

.notification-dot {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--fs-gold);
  border: 1.5px solid var(--fs-white);
}

.notifications-menu {
  width: 320px;
  max-width: calc(100vw - 32px);
  padding: 0;
  overflow: hidden;
}

.notifications-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
}

.notifications-menu .dropdown-divider {
  border-color: var(--fs-border);
}

.notification-item {
  display: block;
  padding: 10px 14px;
  white-space: normal;
  border-left: 3px solid transparent;
}

.notification-item.unread {
  background: var(--fs-navy-soft);
  border-left-color: var(--fs-gold);
}

.notification-item-title {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--fs-navy);
}

.notification-item-message {
  font-size: 0.8rem;
  color: var(--fs-text-muted);
  margin-top: 2px;
}

.notification-item-time {
  font-size: 0.72rem;
  color: var(--fs-text-muted);
  margin-top: 4px;
}

.profile-btn-dark {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--fs-radius-pill);
  padding: 6px 12px 6px 6px;
}

.profile-btn-dark:hover {
  background: rgba(255, 255, 255, 0.14);
}

.profile-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--fs-gold);
  color: var(--fs-navy);
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.profile-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--fs-white);
}

.profile-avatar-img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
}

.badge-on-dark {
  background: rgba(255, 255, 255, 0.12);
  color: var(--fs-white);
  font-weight: 600;
  border-radius: var(--fs-radius-pill);
  padding: 5px 10px;
}

/* =========================================================================
   Content area
   ========================================================================= */

.content {
  flex: 1;
  padding: 28px 28px 40px;
}

.page-header {
  margin-bottom: 20px;
}

.page-title {
  margin: 0;
  font-size: 1.5rem;
}

.page-subtitle {
  margin: 4px 0 0;
  color: var(--fs-text-muted);
  font-size: 0.925rem;
}

/* =========================================================================
   Cards
   ========================================================================= */

.brand-card {
  background: var(--fs-white);
  border: 1px solid var(--fs-border);
  border-radius: var(--fs-radius-lg);
  box-shadow: 0 1px 2px rgba(0, 24, 66, 0.04);
  padding: 20px;
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.card-title {
  font-size: 1.05rem;
  margin: 0;
}

/* Stat cards (KPI tiles) */

.stat-card {
  position: relative;
  padding: 18px 20px;
}

.stat-card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--fs-radius-sm);
  background: var(--fs-navy-soft);
  color: var(--fs-navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  margin-bottom: 10px;
}

.stat-card-highlight .stat-card-icon {
  background: var(--fs-gold-soft);
  color: #8a5e00;
}

.stat-card-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--fs-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stat-card-value {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--fs-navy);
  line-height: 1.2;
}

.stat-card-context {
  font-size: 0.8rem;
  color: var(--fs-text-muted);
  margin-top: 2px;
}

/* =========================================================================
   Buttons
   ========================================================================= */

.btn-brand-primary {
  background: var(--fs-navy);
  border: 1px solid var(--fs-navy);
  color: var(--fs-white);
  font-weight: 600;
  border-radius: var(--fs-radius-md);
  padding: 9px 18px;
}

.btn-brand-primary:hover {
  background: var(--fs-navy-hover);
  border-color: var(--fs-navy-hover);
  color: var(--fs-white);
}

.btn-brand-secondary {
  background: var(--fs-white);
  border: 1px solid var(--fs-border);
  color: var(--fs-navy);
  font-weight: 600;
  border-radius: var(--fs-radius-md);
  padding: 9px 18px;
}

.btn-brand-secondary:hover {
  background: var(--fs-bg-secondary);
  color: var(--fs-navy);
}

.btn-brand-danger {
  background: var(--fs-white);
  border: 1px solid var(--fs-danger);
  color: var(--fs-danger);
  font-weight: 600;
  border-radius: var(--fs-radius-md);
  padding: 9px 18px;
}

.btn-brand-danger:hover {
  background: var(--fs-danger);
  color: var(--fs-white);
}

/* =========================================================================
   Tables
   ========================================================================= */

.brand-table {
  margin-bottom: 0;
}

.brand-table thead th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fs-text-muted);
  font-weight: 700;
  border-bottom: 1px solid var(--fs-border);
  padding: 10px 12px;
  background: transparent;
}

.brand-table tbody td {
  padding: 12px;
  border-bottom: 1px solid var(--fs-border);
  font-size: 0.9rem;
  vertical-align: middle;
}

.brand-table tbody tr:last-child td {
  border-bottom: none;
}

.brand-table tbody tr:hover {
  background: var(--fs-bg-main);
}

.brand-table tbody tr.row-selected {
  background: var(--fs-navy-soft);
}

/* Drag-and-drop reordering (Settings lists). */
.drag-handle {
  cursor: grab;
  color: var(--fs-text-muted);
  font-size: 1.05rem;
  padding: 4px;
}

.drag-handle:active {
  cursor: grabbing;
}

.js-sortable-row.dragging {
  opacity: 0.5;
}

.js-sortable-row.drag-over {
  box-shadow: inset 0 2px 0 var(--fs-gold);
}

/* =========================================================================
   Badges
   ========================================================================= */

.badge-muted {
  background: var(--fs-bg-secondary);
  color: var(--fs-text-muted);
  font-weight: 600;
  border-radius: var(--fs-radius-pill);
  padding: 5px 10px;
}

.badge-status-pending {
  background: var(--fs-gold-soft);
  color: #8a5e00;
  font-weight: 600;
  border-radius: var(--fs-radius-pill);
  padding: 5px 10px;
}

.badge-status-active {
  background: #e3f3ea;
  color: #1e7a46;
  font-weight: 600;
  border-radius: var(--fs-radius-pill);
  padding: 5px 10px;
}

.badge-status-overdue {
  background: #fbe6e4;
  color: var(--fs-danger);
  font-weight: 600;
  border-radius: var(--fs-radius-pill);
  padding: 5px 10px;
}

.badge-status-inprogress {
  background: var(--fs-navy-soft);
  color: var(--fs-navy);
  font-weight: 600;
  border-radius: var(--fs-radius-pill);
  padding: 5px 10px;
}

.badge-status-resolved {
  background: #e3f3ea;
  color: #1e7a46;
  font-weight: 600;
  border-radius: var(--fs-radius-pill);
  padding: 5px 10px;
}

/* =========================================================================
   Misc
   ========================================================================= */

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
}

.checklist li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  color: var(--fs-text-muted);
  font-size: 0.9rem;
  border-bottom: 1px solid var(--fs-border);
}

.checklist li:last-child {
  border-bottom: none;
}

.checklist li i {
  font-size: 1rem;
}

.checklist li.done {
  color: var(--fs-text);
}

.checklist li.done i {
  color: #1e7a46;
}

.checklist li:not(.done) i {
  color: var(--fs-border);
}

/* Ticket issue checkboxes (New IT Request form) */

.issue-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.issue-check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--fs-border);
  border-radius: var(--fs-radius-md);
  background: var(--fs-bg-main);
}

.issue-check-item .form-check-input {
  margin: 0;
  flex-shrink: 0;
}

.issue-check-item label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.9rem;
  cursor: pointer;
}

.issue-check-item i {
  color: var(--fs-navy);
}

/* Ticket comment thread */

.ticket-comment {
  padding: 10px 0;
  border-bottom: 1px solid var(--fs-border);
}

.ticket-comment:last-child {
  border-bottom: none;
}

.ticket-comment-meta {
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 0.85rem;
  margin-bottom: 4px;
}

/* Apps directory */

.app-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--fs-white);
  border: 1px solid var(--fs-border);
  border-radius: var(--fs-radius-lg);
  box-shadow: 0 1px 2px rgba(0, 24, 66, 0.04);
  padding: 16px 18px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.app-tile:hover {
  border-color: var(--fs-navy);
  box-shadow: 0 4px 16px rgba(0, 24, 66, 0.08);
  transform: translateY(-1px);
  color: inherit;
}

.app-tile-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: var(--fs-radius-md);
  background: var(--fs-navy-soft);
  color: var(--fs-navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  overflow: hidden;
}

.app-tile-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: var(--fs-radius-md);
}

.app-tile-name {
  flex: 1;
  font-weight: 700;
  color: var(--fs-navy);
  font-size: 1rem;
}

.app-tile-go {
  color: var(--fs-text-muted);
  font-size: 1rem;
}

/* Annual Routines and Notes (plain Excel-style grid, 5 fixed columns A-E) */

.routine-table-wrapper {
  overflow-x: auto;
}

.routine-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  table-layout: fixed;
}

.routine-table th,
.routine-table td {
  border-bottom: 1px solid var(--fs-border);
  border-right: 1px solid var(--fs-border);
  padding: 0;
  vertical-align: middle;
  overflow: hidden;
}

.routine-table th:last-child,
.routine-table td:last-child {
  border-right: none;
}

.routine-col-header {
  position: relative;
  background: var(--fs-bg-secondary);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--fs-navy);
  text-align: left;
  padding: 10px 14px 10px 12px;
}

.col-resize-handle {
  position: absolute;
  top: 0;
  right: -3px;
  width: 6px;
  height: 100%;
  cursor: col-resize;
  z-index: 2;
}

.col-resize-handle:hover {
  background: var(--fs-navy-hover, var(--fs-navy));
  opacity: 0.4;
}

body.col-resizing {
  cursor: col-resize;
  user-select: none;
}

.routine-row-handle-cell {
  width: 92px;
  text-align: center;
  background: var(--fs-bg-secondary);
  padding: 6px 8px;
}

.routine-row-handle-cell > * {
  vertical-align: middle;
}

.routine-row-number {
  display: inline-block;
  min-width: 14px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--fs-text-muted);
  margin-right: 2px;
}

.routine-cell-input {
  display: block;
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  font-family: inherit;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--fs-text);
  padding: 10px;
  border-radius: 0;
  resize: none;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: calc(1.4em + 20px);
}

.routine-cell-input:focus {
  outline: none;
  background: var(--fs-navy-soft);
  border-color: var(--fs-navy);
}

.routine-icon-btn {
  border: none;
  background: transparent;
  color: var(--fs-text-muted);
  width: 22px;
  height: 22px;
  border-radius: var(--fs-radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.routine-icon-btn:hover {
  background: var(--fs-danger);
  color: var(--fs-white);
}

.routine-save-indicator {
  font-size: 0.75rem;
  color: var(--fs-text-muted);
  min-height: 1.1em;
}

/* Annual Routines and Notes — attachments (upload, voice, camera, scan, audio,
   drawing, sticky note, table) hung off each grid row. */

.routine-row-handle-cell {
  white-space: nowrap;
}

.routine-attach-toggle {
  position: relative;
  margin: 0 1px;
  overflow: visible;
}

.routine-attach-toggle:hover {
  background: var(--fs-navy);
  color: var(--fs-white);
}

.routine-attach-count {
  position: absolute;
  top: -5px;
  left: -5px;
  background: var(--fs-gold, #c9a227);
  color: var(--fs-navy);
  font-size: 0.6rem;
  font-weight: 700;
  line-height: 1;
  min-width: 14px;
  height: 14px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  pointer-events: none;
}

tr.routine-attachments-row > td {
  background: var(--fs-bg-secondary);
  padding: 14px 16px;
  border-right: none;
}

.routine-attach-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.routine-attach-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--fs-border);
  background: var(--fs-white);
  color: var(--fs-text);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: var(--fs-radius-sm);
}

.routine-attach-btn:hover {
  background: var(--fs-navy-soft);
  border-color: var(--fs-navy);
  color: var(--fs-navy);
}

.routine-attach-btn i {
  font-size: 0.95rem;
}

.routine-attach-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.routine-attach-card {
  position: relative;
  background: var(--fs-white);
  border: 1px solid var(--fs-border);
  border-radius: var(--fs-radius-sm);
  padding: 8px;
  min-width: 110px;
  max-width: 220px;
}

.routine-attach-card .routine-attach-delete {
  position: absolute;
  top: 2px;
  right: 2px;
}

.routine-attach-thumb {
  display: block;
  width: 100%;
  max-height: 120px;
  object-fit: cover;
  border-radius: 4px;
}

.routine-attach-file {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--fs-text);
  text-decoration: none;
  word-break: break-word;
  padding-right: 16px;
}

.routine-attach-file i {
  font-size: 1.1rem;
  color: var(--fs-navy);
  flex-shrink: 0;
}

.routine-attach-audio {
  display: flex;
  align-items: center;
  gap: 8px;
}

.routine-attach-audio audio {
  max-width: 180px;
  height: 32px;
}

.routine-sticky-note {
  padding: 10px;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  min-height: 70px;
}

.routine-sticky-note-text {
  font-size: 0.8rem;
  white-space: pre-wrap;
  word-break: break-word;
  color: #2a2a2a;
}

.routine-attach-mini-table-wrapper {
  overflow-x: auto;
}

.routine-attach-mini-table,
.routine-edit-table {
  border-collapse: collapse;
  font-size: 0.78rem;
}

.routine-attach-mini-table td,
.routine-edit-table td {
  border: 1px solid var(--fs-border);
  padding: 4px 6px;
}

.routine-edit-table td input {
  min-width: 70px;
}

/* Shared attachment capture modal */

.routine-capture-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.routine-capture-timer {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--fs-text-muted);
}

.routine-camera-preview {
  width: 100%;
  max-height: 320px;
  background: #000;
  border-radius: var(--fs-radius-sm);
  object-fit: contain;
}

.routine-drawing-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 8px;
}

.routine-color-swatches {
  display: inline-flex;
  gap: 6px;
}

.routine-color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  padding: 0;
  cursor: pointer;
}

.routine-color-swatch.active {
  border-color: var(--fs-navy);
}

.routine-drawing-canvas {
  width: 100%;
  max-width: 460px;
  border: 1px solid var(--fs-border);
  border-radius: var(--fs-radius-sm);
  touch-action: none;
  cursor: crosshair;
}

/* Dashboard — Annual Routines progress widget */

.dashboard-progress-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.dashboard-progress-bar {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: var(--fs-bg-secondary);
  overflow: hidden;
}

.dashboard-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--fs-navy), #1d8a4c);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.dashboard-progress-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fs-text-muted);
  white-space: nowrap;
}

/* Annual Routines and Notes — schedule panel (frequency, due date, status, history) */

.routine-row-status-notstarted { box-shadow: inset 3px 0 0 var(--fs-text-muted); }
.routine-row-status-inprogress { box-shadow: inset 3px 0 0 #2a6ad1; }
.routine-row-status-done { box-shadow: inset 3px 0 0 #1d8a4c; }
.routine-row-status-overdue { box-shadow: inset 3px 0 0 var(--fs-danger); }

.routine-schedule-panel {
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--fs-border);
}

.routine-schedule-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.routine-schedule-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--fs-text-muted);
  margin: 0;
}

.routine-schedule-row select,
.routine-schedule-row input[type="date"] {
  max-width: 170px;
}

.routine-status-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.routine-status-badge.routine-status-notstarted { background: var(--fs-bg-secondary); color: var(--fs-text-muted); }
.routine-status-badge.routine-status-inprogress { background: #e8f0fd; color: #2a6ad1; }
.routine-status-badge.routine-status-done { background: #e7f3ec; color: #1d8a4c; }
.routine-status-badge.routine-status-overdue { background: #fbebe9; color: var(--fs-danger); }

.routine-history-toggle {
  border: none;
  background: transparent;
  color: var(--fs-text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 0;
}

.routine-history-toggle:hover {
  color: var(--fs-navy);
}

.routine-history-list {
  list-style: none;
  margin: 0 0 4px;
  padding: 0;
  font-size: 0.8rem;
  color: var(--fs-text-muted);
}

.routine-history-list li {
  padding: 2px 0;
}

.routine-template-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 320px;
  overflow-y: auto;
}

.routine-template-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  border-radius: var(--fs-radius-sm);
  cursor: pointer;
}

.routine-template-item:hover {
  background: var(--fs-bg-secondary);
}

.routine-template-item span:nth-child(2) {
  flex: 1;
}

/* Notes board (Excel/PDF uploads, in-app spreadsheets, Google Doc/Sheet links) */

.note-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--fs-white);
  border: 1px solid var(--fs-border);
  border-radius: var(--fs-radius-lg);
  box-shadow: 0 1px 2px rgba(0, 24, 66, 0.04);
  overflow: hidden;
  height: 100%;
}

.note-tile-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: rgba(27, 37, 52, 0.55);
  color: var(--fs-white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.note-tile-delete:hover {
  background: var(--fs-danger);
}

.note-tile-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 140px;
  background: var(--fs-navy-soft);
  color: var(--fs-navy);
  font-size: 2.6rem;
  text-decoration: none;
  border: none;
  width: 100%;
  padding: 0;
}

.note-tile-thumb-sheet {
  background: var(--fs-white);
  padding: 10px;
  overflow: hidden;
}

.note-tile-icon-excel { color: #1d6f42; background: #e7f3ec; }
.note-tile-icon-pdf { color: #c0392b; background: #fbebe9; }
.note-tile-icon-gdoc { color: #2a6ad1; background: #e8f0fd; }
.note-tile-icon-gsheet { color: #1d8a4c; background: #e7f3ec; }

.note-mini-grid {
  width: 100%;
  height: 100%;
  border-collapse: collapse;
  font-size: 0.6rem;
  color: var(--fs-text-muted);
  table-layout: fixed;
}

.note-mini-grid td {
  border: 1px solid var(--fs-border);
  padding: 2px 4px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 60px;
}

.note-tile-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--fs-border);
}

.note-tile-title {
  font-weight: 700;
  color: var(--fs-navy);
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-tile-edit {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--fs-text-muted);
  width: 24px;
  height: 24px;
  border-radius: var(--fs-radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.note-tile-edit:hover {
  background: var(--fs-navy-soft);
  color: var(--fs-navy);
}

.note-edit-grid-wrap {
  overflow-x: auto;
}

.note-edit-table {
  border-collapse: collapse;
}

.note-edit-table td {
  border: 1px solid var(--fs-border);
  padding: 2px;
}

.note-edit-table td input {
  min-width: 90px;
}

/* To Do List */

.todo-card {
  max-width: 640px;
}

.todo-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.todo-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--fs-border);
}

.todo-item:last-child {
  border-bottom: none;
}

.todo-item-title-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.todo-item-title {
  font-weight: 600;
  color: var(--fs-text);
}

.todo-item.is-done .todo-item-title {
  color: var(--fs-text-muted);
  text-decoration: line-through;
}

.todo-item-created {
  font-size: 0.75rem;
  color: var(--fs-text-muted);
}

.todo-item-due {
  margin-top: 2px;
  font-size: 0.8rem;
  color: var(--fs-text-muted);
}

.todo-item-due-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--fs-text-muted);
  margin-right: 4px;
}

.todo-item-check {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Auth (login / access denied) pages */

.auth-body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--fs-bg-secondary);
  font-family: var(--fs-font);
}

.auth-wrapper {
  width: 100%;
  max-width: 400px;
  padding: 20px;
}

.auth-card {
  background: var(--fs-white);
  border: 1px solid var(--fs-border);
  border-radius: var(--fs-radius-xl);
  box-shadow: 0 4px 24px rgba(0, 24, 66, 0.08);
  padding: 32px 28px;
}

.auth-mark-badge {
  width: 64px;
  height: 64px;
  margin: 0 auto;
}

/* =========================================================================
   Responsive
   ========================================================================= */

.sidebar-toggle-btn {
  display: none;
}

.sidebar-backdrop {
  display: none;
}

@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

  .sidebar.sidebar-open {
    transform: translateX(0);
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0);
  }

  .main-wrapper {
    margin-left: 0;
  }

  .topbar-search {
    display: none;
  }

  .sidebar-toggle-btn {
    display: inline-flex;
  }

  .sidebar-backdrop.show {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(27, 37, 52, 0.35);
    z-index: 1025;
  }
}
