/* MijnSupportDesk central design system */

:root {
  --color-primary: #6906cd;
  --color-primary-strong: #5200a8;
  --color-primary-soft: #f2e8ff;
  --color-secondary: #ff6600;
  --color-success: #12805c;
  --color-success-soft: #e8f8f0;
  --color-warning: #ad6b12;
  --color-warning-soft: #fff6df;
  --color-danger: #c93d3d;
  --color-danger-soft: #fff0ef;
  --color-info: #36506f;
  --color-info-soft: #edf4fb;

  --bg-page: #f5f3f8;
  --bg-page-top: #ffffff;
  --bg-surface: #ffffff;
  --bg-surface-2: #f8f5fb;
  --bg-surface-3: #fff3eb;
  --bg-sidebar: #ffffff;

  --text-primary: #172033;
  --text-secondary: #41516a;
  --text-muted: #718096;
  --text-inverse: #ffffff;

  --border-subtle: #e7edf4;
  --border-default: #d8e2ec;
  --border-strong: #c6d3e2;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 12px;

  --shadow-subtle: 0 1px 2px rgba(31, 41, 55, 0.05);
  --shadow-medium: 0 10px 30px rgba(31, 41, 55, 0.08);
  --shadow-elevated: 0 28px 80px rgba(31, 41, 55, 0.22);

  --sidebar-width: 260px;
  --content-max: 1440px;
  --transition: 160ms ease;
}

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

html {
  min-height: 100%;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text-primary);
  background:
    radial-gradient(circle at 0 0, rgba(105, 6, 205, 0.08), transparent 34rem),
    linear-gradient(180deg, var(--bg-page-top), var(--bg-page));
  line-height: 1.5;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid rgba(105, 6, 205, 0.22);
  outline-offset: 2px;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
  text-decoration: none;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-subtle);
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0;
  background: #edf4fb;
  white-space: nowrap;
}

td {
  color: var(--text-secondary);
  font-size: 14px;
}

tbody tr:nth-child(even):not(.checklist-row) {
  background: rgba(238, 245, 255, 0.5);
}

tbody tr:hover:not(.checklist-row) {
  background: #eef5ff;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1 {
  font-size: 32px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: 0;
}

h2 {
  font-size: 24px;
  line-height: 1.2;
  font-weight: 750;
  letter-spacing: 0;
}

h3 {
  font-size: 18px;
  line-height: 1.3;
  font-weight: 750;
  letter-spacing: 0;
}

.hidden {
  display: none !important;
}

.app-layout {
  min-height: 100vh;
}

.main-content {
  min-height: 100vh;
  width: min(calc(100% - var(--sidebar-width)), var(--content-max));
  margin-left: var(--sidebar-width);
  padding: var(--space-8) 36px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  padding: 22px var(--space-6);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(250, 245, 255, 0.95));
  box-shadow: var(--shadow-medium);
}

.page-header p {
  margin-top: var(--space-1);
  color: var(--text-muted);
  font-size: 14px;
}

.page-header-row {
  flex-wrap: wrap;
}

.header-actions,
.inline-form-row,
.save-row,
.row-actions,
.td-actions,
.announcement-topline,
.announcement-meta,
.client-cell,
.profile-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  height: 100vh;
  overflow: auto;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-default);
  box-shadow: 8px 0 28px rgba(36, 52, 71, 0.06);
}

.sidebar-logo {
  padding: var(--space-6) 20px var(--space-4);
  border-bottom: 1px solid var(--border-default);
}

.logo-mark {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon,
.logo-icon-lg {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--text-inverse);
  font-weight: 850;
  background: linear-gradient(135deg, var(--color-primary), #4778ef);
  border-radius: var(--radius-sm);
}

.logo-icon {
  width: 36px;
  height: 36px;
  font-size: 15px;
}

.brand-logo-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.logo-icon-lg {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--space-3);
  font-size: 20px;
  box-shadow: 0 10px 24px rgba(49, 87, 213, 0.22);
}

.logo-text {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}

.logo-sub {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-4) var(--space-3);
}

