/* ==========================================================================
   NÖBETCİM — SOFT & MODERN PANEL THEME
   ========================================================================== */
:root {
  /* Surfaces */
  --bg-body: #f5f7fb;
  --bg-card: #ffffff;
  --bg-muted: #f3f5f9;
  --bg-hover: #f7f9fc;

  /* Text */
  --text-primary: #1e2537;
  --text-secondary: #485166;
  --text-muted: #7c869b;

  /* Lines */
  --border: #e8ecf3;
  --border-strong: #d8dee9;
  --grid-line: #e3e8f0;

  /* Brand (soft indigo) */
  --primary: #5b6cf0;
  --primary-hover: #4a5ae0;
  --primary-soft: #eef0fe;
  --primary-ring: rgba(91, 108, 240, 0.22);

  /* Semantic */
  --success: #1f9d6b;
  --success-soft: #e6f6ef;
  --danger: #e0565b;
  --danger-soft: #fdeced;
  --warning: #d48a1c;
  --warning-soft: #fdf4e3;
  --purple: #8b5cf6;
  --purple-soft: #f2edfe;
  --amber: #f0a43a;

  /* Shape */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  /* Elevation */
  --shadow-xs: 0 1px 2px rgba(30, 37, 55, 0.04);
  --shadow-sm: 0 2px 10px rgba(30, 37, 55, 0.05), 0 1px 2px rgba(30, 37, 55, 0.04);
  --shadow-md: 0 8px 24px rgba(30, 37, 55, 0.08);
  --shadow-lg: 0 18px 48px rgba(30, 37, 55, 0.16);

  --sidebar-width: 264px;
  --topbar-height: 64px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.5;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

:focus-visible {
  outline: 3px solid var(--primary-ring);
  outline-offset: 2px;
}

.icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ==========================================================================
   APP SHELL
   ========================================================================== */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ---------- Sidebar (soft light) ---------- */
.app-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--bg-card);
  border-inline-end: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  inset-block-start: 0;
  height: 100vh;
  z-index: 60;
}

.sidebar-brand {
  height: var(--topbar-height);
  padding: 0 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: inherit;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6f7ff5 0%, #8b5cf6 100%);
  color: #ffffff;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 16px rgba(91, 108, 240, 0.32);
}

.brand-title h1 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.brand-title p {
  margin: 0;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.sidebar-close-btn {
  display: none;
  background: var(--bg-muted);
  border: none;
  color: var(--text-secondary);
  border-radius: var(--radius-xs);
  width: 34px;
  height: 34px;
  cursor: pointer;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.sidebar-section-label {
  padding: 1rem 0.65rem 0.4rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a3abbd;
}

.nav-tab {
  appearance: none;
  width: 100%;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.58rem 0.65rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: start;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease);
  font-family: inherit;
}

.nav-tab .nav-icon {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--bg-muted);
  color: var(--text-muted);
  flex-shrink: 0;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease);
}

.nav-tab:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-tab:hover .nav-icon {
  color: var(--primary);
}

.nav-tab.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
}

.nav-tab.active .nav-icon {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(91, 108, 240, 0.3);
}

.sidebar-footer {
  margin: 0 0.85rem 0.85rem;
  padding: 0.85rem;
  border-radius: var(--radius-md);
  background: var(--bg-muted);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-footer .btn {
  width: 100%;
  justify-content: center;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(30, 37, 55, 0.35);
  backdrop-filter: blur(2px);
  z-index: 55;
}

.sidebar-backdrop.open {
  display: block;
}

/* ---------- Workspace ---------- */
.app-workspace {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.app-topbar {
  min-height: var(--topbar-height);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(10px);
  border-block-end: 1px solid var(--border);
  padding: 0.6rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  position: sticky;
  inset-block-start: 0;
  z-index: 40;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hamburger-btn {
  display: none;
  appearance: none;
  background: var(--bg-muted);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  cursor: pointer;
}

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.topbar-breadcrumb strong {
  color: var(--text-primary);
  font-weight: 700;
}

.mobile-brand-label {
  display: none;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary);
}

.month-selector-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-muted);
  padding: 0.3rem;
  border-radius: var(--radius-md);
}

.month-selector-bar label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  padding-inline: 0.35rem;
}