.nav-section-label {
  padding: var(--space-2) var(--space-2) var(--space-1);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.nav-section-spaced {
  margin-top: var(--space-4);
}

.nav-item,
.sidebar-bell {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  margin-bottom: var(--space-1);
  padding: 10px 12px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 650;
  text-align: left;
  white-space: nowrap;
  background: transparent;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.nav-item:hover,
.sidebar-bell:hover {
  color: var(--text-primary);
  background: #fff3eb;
  border-left-color: rgba(255, 102, 0, 0.36);
}

.nav-item.active {
  color: var(--color-primary);
  background: var(--color-primary-soft);
  border-left-color: var(--color-primary);
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 22px;
  min-width: 22px;
  height: 22px;
  color: inherit;
  font-size: 12px;
  font-weight: 850;
  border-radius: 6px;
  background: rgba(105, 6, 205, 0.08);
}

.bell-badge {
  position: absolute;
  top: 6px;
  left: 27px;
  display: grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  color: var(--text-inverse);
  font-size: 9px;
  font-weight: 850;
  line-height: 1;
  background: var(--color-danger);
  border: 2px solid var(--bg-sidebar);
  border-radius: 999px;
}

.profile-card {
  margin: var(--space-3);
  padding: var(--space-3);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-subtle);
}

.profile-card-inner {
  display: grid;
  gap: var(--space-3);
}

.profile-main {
  flex-wrap: nowrap;
}

.profile-avatar-wrap {
  position: relative;
  flex: 0 0 auto;
}

.profile-avatar,
.user-avatar-sm,
.client-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--text-inverse);
  font-weight: 850;
  border-radius: 999px;
}

.profile-avatar {
  width: 44px;
  height: 44px;
  font-size: 16px;
}

.user-avatar-sm,
.client-avatar {
  width: 38px;
  height: 38px;
  font-size: 13px;
}

.role-agent,
.profile-avatar.role-agent {
  background: var(--color-primary);
}

.role-admin,
.profile-avatar.role-admin {
  background: var(--color-secondary);
}

.profile-online-dot {
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 11px;
  height: 11px;
  background: var(--color-success);
  border: 2px solid var(--bg-surface);
  border-radius: 999px;
}

.profile-info,
.row-main,
.request-main,
.announcement-main {
  min-width: 0;
}

.profile-name,
.profile-email,
.row-title,
.row-subtitle {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-name,
.row-title,
.cell-strong,
.request-title {
  color: var(--text-primary);
  font-weight: 750;
}

.profile-name {
  max-width: 150px;
  font-size: 13px;
}

.profile-email,
.row-subtitle,
.cell-muted,
.request-meta,
.request-note,
.save-status {
  color: var(--text-muted);
  font-size: 12px;
}

.profile-email {
  max-width: 150px;
}

.profile-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.profile-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: var(--space-2);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 750;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
}

.profile-action-btn:hover {
  color: var(--text-primary);
  background: var(--bg-surface-3);
}

.danger-action {
  color: var(--color-danger);
}

.card,
.stat-card,
.day-card,
.shift-card,
.modal,
.login-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-medium);
}

.card {
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 14px 36px rgba(31, 41, 55, 0.1);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 18px var(--space-6);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 245, 251, 0.96));
  border-bottom: 1px solid var(--border-default);
}

.card-title {
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 800;
}

.card-body {
  padding: var(--space-6);
  color: var(--text-secondary);
}

.compact-card {
  padding: var(--space-4) var(--space-6);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.stat-card {
  position: relative;
  overflow: hidden;
  padding: var(--space-6);
  background: linear-gradient(180deg, var(--bg-surface), var(--bg-surface-2));
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
}

.stat-label {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.stat-value {
  margin-top: var(--space-2);
  color: var(--text-primary);
  font-size: 30px;
  font-weight: 850;
  line-height: 1;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(340px, 0.88fr);
  gap: var(--space-6);
  align-items: start;
  margin-bottom: var(--space-6);
}

.updates-card {
  grid-column: 1 / -1;
}

.schema-warning-banner {
  margin: 0 0 var(--space-6);
  padding: var(--space-3) var(--space-4);
  color: var(--color-warning);
  font-size: 13px;
  font-weight: 750;
  background: var(--color-warning-soft);
  border: 1px solid rgba(173, 107, 18, 0.24);
  border-radius: var(--radius-sm);
}

.action-center-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
}

.action-tile {
  display: grid;
  min-width: 0;
  gap: var(--space-1);
  padding: var(--space-4);
  color: var(--text-secondary);
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.action-tile:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-subtle);
  transform: translateY(-1px);
}

.action-tile span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}

.action-tile strong {
  color: var(--text-primary);
  font-size: 28px;
  line-height: 1;
}

.action-tile small {
  color: var(--text-secondary);
  font-size: 12px;
}

.action-warning {
  background: var(--color-warning-soft);
  border-color: rgba(173, 107, 18, 0.22);
}

.action-danger {
  background: var(--color-danger-soft);
  border-color: rgba(201, 61, 61, 0.22);
}

.next-shift-card {
  display: grid;
  gap: var(--space-4);
}

.next-shift-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

.next-shift-main h3 {
  margin-top: var(--space-1);
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.insight-metric {
  min-width: 0;
  padding: var(--space-4);
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.insight-metric span,
.recommendation-item span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}

.insight-metric strong {
  display: block;
  margin-top: var(--space-1);
  color: var(--text-primary);
  font-size: 24px;
  line-height: 1.1;
}

.insight-metric small {
  display: block;
  margin-top: var(--space-2);
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.35;
}

.insight-success {
  background: var(--color-success-soft);
  border-color: rgba(18, 128, 92, 0.22);
}

.insight-warning {
  background: var(--color-warning-soft);
  border-color: rgba(173, 107, 18, 0.24);
}

.insight-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.85fr);
  gap: var(--space-6);
  align-items: start;
}

.insight-split h4 {
  margin-bottom: var(--space-3);
}

.recommendation-list {
  display: grid;
  gap: var(--space-2);
}

.recommendation-item {
  padding: var(--space-3);
  background: #fbfcff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.recommendation-item p {
  margin-top: var(--space-1);
  color: var(--text-secondary);
  font-size: 13px;
}

.tabs {
  display: inline-flex;
  max-width: 100%;
  gap: var(--space-1);
  margin-bottom: var(--space-6);
  padding: var(--space-1);
  overflow-x: auto;
  background: rgba(251, 252, 247, 0.8);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-subtle);
}

.tab-btn {
  min-height: 38px;
  padding: 9px 14px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}

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

.tab-btn.active {
  color: var(--text-inverse);
  background: var(--color-primary);
}

.tab-panel {
  display: none;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 9px 16px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  user-select: none;
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    background var(--transition),
    border-color var(--transition);
}

.btn:focus-visible,
.tab-btn:focus-visible,
.week-nav-btn:focus-visible,
.modal-close:focus-visible,
.notif-delete:focus-visible,
.form-control:focus-visible {
  outline: 3px solid rgba(105, 6, 205, 0.24);
  outline-offset: 2px;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-subtle);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.55;
}

.btn-primary {
  color: var(--text-inverse);
  background: linear-gradient(135deg, var(--color-primary), #8127de);
  border-color: var(--color-primary);
  box-shadow: 0 8px 18px rgba(105, 6, 205, 0.22);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--color-primary-strong), var(--color-primary));
}

.btn-secondary,
.btn-ghost {
  color: var(--text-primary);
  background: #fff3eb;
  border-color: #ffd2b5;
}

.btn-secondary:hover:not(:disabled),
.btn-ghost:hover:not(:disabled) {
  background: #ffe8d8;
  border-color: #ffc093;
}

.btn-success {
  color: #087357;
  background: var(--color-success-soft);
  border-color: #b9e6d4;
}

.btn-danger {
  color: #b3262e;
  background: var(--color-danger-soft);
  border-color: #f5c5c4;
}

.btn-warning {
  color: #8a5000;
  background: var(--color-warning-soft);
  border-color: #f4d58c;
}

.btn-sm {
  min-height: 32px;
  padding: 7px 12px;
  font-size: 12px;
}

.btn-xs {
  min-height: 26px;
  padding: 4px 8px;
  font-size: 11px;
}

.btn-lg {
  min-height: 46px;
  padding: 12px 20px;
  font-size: 15px;
}

.btn-full {
  width: 100%;
}

.btn-icon {
  width: 34px;
  min-width: 34px;
  padding: 0;
}

.form-group {
  margin-bottom: var(--space-4);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.form-label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 750;
}

.inline-label {
  margin: 0;
  white-space: nowrap;
}