.month-selector-bar select {
  padding: 0.42rem 0.75rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  font-family: inherit;
}

.month-selector-bar .btn-outline {
  background: var(--bg-card);
  border-color: transparent;
  box-shadow: var(--shadow-xs);
}

/* Mobile quick page strip */
.mobile-tab-strip {
  display: none;
  background: var(--bg-card);
  border-block-end: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  overflow-x: auto;
  gap: 0.4rem;
  scrollbar-width: none;
}

.mobile-tab-strip::-webkit-scrollbar {
  display: none;
}

.mobile-tab-strip .nav-tab {
  width: auto;
  flex-shrink: 0;
  white-space: nowrap;
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
  border-radius: var(--radius-pill);
  background: var(--bg-muted);
  gap: 0.4rem;
}

.mobile-tab-strip .nav-tab.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(91, 108, 240, 0.28);
}

/* ==========================================================================
   PAGE CONTENT
   ========================================================================== */
.app-main {
  flex: 1;
  padding: 1.5rem 1.75rem 3rem;
  max-width: 1680px;
  width: 100%;
  margin: 0 auto;
}

.tab-panel {
  display: none;
  animation: pageFadeIn 0.28s var(--ease);
}

.tab-panel.active {
  display: block;
}

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

.toolbar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.35rem;
  margin-block-end: 1.1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.page-kicker {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 0.18rem 0.6rem;
  border-radius: var(--radius-pill);
  margin-block-end: 0.45rem;
}

.toolbar-title h2 {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.toolbar-title p {
  margin: 0.3rem 0 0;
  font-size: 0.84rem;
  color: var(--text-muted);
  max-width: 72ch;
}

.toolbar-title p strong {
  color: var(--text-secondary);
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.56rem 1rem;
  min-height: 38px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.18s var(--ease), box-shadow 0.18s var(--ease), transform 0.12s var(--ease), color 0.18s var(--ease);
  white-space: nowrap;
  font-family: inherit;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(91, 108, 240, 0.25);
}
.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 6px 16px rgba(91, 108, 240, 0.32);
}

.btn-success {
  background: var(--success-soft);
  color: var(--success);
}
.btn-success:hover {
  background: #d4efe3;
}

.btn-amber {
  background: var(--warning-soft);
  color: #b8730f;
}
.btn-amber:hover {
  background: #fbe9c8;
}

.btn-purple {
  background: var(--purple-soft);
  color: #7140e0;
}
.btn-purple:hover {
  background: #e7defd;
}

.btn-outline {
  background: var(--bg-card);
  color: var(--text-secondary);
  border-color: var(--border-strong);
}
.btn-outline:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: #c5cdda;
}

.btn-danger-soft {
  background: var(--danger-soft);
  color: var(--danger);
}
.btn-danger-soft:hover {
  background: #fadadc;
}

.btn-sm {
  padding: 0.38rem 0.75rem;
  min-height: 32px;
  font-size: 0.78rem;
  border-radius: 9px;
}

.btn-icon-only {
  padding: 0 !important;
  width: 34px;
  min-height: 34px;
}

/* ==========================================================================
   TABLES (per modern-web-guidance: responsive-table)
   ========================================================================== */
.table-wrapper {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  max-inline-size: 100%;
  max-block-size: min(760px, calc(100vh - 230px));
  container-type: inline-size;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.table-wrapper:focus-visible {
  outline: 3px solid var(--primary-ring);
  outline-offset: 2px;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.84rem;
}

.data-table caption {
  padding: 0.95rem 1.2rem;
  font-weight: 800;
  font-size: 0.98rem;
  text-align: start;
  background: linear-gradient(90deg, #eef7ef 0%, #f6fbf6 100%);
  color: #23613a;
  border-block-end: 1px solid var(--grid-line);
  letter-spacing: -0.01em;
}

.data-table thead {
  position: sticky;
  inset-block-start: 0;
  z-index: 3;
}

.data-table th,
.data-table td {
  padding: 0.6rem 0.75rem;
  border-block-end: 1px solid var(--grid-line);
  border-inline-end: 1px solid #f0f3f8;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.data-table thead th {
  background: #f8fafd;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  border-block-end: 1px solid var(--border-strong);
}

.data-table thead th.col-off {
  background: #fff3d1;
  color: #8a5a0a;
}

.data-table thead th.col-mr {
  background: #fff8e6;
  color: #7a5a14;
}

.data-table thead th.col-xr {
  background: #eef4ff;
  color: #3a55a8;
}

.data-table thead tr.sub-header th {
  background: #fbfcfe;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.data-table tbody th {
  position: sticky;
  inset-inline-start: 0;
  z-index: 1;
  background: var(--bg-card);
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
}

.data-table tbody tr {
  transition: background-color 0.12s var(--ease);
}

.data-table tbody tr:hover td,
.data-table tbody tr:hover th {
  background-color: var(--bg-hover);
}

.data-table tbody tr:last-child td,
.data-table tbody tr:last-child th {
  border-block-end: none;
}

/* Sunday rows: soft coral */
.data-table tbody tr.row-sunday th,
.data-table tbody tr.row-sunday td {
  background-color: #fdecec !important;
  color: #c2403f !important;
  font-weight: 700;
}

/* Holiday rows: soft peach */
.data-table tbody tr.row-holiday th,
.data-table tbody tr.row-holiday td {
  background-color: #fff3e6 !important;
  color: #b2651b !important;
  font-weight: 700;
}

/* External technician (Sinan / Fatih) highlight */
.cell-external-highlight {
  background-color: #fff6c7 !important;
  color: #7a5a00 !important;
  font-weight: 800 !important;
  box-shadow: inset 3px 0 0 #f2c94c;
}

/* Weekly summary rows */
.data-table tbody tr.row-week-summary th,
.data-table tbody tr.row-week-summary td {
  background-color: #f4f5fe !important;
  color: var(--text-secondary) !important;
  font-weight: 600;
  font-size: 0.78rem;
  border-block-start: 1px solid #dfe3fb;
  border-block-end: 2px solid #dfe3fb;
}

.data-table tbody tr.row-month-total th,
.data-table tbody tr.row-month-total td {
  background-color: #eef0fe !important;
  color: var(--text-primary) !important;
  font-weight: 700;
  font-size: 0.8rem;
  border-block-start: 2px solid #c9cff8;
}

/* Clickable picker cells */
.picker-cell {
  cursor: pointer;
  position: relative;
  font-weight: 600;
  min-width: 96px;
  transition: background-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.picker-cell:hover {
  background-color: var(--primary-soft) !important;
  box-shadow: inset 0 0 0 2px rgba(91, 108, 240, 0.45);
  border-radius: 6px;
}

.data-table tbody tr.row-sunday .picker-cell:hover {
  background-color: #fadcdc !important;
  box-shadow: inset 0 0 0 2px rgba(224, 86, 91, 0.4);
}

.picker-cell::after {
  content: "▾";
  font-size: 0.66rem;
  color: var(--primary);
  margin-inline-start: 0.3rem;
  opacity: 0;
  transition: opacity 0.15s var(--ease);
}

.picker-cell:hover::after {
  opacity: 1;
}

/* Narrow container stacked layout */
@container (width < 600px) {
  .data-table.stack-mobile,
  .data-table.stack-mobile thead,
  .data-table.stack-mobile tbody,
  .data-table.stack-mobile tr,
  .data-table.stack-mobile th,
  .data-table.stack-mobile td {
    display: block;
  }

  .data-table.stack-mobile thead {
    display: none;
  }

  .data-table.stack-mobile tbody {
    padding: 0.65rem;
  }

  .data-table.stack-mobile tr {
    margin-block-end: 0.7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
  }

  .data-table.stack-mobile tbody th {
    position: sticky;
    inset-block-start: 0;
    z-index: 2;
    background: var(--bg-muted);
    text-align: start;
    padding: 0.7rem 0.9rem;
  }

  .data-table.stack-mobile td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    text-align: end;
    white-space: normal;
    border-inline-end: none;
    padding: 0.6rem 0.9rem;
  }

  .data-table.stack-mobile td::before {
    text-align: start;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    flex-shrink: 0;
  }

  .data-table.stack-mobile td:nth-child(2)::before { content: var(--label-2, ""); }
  .data-table.stack-mobile td:nth-child(3)::before { content: var(--label-3, ""); }
  .data-table.stack-mobile td:nth-child(4)::before { content: var(--label-4, ""); }
  .data-table.stack-mobile td:nth-child(5)::before { content: var(--label-5, ""); }
  .data-table.stack-mobile td:nth-child(6)::before { content: var(--label-6, ""); }
  .data-table.stack-mobile td:nth-child(7)::before { content: var(--label-7, ""); }
  .data-table.stack-mobile td:nth-child(8)::before { content: var(--label-8, ""); }
  .data-table.stack-mobile td:nth-child(9)::before { content: var(--label-9, ""); }
  .data-table.stack-mobile td:nth-child(10)::before { content: var(--label-10, ""); }
  .data-table.stack-mobile td[data-label]::before { content: attr(data-label); }

  .picker-cell:empty::after,
  .picker-cell::after {
    opacity: 1;
  }
}

/* ==========================================================================
   PERSON PICKER POPOVER
   ========================================================================== */
.person-picker-popover {
  position: fixed;
  z-index: 200;
  width: 300px;
  max-width: calc(100vw - 24px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 0.95rem;
  display: none;
}

.person-picker-popover.open {
  display: block;
  animation: popIn 0.18s var(--ease);
}

@keyframes popIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-block-end: 0.6rem;
  margin-block-end: 0.5rem;
  border-block-end: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

.picker-group-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0.6rem 0 0.4rem;
  display: block;
}

.picker-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem;
}

.picker-option-btn {
  padding: 0.55rem 0.5rem;
  min-height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-muted);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: all 0.15s var(--ease);
  font-family: inherit;
}