.form-control {
  width: 100%;
  min-height: 42px;
  padding: 10px 13px;
  color: var(--text-primary);
  font-size: 14px;
  background: #f8fbfd;
  border: 1px solid #cfdbea;
  border-radius: var(--radius-sm);
  outline: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.form-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(49, 87, 213, 0.14);
}

.form-control::placeholder {
  color: #93a1b2;
}

.form-control:disabled {
  color: var(--text-muted);
  background: #edf2f7;
}

textarea.form-control {
  min-height: 104px;
  resize: vertical;
}

select.form-control {
  padding-right: 36px;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 18px,
    calc(100% - 13px) 18px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

input[type="date"],
input[type="time"] {
  color-scheme: light;
}

.compact-select {
  width: auto;
  min-width: 180px;
  min-height: 34px;
  padding-top: 7px;
  padding-bottom: 7px;
  font-size: 13px;
}

.narrow-select {
  max-width: 280px;
}

.color-input {
  height: 42px;
  padding: 4px;
}

.password-wrap {
  position: relative;
}

.password-input {
  padding-right: 74px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  padding: 5px 7px;
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 800;
  background: transparent;
  border: 0;
  transform: translateY(-50%);
}

.table-wrap {
  max-width: 100%;
  overflow: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: inset -16px 0 18px -22px rgba(23, 32, 51, 0.35);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.table-wrap table {
  min-width: 680px;
}

.badge,
.role-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  min-height: 24px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: 999px;
}

.role-badge.role-admin {
  color: #087357;
  background: var(--color-success-soft);
  border-color: #b9e6d4;
}

.role-badge.role-agent {
  color: var(--color-primary);
  background: var(--color-primary-soft);
  border-color: #ddc3ff;
}

.badge-pending {
  color: #9a5b00;
  background: var(--color-warning-soft);
  border-color: #f4d58c;
}

.badge-warning {
  color: #8a5000;
  background: var(--color-warning-soft);
  border-color: #f4d58c;
}

.badge-confirmed,
.badge-approved {
  color: #087357;
  background: var(--color-success-soft);
  border-color: #b9e6d4;
}

.badge-completed {
  color: var(--color-primary);
  background: var(--color-primary-soft);
  border-color: #ddc3ff;
}

.badge-rejected {
  color: #b3262e;
  background: var(--color-danger-soft);
  border-color: #f5c5c4;
}

.badge-info {
  color: var(--color-info);
  background: var(--color-info-soft);
  border-color: var(--border-default);
}

.client-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  border-radius: 999px;
  box-shadow: 0 0 0 3px rgba(49, 87, 213, 0.1);
}

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  padding: var(--space-8);
  color: var(--text-muted);
}

#page-loader.loading-overlay {
  min-height: 100vh;
}

.spinner,
.spinner-lg {
  display: inline-block;
  flex: 0 0 auto;
  border-style: solid;
  border-color: rgba(105, 6, 205, 0.18);
  border-top-color: var(--color-primary);
  border-radius: 999px;
  animation: spin 800ms linear infinite;
}

.spinner {
  width: 14px;
  height: 14px;
  border-width: 2px;
}

.spinner-lg {
  width: 38px;
  height: 38px;
  border-width: 3px;
}

.loading-label {
  margin-left: 10px;
  color: var(--text-muted);
  font-size: 13px;
}

.empty-state {
  display: grid;
  place-items: center;
  gap: var(--space-2);
  min-height: 150px;
  padding: var(--space-8);
  text-align: center;
  background: linear-gradient(180deg, rgba(248, 251, 253, 0.74), rgba(255, 255, 255, 0.88));
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-md);
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--color-primary);
  font-weight: 850;
  background: var(--bg-surface);
  border-radius: 999px;
  box-shadow: var(--shadow-subtle);
}

.empty-state h3 {
  color: var(--text-primary);
  font-size: 17px;
}

.empty-state p {
  max-width: 42rem;
  color: var(--text-muted);
  font-size: 14px;
}

.error-state .empty-icon,
.error-state h3 {
  color: var(--color-danger);
}

.error-state .empty-icon {
  background: var(--color-danger-soft);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background: rgba(30, 41, 59, 0.38);
  backdrop-filter: blur(6px);
}

.modal-overlay.active {
  display: flex;
}

body.modal-open {
  overflow: hidden;
}