.picker-option-btn:hover {
  border-color: rgba(91, 108, 240, 0.4);
  background: var(--primary-soft);
  color: var(--primary);
}

.picker-option-btn.selected {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(91, 108, 240, 0.28);
}

.picker-option-btn.external-opt {
  background: #fff8db;
  border-color: #f6dc84;
  color: #7a5a00;
}
.picker-option-btn.external-opt:hover {
  background: #fff1b8;
}

.picker-clear-btn {
  margin-block-start: 0.6rem;
  width: 100%;
  min-height: 36px;
  padding: 0.45rem;
  border-radius: var(--radius-sm);
  border: 1px dashed #f1b9bb;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-family: inherit;
}
.picker-clear-btn:hover {
  background: #fadadc;
}

.picker-custom-row {
  margin-block-start: 0.6rem;
  display: flex;
  gap: 0.4rem;
}

.picker-custom-row input {
  flex: 1;
  min-width: 0;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-family: inherit;
}

.picker-custom-row input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

/* ==========================================================================
   BADGES, PILLS & CARDS
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.4;
}

.badge-off     { background: var(--danger-soft);  color: var(--danger); }
.badge-rt      { background: var(--warning-soft); color: #b8730f; }
.badge-sua     { background: var(--purple-soft);  color: #7140e0; }
.badge-yillik  { background: var(--primary-soft); color: var(--primary); }
.badge-credit  { background: var(--success-soft); color: var(--success); }
.badge-debt    { background: var(--danger-soft);  color: var(--danger); }

.staff-pill {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.72rem;
  color: #ffffff;
}

.progress-track {
  width: 100%;
  height: 6px;
  background: var(--bg-muted);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-block-start: 0.35rem;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  transition: width 0.4s var(--ease);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}

.info-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.info-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-block-end: 0.75rem;
  margin-block-end: 0.6rem;
  border-block-end: 1px solid var(--border);
}

.info-card-title {
  font-weight: 700;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0;
  font-size: 0.83rem;
  color: var(--text-secondary);
  border-block-end: 1px solid #f3f5f9;
}

.stat-row:last-child {
  border-block-end: none;
}

/* ==========================================================================
   DIALOGS (per modern-web-guidance: dialog, light-dismiss-a-dialog,
   prevent-page-scroll-under-modal-dialog)
   ========================================================================== */
dialog {
  border: none;
  border-radius: var(--radius-lg);
  padding: 0;
  max-width: 620px;
  width: calc(100% - 1.5rem);
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
}

dialog[open] {
  animation: dialogIn 0.22s var(--ease);
}

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

dialog:modal {
  overscroll-behavior: contain;
}

dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
  background-color: rgba(30, 37, 55, 0.38);
  backdrop-filter: blur(4px);
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.15rem 1.35rem 0.85rem;
}

.dialog-header h3 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.dialog-close-btn {
  background: var(--bg-muted);
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}
.dialog-close-btn:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.dialog-body {
  padding: 0.5rem 1.35rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  padding: 0.95rem 1.35rem;
  border-block-start: 1px solid var(--border);
  background: #fafbfd;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.85rem;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.85rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-field label {
  font-size: 0.77rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-field input,
.form-field select,
.form-field textarea {
  padding: 0.6rem 0.8rem;
  min-height: 40px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-family: inherit;
  color: var(--text-primary);
  background: #ffffff;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.form-field input:hover,
.form-field select:hover,
.form-field textarea:hover {
  border-color: #c5cdda;
}

.form-field textarea {
  min-height: 120px;
  resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.form-field .hint {
  font-size: 0.72rem;
  color: var(--text-muted);
}

input[type="checkbox"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}

.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip-btn {
  border: 1px solid var(--border);
  background: var(--bg-muted);
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
  padding: 0.3rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s var(--ease);
}
.chip-btn:hover {
  background: var(--primary-soft);
  border-color: rgba(91, 108, 240, 0.4);
  color: var(--primary);
}

/* Toast */
.toast-container {
  position: fixed;
  inset-block-end: 1.5rem;
  inset-inline-end: 1.5rem;
  max-width: min(420px, calc(100vw - 2rem));
  background: #2b3248;
  color: #ffffff;
  padding: 0.8rem 1.15rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-weight: 500;
  font-size: 0.84rem;
  z-index: 300;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
}

.toast-container.show {
  opacity: 1;
  transform: translateY(0);
}

/* Scrollbars (soft) */
.table-wrapper::-webkit-scrollbar,
.sidebar-nav::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
.table-wrapper::-webkit-scrollbar-thumb,
.sidebar-nav::-webkit-scrollbar-thumb {
  background: #d7dce6;
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: content-box;
}
.table-wrapper::-webkit-scrollbar-thumb:hover {
  background-color: #c2c9d6;
}

/* ==========================================================================
   RESPONSIVE (PC, TABLET, PHONE)
   ========================================================================== */
@media (max-width: 1024px) {
  .app-sidebar {
    position: fixed;
    inset-block-start: 0;
    inset-inline-start: 0;
    transform: translateX(-100%);
    transition: transform 0.26s var(--ease);
    box-shadow: var(--shadow-lg);
  }

  .app-sidebar.open {
    transform: translateX(0);
  }

  .hamburger-btn,
  .sidebar-close-btn {
    display: inline-grid;
    place-items: center;
  }

  .mobile-tab-strip {
    display: flex;
  }

  .app-topbar {
    padding: 0.6rem 1.1rem;
  }

  .app-main {
    padding: 1.15rem 1.1rem 2.75rem;
  }

  .cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
}

@media (max-width: 820px) {
  .toolbar-card {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 640px) {
  .app-topbar {
    padding: 0.55rem 0.75rem;
    gap: 0.55rem;
  }

  .topbar-left {
    width: 100%;
  }

  .topbar-breadcrumb {
    display: none;
  }

  .mobile-brand-label {
    display: inline-block;
  }

  .month-selector-bar {
    width: 100%;
    justify-content: space-between;
  }

  .month-selector-bar label {
    display: none;
  }

  .month-selector-bar select {
    flex: 1;
    min-width: 110px;
    min-height: 36px;
  }

  .app-main {
    padding: 0.85rem 0.7rem 2.5rem;
  }

  .toolbar-card {
    padding: 1rem;
    border-radius: var(--radius-md);
  }

  .toolbar-title h2 {
    font-size: 1.02rem;
  }

  .toolbar-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.45rem;
  }

  .toolbar-actions .btn {
    width: 100%;
    font-size: 0.77rem;
    padding: 0.5rem 0.55rem;
    min-height: 42px;
  }

  .table-wrapper {
    max-block-size: none;
    border-radius: var(--radius-md);
  }

  #attendance-table th,
  #attendance-table td {
    padding: 0.4rem 0.5rem;
    font-size: 0.75rem;
  }

  #attendance-table tbody th {
    min-width: 100px;
  }

  /* Bottom sheet picker on phone */
  .person-picker-popover {
    inset-inline: 0.6rem !important;
    inset-block-end: 0.6rem !important;
    inset-block-start: auto !important;
    left: 0.6rem !important;
    top: auto !important;
    width: auto;
    max-width: none;
    max-height: 75dvh;
    overflow-y: auto;
    border-radius: var(--radius-lg);
  }

  .person-picker-popover.open {
    animation: sheetUp 0.24s var(--ease);
  }

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

  .picker-option-btn {
    min-height: 44px;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .info-card:hover {
    transform: none;
  }

  .form-grid,
  .form-grid-3 {
    grid-template-columns: 1fr;
  }

  dialog {
    width: calc(100% - 1rem);
    max-height: 92dvh;
    overflow-y: auto;
  }

  .dialog-footer {
    position: sticky;
    inset-block-end: 0;
    flex-wrap: wrap;
  }

  .dialog-footer .btn {
    flex: 1 1 auto;
    min-height: 44px;
  }

  .toast-container {
    inset-inline: 0.75rem;
    inset-block-end: 0.75rem;
    max-width: none;
  }
}

@media (max-width: 400px) {
  .toolbar-actions {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   INNER PAGE COMPONENTS (UX REFINEMENTS)
   ========================================================================== */
.text-muted   { color: var(--text-muted); }
.tone-success { color: var(--success); }
.tone-danger  { color: var(--danger); }
.tone-purple  { color: #7140e0; }

.cell-wrap  { white-space: normal !important; }
.cell-start { text-align: start !important; }

.sub-note {
  display: block;
  margin-block-start: 0.2rem;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: normal;
}

/* Person cell with initials avatar */
.data-table tbody th:has(.person-cell) {
  text-align: start;
  min-width: 210px;
}

.person-cell {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.avatar {
  --c: var(--primary);
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 14%, #ffffff);
  border: 1px solid color-mix(in srgb, var(--c) 22%, #ffffff);
}

.avatar-sm {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  font-size: 0.64rem;
}

.person-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
}

.person-meta strong {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.person-meta small {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* Metrics */
.metric {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.metric-sm {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.metric.tone-success,
.metric-sm.tone-success { color: var(--success); }
.metric-sm.tone-danger  { color: var(--danger); }
.metric-sm.text-muted   { color: var(--text-muted); font-weight: 600; }

.metric-unit {
  margin-inline-start: 0.2rem;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* Additional badges */
.badge-neutral { background: #eef1f6; color: var(--text-secondary); }
.badge-muted   { background: transparent; color: var(--text-muted); border: 1px dashed var(--border-strong); }
.badge-mr      { background: #fff4dc; color: #a2690c; }
.badge-xr      { background: #e8f0ff; color: #3a62c4; }
.badge-lg      { padding: 0.28rem 0.7rem; font-size: 0.76rem; font-weight: 700; }

.mini-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  margin-inline-start: 0.3rem;
  padding: 0.08rem 0.4rem;
  border-radius: var(--radius-pill);
  background: var(--warning-soft);
  color: #b8730f;
  font-size: 0.66rem;
  font-weight: 700;
  vertical-align: middle;
}

.code-pill {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  padding: 0.16rem 0.5rem;
  border-radius: 7px;
  background: var(--bg-muted);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.status-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent);
}

.status-dot.is-on  { color: var(--success); }
.status-dot.is-off { color: #a3abbd; }

.row-inactive th,
.row-inactive td {
  opacity: 0.62;
}

.row-inactive:hover th,
.row-inactive:hover td {
  opacity: 1;
}

/* Date chips (external shifts) */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.date-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0.3rem 0.55rem;
  border-radius: 9px;
  background: #fffaf0;
  border: 1px solid #f6e3b4;
  line-height: 1.2;
}

.date-chip strong {
  font-size: 0.76rem;
  font-weight: 700;
  color: #7a5a00;
}

.date-chip small {
  font-size: 0.66rem;
  color: #a08a52;
}

.date-range {
  font-weight: 600;
  color: var(--text-primary);
}

/* Progress cells */
.progress-cell {
  min-width: 150px;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.progress-head small {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.progress-fill.tone-primary { background: linear-gradient(90deg, #8a97f6, var(--primary)); }
.progress-fill.tone-purple  { background: linear-gradient(90deg, #b9a1fa, var(--purple)); }
.progress-fill.is-high      { background: linear-gradient(90deg, #f3a2a5, var(--danger)); }

/* Schedule day cell */
.day-cell {
  font-weight: 700;
  color: var(--text-secondary);
  text-align: start !important;
  padding-inline-start: 0.9rem !important;
}

/* Empty state */
.empty-row td {
  padding: 0 !important;
  border: none !important;
}

.empty-state {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 500;
}

/* ---------- Attendance (Puantaj) matrix ---------- */
#attendance-table .group-end {
  border-inline-end: 2px solid #e1e6f0 !important;
}

#attendance-table .att-date-head {
  min-width: 110px;
}

#attendance-table .att-staff-head {
  --c: var(--primary);
  background: color-mix(in srgb, var(--c) 9%, #ffffff) !important;
  color: var(--text-primary) !important;
  border-block-start: 3px solid var(--c);
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
}

#attendance-table .att-staff-head .avatar {
  margin-inline-end: 0.35rem;
  vertical-align: middle;
}

#attendance-table tbody th.att-date {
  text-align: start;
  min-width: 110px;
}

#attendance-table .att-date strong {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

#attendance-table .att-date small {
  display: block;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-muted);
}

#attendance-table .att-time {
  font-weight: 600;
  color: var(--text-primary);
}

#attendance-table .att-time.is-empty,
#attendance-table .att-muted {
  color: #b2b9c8;
  font-weight: 500;
}

#attendance-table .att-status-cell {
  background: #fbfcfe;
}

#attendance-table .att-net {
  font-weight: 800;
  min-width: 72px;
}

#attendance-table .att-net.is-ok   { color: var(--text-primary); }
#attendance-table .att-net.is-high { color: var(--success); background: #f3fbf7; }
#attendance-table .att-net.is-low  { color: var(--danger); background: #fef6f6; }
#attendance-table .att-net.is-zero,
#attendance-table .att-net.is-empty { color: #c2c8d4; }

#attendance-table .picker-cell::after {
  display: none;
}

#attendance-table .week-total strong {
  color: var(--text-primary);
  margin-inline-start: 0.25rem;
}

/* Legend */
.table-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-block-start: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.table-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.table-legend i {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  display: inline-block;
}

@media (max-width: 640px) {
  .data-table tbody th:has(.person-cell) {
    min-width: 0;
  }

  .progress-cell {
    min-width: 0;
  }

  .data-table.stack-mobile td .sub-note {
    text-align: end;
  }

  .data-table.stack-mobile td.progress-cell {
    flex-direction: column;
    align-items: stretch;
  }

  .data-table.stack-mobile td.progress-cell::before {
    margin-block-end: 0.2rem;
  }

  .chip-row {
    justify-content: flex-end;
  }
}


/* ==========================================================================
   PANEL UX ENHANCEMENTS: LOADING BAR, FILTER PILLS, SEARCH, FOCUS HIGHLIGHT
   ========================================================================== */
.app-loading-bar {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  height: 3px;
  z-index: 999;
  background: linear-gradient(90deg, var(--primary), var(--purple), var(--primary));
  background-size: 200% 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s var(--ease);
}

.app-loading-bar.active {
  opacity: 1;
  animation: loadingSlide 1.1s linear infinite;
}

@keyframes loadingSlide {
  from { background-position: 100% 0; }
  to   { background-position: -100% 0; }
}

.ux-filter-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.65rem 1rem;
  margin-block-end: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.9rem;
  box-shadow: var(--shadow-xs);
}

.ux-filter-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.ux-filter-group {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.ux-filter-select {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-muted);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.ux-filter-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.ux-search-box {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.7rem;
  min-width: 220px;
  flex: 1 1 220px;
  max-width: 340px;
  color: var(--text-muted);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), background-color 0.15s var(--ease);
}

.ux-search-box:focus-within {
  background: var(--bg-card);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
  color: var(--primary);
}

.ux-search-box input {
  border: none;
  background: transparent;
  width: 100%;
  font-size: 0.82rem;
  font-family: inherit;
  color: var(--text-primary);
  outline: none;
}

.ux-filter-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.filter-pill {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.34rem 0.75rem;
  min-height: 32px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg-muted);
  color: var(--text-secondary);
  font-size: 0.77rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.filter-pill:hover {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: rgba(91, 108, 240, 0.35);
}

.filter-pill.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 3px 10px rgba(91, 108, 240, 0.28);
}

.pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.filter-pill.active .pill-dot {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7);
}

/* Schedule cell focus highlight */
.cell-focus-match {
  background-color: var(--primary-soft) !important;
  color: var(--primary) !important;
  font-weight: 800 !important;
  box-shadow: inset 0 0 0 2px var(--primary);
}

.cell-focus-dim {
  opacity: 0.32;
}

.picker-cell.is-editing {
  background-color: var(--primary-soft) !important;
  box-shadow: inset 0 0 0 2px var(--primary) !important;
}

@media (max-width: 640px) {
  .ux-filter-bar {
    padding: 0.65rem 0.75rem;
  }

  .ux-search-box {
    max-width: none;
    width: 100%;
  }

  .ux-filter-pills {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .ux-filter-pills::-webkit-scrollbar {
    display: none;
  }

  .filter-pill {
    flex-shrink: 0;
    min-height: 36px;
  }
}


/* ==========================================================================
   LOGIN SCREEN
   ========================================================================== */
.login-body {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: radial-gradient(circle at top left, #eef0fe 0%, var(--bg-body) 55%, #f0f4ff 100%);
}

.login-wrapper {
  width: 100%;
  max-width: 400px;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow-lg);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-block-end: 1.5rem;
}

.login-brand h1 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.login-brand p {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0 0.8rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-muted);
  color: var(--text-muted);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), background-color 0.15s var(--ease);
}

.login-input-wrap:focus-within {
  background: var(--bg-card);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
  color: var(--primary);
}

.login-input-wrap input {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0.65rem 0 !important;
  width: 100%;
  min-height: 44px;
}

.login-error {
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.8rem;
  font-weight: 600;
}

.login-submit-btn {
  width: 100%;
  min-height: 44px;
  font-size: 0.9rem;
}


/* ==========================================================================
   SCHEDULE GENERATOR MODULE (/nobet-olusturucu)
   ========================================================================== */
.gen-rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1rem;
  margin-block-end: 1.25rem;
}

.gen-rule-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.05rem 1.15rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.gen-rule-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding-block-end: 0.75rem;
  border-block-end: 1px solid var(--border);
}

.gen-enable-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
}

.gen-rule-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.gen-weekday-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.gen-wk-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.32rem 0.65rem;
  border-radius: var(--radius-pill);
  background: var(--bg-muted);
  border: 1px solid var(--border);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
}