.modal {
  width: min(560px, 100%);
  max-height: min(86vh, 760px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-sm {
  width: min(420px, 100%);
}

.modal-header,
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  background: var(--bg-surface);
}

.modal-header {
  border-bottom: 1px solid var(--border-default);
}

.modal-title {
  color: var(--text-primary);
}

.modal-body {
  padding: var(--space-6);
  overflow: auto;
}

.modal-footer {
  justify-content: flex-end;
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-default);
}

.modal-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--text-muted);
  font-size: 24px;
  line-height: 1;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.form-control:focus {
  background: var(--bg-surface);
  border-color: rgba(105, 6, 205, 0.45);
  box-shadow: 0 0 0 4px rgba(105, 6, 205, 0.08);
}

.modal-close:hover {
  color: var(--text-primary);
  background: var(--bg-surface-3);
}

.confirm-message {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

.notif-dropdown {
  position: fixed;
  left: 18px;
  bottom: 112px;
  z-index: 220;
  display: none;
  width: min(340px, calc(100vw - 32px));
  max-height: min(460px, calc(100vh - 160px));
  overflow: hidden;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-elevated);
}

.notif-dropdown.open {
  display: block;
}

.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-default);
}

.notif-header h4 {
  margin: 0;
  color: var(--text-primary);
  font-size: 15px;
}

.notif-list {
  max-height: 380px;
  overflow: auto;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  color: inherit;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border-subtle);
}

.notif-open {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  min-width: 0;
  flex: 1;
  padding: 0;
  color: inherit;
  text-align: left;
  background: transparent;
  border: 0;
}

.notif-delete {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  color: var(--text-muted);
  background: var(--bg-surface-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
}

.notif-item:hover {
  background: var(--bg-surface-3);
}

.notif-item.unread {
  background: rgba(232, 239, 255, 0.65);
}

.notif-dot,
.notif-spacer {
  width: 8px;
  min-width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 999px;
}

.notif-dot {
  background: var(--color-primary);
}

.notif-item-msg,
.notif-item-time {
  display: block;
}

.notif-item-msg {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.4;
}

.notif-item-time,
.notif-empty {
  color: var(--text-muted);
  font-size: 12px;
}

.notif-empty {
  padding: var(--space-6);
  text-align: center;
}

.notif-center-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.notif-center-toolbar .form-control {
  min-width: 0;
}

.notif-center-list {
  max-height: none;
}

#toast-container {
  position: fixed;
  right: var(--space-6);
  bottom: var(--space-6);
  z-index: 900;
  display: grid;
  gap: var(--space-3);
  width: min(380px, calc(100vw - 32px));
}

.toast {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  overflow: hidden;
  padding: var(--space-4);
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-elevated);
  animation: slideInRight 220ms ease both;
}

.toast.removing {
  animation: slideOutRight 180ms ease both;
}

.toast-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  color: var(--text-inverse);
  font-size: 12px;
  font-weight: 850;
  background: var(--color-primary);
  border-radius: 999px;
}

.toast.error .toast-icon {
  background: var(--color-danger);
}

.toast.warning .toast-icon {
  background: var(--color-warning);
}

.toast-msg {
  color: var(--text-secondary);
  font-size: 14px;
}

.week-nav-mount,
.agent-selector-wrap,
.admin-planning-tools {
  margin-bottom: var(--space-6);
}

.week-nav {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  gap: var(--space-2);
  padding: var(--space-2);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-subtle);
}

.week-nav-btn {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  padding: 0 var(--space-2);
  color: var(--text-primary);
  font-weight: 850;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
}

.week-nav-btn:hover {
  background: var(--bg-surface-3);
}