.gen-wk-pill:has(input:checked) {
  background: var(--primary-soft);
  border-color: rgba(91, 108, 240, 0.45);
  color: var(--primary);
}

.gen-insights-card {
  background: linear-gradient(135deg, #f3f5fe 0%, #ffffff 100%);
  border: 1px solid #dce1fb;
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin-block-end: 0.9rem;
}

.gen-insights-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--primary);
  margin-block-end: 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.gen-insights-card ul {
  margin: 0;
  padding-inline-start: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.83rem;
  color: var(--text-secondary);
}

.gen-stats-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-block-end: 0.9rem;
}

.gen-stat-chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.55rem 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: var(--shadow-xs);
}

.gen-stat-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.gen-stat-info strong {
  font-size: 0.82rem;
  color: var(--text-primary);
}

.gen-stat-info small {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.gen-warnings-box {
  background: var(--warning-soft);
  border: 1px solid #f4d28b;
  color: #8a5a0a;
  border-radius: var(--radius-md);
  padding: 0.8rem 1.1rem;
  font-size: 0.82rem;
}

.gen-warnings-box ul {
  margin: 0.35rem 0 0;
  padding-inline-start: 1.15rem;
}

.gen-sync-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}

@media (max-width: 640px) {
  .gen-rules-grid {
    grid-template-columns: 1fr;
  }
}