.week-label {
  padding: 0 var(--space-2);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.week-today-btn {
  width: auto;
  font-size: 11px;
}

.availability-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(160px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.day-card {
  display: grid;
  gap: var(--space-3);
  min-height: 220px;
  padding: 20px;
  background: linear-gradient(180deg, var(--bg-surface), var(--bg-surface-2));
}

.day-card.unavailable {
  background: #f4f0f0;
}

.day-name {
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 850;
}

.day-date {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.day-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 750;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  flex: 0 0 auto;
}

.toggle-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-track {
  position: absolute;
  inset: 0;
  background: #c8d6e5;
  border-radius: 999px;
  transition: background var(--transition);
}

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 999px;
  box-shadow: var(--shadow-subtle);
  transition: transform var(--transition);
}

.toggle-switch input:checked + .toggle-track {
  background: var(--color-danger);
}

.toggle-switch input:checked + .toggle-track + .toggle-thumb {
  transform: translateX(16px);
}

.time-inputs {
  display: grid;
  gap: var(--space-2);
}

.time-inputs.is-disabled {
  opacity: 0.35;
  pointer-events: none;
}

.compact-field {
  margin-bottom: 0;
}

.compact-label {
  font-size: 11px;
}

.compact-time {
  min-height: 36px;
  padding: 7px 10px;
  font-size: 13px;
}

.admin-overview {
  margin-top: var(--space-8);
}

.availability-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.availability-summary div {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-3);
  background: var(--bg-surface-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
}

.availability-summary strong {
  color: var(--text-primary);
  font-size: 22px;
  line-height: 1;
}

.availability-summary span {
  color: var(--text-muted);
  font-size: 12px;
}

.availability-archive-list {
  display: grid;
  gap: var(--space-5);
}

.availability-archive-week h4 {
  margin-bottom: var(--space-3);
  color: var(--text-primary);
  font-size: 15px;
}

.action-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.action-panel-sub {
  margin-top: var(--space-1);
  color: var(--text-muted);
  font-size: 13px;
}

.quick-plan-context,
.detail-list {
  display: grid;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.detail-pill {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 10px 12px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover {
  background: #fff3eb !important;
}

.side-panel-overlay {
  position: fixed;
  inset: 0;
  z-index: 520;
  display: flex;
  justify-content: flex-end;
  background: rgba(24, 20, 32, 0.28);
  backdrop-filter: blur(4px);
}

.side-panel {
  width: min(520px, 100%);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-default);
  box-shadow: var(--shadow-elevated);
}

.side-panel-header,
.side-panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border-default);
}

.side-panel-body {
  flex: 1;
  padding: var(--space-6);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.side-panel-footer {
  justify-content: flex-end;
  position: sticky;
  bottom: 0;
  z-index: 1;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-default);
  border-bottom: 0;
}

.side-panel-section {
  margin-bottom: var(--space-6);
}

.side-panel-section h4 {
  margin-bottom: var(--space-3);
}

.cell-center {
  text-align: center;
}

.cell-success {
  color: var(--color-success);
  font-size: 12px;
}

.quick-plan-cell {
  min-width: 112px;
}

.quick-plan-cell span {
  display: block;
  margin-bottom: 6px;
}

.checklist-row td {
  background: var(--bg-surface-2);
}

.checklist-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-2);
  padding: var(--space-2) 0;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 9px 10px;
  color: var(--text-secondary);
  font-size: 13px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 10px;
}

.checklist-item.is-complete {
  color: var(--color-success);
}

.checklist-empty {
  padding: var(--space-2) 0;
  color: var(--text-muted);
  font-size: 13px;
}

.shift-card {
  display: grid;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  padding: var(--space-4);
}

.shift-date,
.shift-time {
  color: var(--text-primary);
  font-weight: 800;
}

.shift-client,
.shift-meta {
  color: var(--text-secondary);
  font-size: 13px;
}

.rule-list {
  display: grid;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

.rule-list div {
  padding-left: var(--space-3);
  border-left: 3px solid var(--color-primary-soft);
}

.total-badge,
.total-line {
  color: var(--color-primary);
  font-size: 13px;
  font-weight: 850;
}

.total-line {
  margin-bottom: var(--space-3);
}

.request-item {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border-default);
}

.admin-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-default);
}

.admin-row:last-child,
.request-item:last-child,
.notif-item:last-child {
  border-bottom: 0;
}

.client-avatar {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
}

.announcement-list {
  display: grid;
  gap: var(--space-3);
}

.announcement-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4);
  background: linear-gradient(180deg, var(--bg-surface), var(--bg-surface-2));
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
}

.announcement-main {
  display: grid;
  gap: var(--space-2);
}

.announcement-item h3 {
  color: var(--text-primary);
  font-size: 16px;
}

.announcement-item p {
  color: var(--text-secondary);
}

.announcement-actions {
  justify-content: flex-end;
  flex-shrink: 0;
}

.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: var(--space-6);
}

.login-card {
  width: min(420px, 100%);
  padding: var(--space-8);
}

.login-logo {
  margin-bottom: var(--space-6);
  text-align: center;
}

.login-brand-img {
  width: min(280px, 80%);
  height: 72px;
  margin-bottom: var(--space-3);
  object-fit: contain;
}

.login-logo h1 {
  font-size: 28px;
}

.login-logo p,
.login-help {
  color: var(--text-muted);
  font-size: 13px;
}

.login-error {
  display: none;
  margin-bottom: var(--space-4);
  padding: var(--space-3);
  color: #b3262e;
  font-size: 13px;
  background: var(--color-danger-soft);
  border: 1px solid #f5c5c4;
  border-radius: var(--radius-sm);
}

.login-error:not(:empty) {
  display: block;
}

.login-help {
  margin-top: var(--space-6);
  text-align: center;
}

.mt-8 {
  margin-top: var(--space-2);
}

.text-muted {
  color: var(--text-muted);
}

.text-xs {
  font-size: 11px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(120%);
  }
}

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

@media (max-width: 1180px) {
  .stats-grid,
  .action-center-grid,
  .insight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .availability-grid {
    grid-template-columns: repeat(4, minmax(145px, 1fr));
  }
}

@media (max-width: 900px) {
  :root {
    --sidebar-width: 0px;
  }

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--border-default);
  }

  .sidebar-nav {
    display: flex;
    gap: var(--space-2);
    overflow-x: auto;
    padding: var(--space-3);
  }

  .nav-section-label,
  .profile-card {
    display: none;
  }

  .nav-item,
  .sidebar-bell {
    width: auto;
    min-width: max-content;
    border-left: 0;
    border-bottom: 3px solid transparent;
  }

  .nav-item.active {
    border-left-color: transparent;
    border-bottom-color: var(--color-primary);
  }

  .bell-badge {
    top: 3px;
    left: 25px;
    border-color: var(--bg-sidebar);
  }

  .main-content {
    width: 100%;
    margin-left: 0;
    padding: var(--space-6) var(--space-4);
  }

  .content-grid,
  .insight-split,
  .availability-summary {
    grid-template-columns: 1fr;
  }

  .action-panel,
  .announcement-item,
  .request-item {
    align-items: stretch;
    flex-direction: column;
  }

  .notif-dropdown {
    top: 118px;
    right: var(--space-4);
    bottom: auto;
    left: var(--space-4);
    width: auto;
  }
}

@media (max-width: 680px) {
  h1 {
    font-size: 26px;
  }

  .main-content {
    padding: var(--space-4);
  }

  .page-header,
  .card,
  .stat-card,
  .day-card,
  .shift-card {
    border-radius: 10px;
  }

  .page-header,
  .card-header,
  .modal-header,
  .modal-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .page-header,
  .card-body,
  .modal-body,
  .login-card {
    padding: var(--space-4);
  }

  .card-header,
  .modal-header,
  .modal-footer {
    padding: var(--space-4);
  }

  .stats-grid,
  .action-center-grid,
  .insight-grid,
  .availability-grid,
  .form-row {
    grid-template-columns: 1fr;
  }

  .week-nav {
    width: 100%;
  }

  .week-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
  }

  .tabs {
    display: flex;
    width: 100%;
  }

  .tab-btn {
    flex: 1 0 auto;
    scroll-snap-align: start;
  }

  .tabs {
    scroll-snap-type: x proximity;
  }

  .inline-form-row,
  .next-shift-main,
  .row-actions,
  .td-actions,
  .save-row {
    align-items: stretch;
    flex-direction: column;
  }

  .btn,
  .compact-select,
  .narrow-select {
    width: 100%;
  }

  .btn {
    min-height: 42px;
  }

  .btn-sm,
  .btn-xs {
    min-height: 38px;
  }

  .week-nav-btn {
    min-width: 40px;
    height: 40px;
  }

  .table-wrap table {
    min-width: 620px;
  }

  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal {
    width: 100%;
    max-height: 94dvh;
    border-radius: 12px 12px 0 0;
  }

  .side-panel {
    width: 100%;
    height: 100dvh;
    border-left: 0;
  }

  #toast-container {
    right: var(--space-4);
    bottom: var(--space-4);
    left: var(--space-4);
    width: auto;
  }
}
