:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --ink: #1f2937;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #0f766e;
  --danger: #b91c1c;
  --shadow: 0 10px 24px rgba(15, 23, 42, .08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  line-height: 1.5;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  min-height: 64px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.brand {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: #fff;
  background: var(--primary);
  font-weight: 800;
}

.announcement {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 16px;
  font-weight: 700;
}

.announcement-track {
  display: inline-block;
  min-width: 100%;
  padding: 9px 12px;
  white-space: nowrap;
  animation: announcement-scroll 22s linear infinite;
}

@keyframes announcement-scroll {
  from { transform: translateX(100%); }
  to { transform: translateX(-100%); }
}

.app-shell {
  display: grid;
  grid-template-columns: 1fr;
  width: min(1320px, 100%);
  margin: 0 auto;
}

.sidebar {
  padding: 18px 14px 40px;
}

.sidebar nav {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  color: #475569;
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  white-space: nowrap;
}

.sidebar nav a:hover {
  color: var(--primary);
  border-color: rgba(37, 99, 235, .25);
  background: #eff6ff;
}

.sidebar nav a:nth-child(3n + 1) {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.sidebar nav a:nth-child(3n + 2) {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.sidebar nav a:nth-child(3n) {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.sidebar nav a.nav-manager-link {
  color: #92400e;
  border-color: #f59e0b;
  background: #fffbeb;
  box-shadow: inset 4px 0 0 #f59e0b;
}

.sidebar nav a.nav-manager-link:hover {
  color: #78350f;
  border-color: #d97706;
  background: #fef3c7;
}

.page {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 0 14px 40px;
}

.hero {
  padding: 42px 6px;
}

.hero h1,
.page-head h1,
.panel h1 {
  margin: 4px 0 10px;
  font-size: clamp(28px, 8vw, 42px);
  line-height: 1.12;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}

.actions,
.page-head,
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.actions { justify-content: flex-start; flex-wrap: wrap; margin-top: 24px; }
.actions.compact { margin-top: 0; }
.page-head {
  margin: 8px 0 16px;
  justify-content: flex-start;
}

.page-head > .actions.compact,
.page-head > .button {
  margin-left: clamp(28px, 8vw, 120px);
}

.page-head > .actions.compact .button,
.page-head > .button {
  min-height: 48px;
  padding: 0 22px;
  font-size: 16px;
}

.notice-page-head {
  justify-content: flex-start;
}

.notice-page-head > .button {
  margin-left: clamp(28px, 8vw, 120px);
}

.collection-page-head {
  justify-content: flex-start;
}

.collection-page-head .actions {
  margin-left: clamp(28px, 8vw, 120px);
}

.page-head.compact-head {
  margin: 4px 0 8px;
  align-items: flex-end;
}

.page-head.compact-head h1 {
  margin-bottom: 4px;
  font-size: clamp(24px, 5vw, 34px);
}

.page-head.compact-head .eyebrow {
  margin-bottom: 2px;
}

.page-head.compact-head .page-note {
  margin-top: 0;
  font-size: 13px;
}

.section-title { margin-bottom: 8px; flex-wrap: wrap; }
.section-title a { color: var(--primary); font-size: 14px; }
.section-title.compact-title {
  margin-bottom: 6px;
  align-items: baseline;
}

.section-title.compact-title h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
}

.section-note {
  flex: 1 1 260px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-align: right;
}

.page-note {
  margin: 4px 0 0;
  text-align: left;
}

.button,
button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.button.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.button.primary:hover { background: var(--primary-dark); }

.template-download-button {
  min-height: 48px;
  padding: 0 20px;
  border-color: #f59e0b;
  background: #fffbeb;
  color: #92400e;
  box-shadow: 0 8px 18px rgba(245, 158, 11, .18);
}

.template-download-button:hover {
  border-color: #d97706;
  background: #fef3c7;
  color: #78350f;
}

.market-download-button {
  min-width: 104px;
  min-height: 48px;
  padding: 0 18px;
  border-color: #1d4ed8;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 8px 18px rgba(37, 99, 235, .24);
  font-size: 16px;
  white-space: nowrap;
}

.market-download-button:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
}

.button.danger {
  border-color: rgba(185, 28, 28, .25);
  color: var(--danger);
}

.button.small {
  min-height: 32px;
  padding: 0 10px;
  font-size: 14px;
}

.inline-form {
  display: inline-flex;
  margin: 2px 4px 2px 0;
}

.panel,
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  margin: 14px 0;
  padding: 16px;
}

.panel.compact-panel {
  margin-top: 8px;
  padding: 12px;
}

.panel.narrow {
  max-width: 460px;
  margin: 28px auto;
}

.center { text-align: center; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 8px;
}

.stat {
  padding: 8px 10px;
}

.stat span,
.pay-grid span,
.list-row small,
.meta-box span {
  color: var(--muted);
  font-size: 13px;
}

.stat strong {
  display: block;
  margin-top: 2px;
  font-size: 22px;
}

.exchange-rate-panel {
  display: grid;
  grid-template-columns: 180px 1fr;
  align-items: start;
  gap: 12px;
  padding: 14px 18px;
}

.exchange-rate-panel h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.exchange-rate-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 8px;
}

.exchange-rate-grid div {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.exchange-rate-grid span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.exchange-rate-grid strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 19px;
}

.exchange-rate-panel .section-note {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 12px;
}

.exchange-trend-button {
  margin-top: 8px;
}

.exchange-trend-panel {
  display: grid;
  gap: 16px;
}

.exchange-trend-chart {
  overflow: hidden;
  min-height: 260px;
  padding: 18px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background:
    linear-gradient(rgba(219, 234, 254, .62) 1px, transparent 1px),
    linear-gradient(90deg, rgba(219, 234, 254, .62) 1px, transparent 1px),
    #f8fbff;
  background-size: 100% 52px, 92px 100%, auto;
}

.exchange-trend-chart svg {
  width: 100%;
  height: 240px;
}

.exchange-trend-chart line {
  stroke: #cbd5e1;
  stroke-width: 2;
}

.exchange-trend-chart text {
  fill: #475569;
  font-size: 12px;
  font-weight: 700;
}

.exchange-trend-chart .exchange-grid-line {
  stroke: rgba(148, 163, 184, .38);
  stroke-width: 1;
}

.exchange-trend-chart .exchange-axis-label {
  font-size: 13px;
}

.exchange-trend-chart .exchange-x-tick,
.exchange-trend-chart .exchange-y-tick {
  fill: #64748b;
  font-size: 11px;
  font-weight: 600;
}

.exchange-trend-chart polyline {
  fill: none;
  stroke: #2563eb;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 8px 12px rgba(37, 99, 235, .22));
}

.manager-report-frame {
  width: 100%;
  min-height: 78vh;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.tool-grid {
  display: grid;
  gap: 18px;
}

.tool-controls {
  display: grid;
  align-content: start;
  gap: 14px;
}

.hidden-field {
  display: none;
}

.tool-entry-grid {
  display: grid;
  gap: 12px;
}

.tool-entry-card {
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: center;
  gap: 12px;
  min-height: 104px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .05);
}

.tool-entry-card:hover {
  border-color: rgba(37, 99, 235, .35);
  background: #eff6ff;
}

.tool-entry-icon {
  display: grid;
  grid-row: span 2;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-size: 24px;
  font-weight: 900;
}

.tool-entry-card strong {
  align-self: end;
  font-size: 22px;
}

.tool-entry-card small {
  align-self: start;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.catalog-preview-list {
  display: grid;
  gap: 10px;
}

.catalog-pdf-button {
  width: 100%;
  min-height: 52px;
  font-size: 18px;
  font-weight: 800;
  text-align: center;
}

.catalog-preview-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.catalog-preview-row img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
}

.catalog-preview-row b,
.catalog-preview-row small {
  display: block;
}

.catalog-preview-row small {
  color: var(--muted);
  font-weight: 700;
}

.tool-entry-card.inventory-stock-entry {
  border-color: #bbf7d0;
  background: linear-gradient(135deg, #f0fdf4, #ecfeff);
}

.tool-entry-card.inventory-stock-entry:hover {
  border-color: #22c55e;
  background: linear-gradient(135deg, #dcfce7, #ccfbf1);
}

.inventory-stock-entry .tool-entry-icon {
  background: #16a34a;
}

.inventory-stock-entry strong {
  color: #166534;
}

.cutout-preview {
  display: grid;
  gap: 10px;
}

.compress-results {
  display: grid;
  align-content: start;
  gap: 10px;
}

.compress-summary {
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-weight: 700;
}

.compress-list {
  display: grid;
  gap: 8px;
}

.compress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.compress-row strong,
.compress-row small {
  display: block;
}

.compress-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.delivery-reminder-list {
  display: grid;
  gap: 8px;
}

.delivery-reminder-item {
  display: grid;
  gap: 4px;
  min-width: 180px;
  padding: 8px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
}

.delivery-reminder-item span {
  color: #1d4ed8;
  font-weight: 800;
}

.delivery-reminder-item small {
  color: var(--muted);
}

.delivery-reminder-item.is-done {
  border-color: #dcfce7;
  background: #f0fdf4;
}

.delivery-reminder-item.is-done span,
.delivery-reminder-item.is-done b {
  color: #166534;
}

.delivery-alert-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    radial-gradient(circle at 18% 20%, rgba(37, 99, 235, .32), transparent 28%),
    radial-gradient(circle at 82% 18%, rgba(245, 158, 11, .28), transparent 24%),
    rgba(15, 23, 42, .66);
  backdrop-filter: blur(8px);
}

.delivery-alert-box {
  position: relative;
  width: min(760px, 96vw);
  max-height: 86vh;
  overflow: auto;
  padding: 28px;
  border: 2px solid #93c5fd;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .32);
  animation: delivery-alert-pop .28s ease-out;
}

.delivery-alert-box h2 {
  margin: 4px 0 8px;
  font-size: clamp(30px, 7vw, 52px);
  line-height: 1.05;
}

.delivery-alert-box p {
  margin: 0 0 18px;
  color: var(--muted);
  font-weight: 700;
}

.delivery-alert-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: #fee2e2;
  color: #991b1b;
  font-size: 28px;
  font-weight: 900;
  cursor: pointer;
}

.delivery-alert-list {
  display: grid;
  gap: 12px;
}

.delivery-alert-list article {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
}

.delivery-alert-list strong {
  color: #1d4ed8;
  font-size: 22px;
}

.reminder-snooze-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.reminder-snooze-form label {
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 14px;
  font-weight: 800;
}

.reminder-snooze-form input {
  width: 100%;
  min-height: 42px;
}

.excel-entry-table input {
  width: 100%;
  min-width: 110px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #fff;
  font: inherit;
  font-weight: 700;
}

.excel-entry-table input:focus {
  border-color: var(--primary);
  outline: 0;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, .12);
}

.stock-number {
  display: inline-flex;
  min-width: 74px;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-size: 18px;
  font-weight: 900;
}

.stock-number.is-zero {
  background: #fef3c7;
  color: #92400e;
}

.stock-number.is-negative {
  background: #fee2e2;
  color: #991b1b;
}

.inventory-filter-form {
  display: inline-flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
}

.inventory-filter-bar {
  align-items: end;
  margin: 8px 0 12px;
  padding: 12px;
  border: 1px solid #86efac;
  border-radius: 8px;
  background: linear-gradient(135deg, #f0fdf4, #ecfeff);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .65);
}

.inventory-filter-form label {
  min-width: 180px;
  font-size: 13px;
}

.inventory-filter-form input,
.inventory-filter-form select {
  min-height: 42px;
}

.delivery-alert-list span,
.delivery-alert-list small {
  color: var(--muted);
  font-weight: 700;
}

.delivery-alert-message {
  margin: 0 0 12px;
  padding: 14px 16px;
  border: 2px solid #fbbf24;
  border-radius: 10px;
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  color: #92400e;
  font-size: clamp(28px, 6vw, 40px);
  font-weight: 900;
  line-height: 1.18;
}

@keyframes delivery-alert-pop {
  from { opacity: 0; transform: translateY(18px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.cutout-canvas-wrap {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 320px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #e2e8f0 25%, transparent 25%),
    linear-gradient(-45deg, #e2e8f0 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e2e8f0 75%),
    linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

.cutout-canvas-wrap canvas {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  cursor: crosshair;
}

.cutout-canvas-wrap p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.cutout-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.form {
  display: grid;
  gap: 14px;
}

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

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.delivery-form {
  gap: 18px;
}

.delivery-form .form-grid {
  gap: 16px;
}

.delivery-form label {
  gap: 9px;
  font-size: 18px;
}

.delivery-form input,
.delivery-form textarea {
  min-height: 58px;
  padding: 12px 14px;
  font-size: 18px;
  font-weight: 800;
}

.delivery-form textarea {
  min-height: 96px;
}

.delivery-form input[type="date"] {
  min-height: 62px;
  font-size: 20px;
}

.delivery-form input[type="date"]::-webkit-calendar-picker-indicator {
  width: 26px;
  height: 26px;
  cursor: pointer;
}

.delivery-reminder-row {
  grid-template-columns: 1fr;
  align-items: stretch;
}

.delivery-reminder-row textarea {
  height: 106px;
  min-height: 106px;
}

.delivery-compact-form {
  gap: 12px;
}

.delivery-compact-form .form-grid {
  gap: 10px;
}

.delivery-compact-form label {
  gap: 6px;
  font-size: 15px;
}

.delivery-compact-form input,
.delivery-compact-form textarea {
  min-height: 44px;
  padding: 9px 12px;
  font-size: 16px;
  font-weight: 700;
}

.delivery-compact-form input[type="date"] {
  min-height: 46px;
  font-size: 17px;
}

.delivery-compact-form textarea {
  min-height: 68px;
  height: 68px;
}

.delivery-compact-form .delivery-reminder-row textarea {
  min-height: 72px;
  height: 72px;
}

.delivery-compact-form input[type="date"]::-webkit-calendar-picker-indicator {
  width: 20px;
  height: 20px;
}

.delivery-import-form {
  max-width: 700px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.import-highlight-button {
  min-width: 92px;
  min-height: 50px;
  font-size: 18px;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 700;
  color: #334155;
}

label.check {
  display: flex;
  align-items: center;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 6px;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.field-label {
  font-weight: 800;
  color: #334155;
}

.department-checks {
  display: grid;
  gap: 12px;
}

.department-check-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
}

.department-check-group h3 {
  margin: 0;
  font-size: 15px;
  color: #1f2a44;
}

.department-check-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  margin-bottom: 8px;
}

.department-select-all {
  font-size: 14px;
  color: #2563eb;
  white-space: nowrap;
}

.selected-files {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.selected-file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #334155;
}

.selected-file-row .button {
  min-height: 32px;
  padding: 6px 10px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

textarea { resize: vertical; }

.rich-field {
  display: grid;
  gap: 8px;
}

.rich-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.rich-toolbar button,
.rich-toolbar select {
  width: auto;
  min-width: 42px;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #1e293b;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.rich-toolbar select {
  min-width: 72px;
}

.rich-editor {
  min-height: 180px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.rich-editor:focus {
  outline: 2px solid rgba(37, 99, 235, .28);
  border-color: var(--primary);
}

.rich-editor:empty::before {
  content: attr(data-placeholder);
  color: #94a3b8;
}

.list {
  display: grid;
  gap: 10px;
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.list-row span {
  min-width: 0;
}

.list-row b,
.list-row small {
  display: block;
}

.list-row em {
  flex: 0 0 auto;
  color: var(--primary);
  font-style: normal;
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}

.employee-highlight-list .list-row,
.admin-highlight-list .list-row {
  position: relative;
  justify-content: flex-start;
  overflow: hidden;
  border: 1px solid rgba(37, 99, 235, .22);
  background: #fff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, .08);
  animation: notice-card-pulse 2.8s ease-in-out infinite;
}

.employee-highlight-list .list-row::before,
.admin-highlight-list .list-row::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -36%;
  width: 30%;
  background: linear-gradient(90deg, transparent, rgba(37, 99, 235, .16), rgba(34, 211, 238, .2), transparent);
  transform: skewX(-18deg);
  animation: notice-shine-sweep 3.6s ease-in-out infinite;
}

.employee-highlight-list .list-row::after,
.admin-highlight-list .list-row::after {
  content: none;
}

.employee-highlight-list .list-row > *,
.admin-highlight-list .list-row > * {
  position: relative;
  z-index: 1;
}

.employee-highlight-list .list-row > span,
.admin-highlight-list .list-row > span {
  flex: 0 1 min(46%, 420px);
}

.employee-highlight-list .list-row em,
.admin-highlight-list .list-row em {
  min-width: 112px;
  margin-left: 8px;
  padding: 11px 18px;
  border: 2px solid rgba(37, 99, 235, .32);
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 21px;
  font-weight: 900;
  text-align: center;
  box-shadow: 0 10px 22px rgba(37, 99, 235, .16);
}

.admin-highlight-list .list-row em {
  min-width: 130px;
  font-size: 18px;
}

.batch-manage-row {
  align-items: center;
}

.batch-main-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
}

.batch-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.batch-row-actions .mini-form {
  margin: 0;
}

@keyframes notice-card-pulse {
  0%, 100% {
    border-color: rgba(37, 99, 235, .22);
    box-shadow: 0 10px 24px rgba(37, 99, 235, .08);
  }
  50% {
    border-color: rgba(37, 99, 235, .48);
    box-shadow: 0 12px 30px rgba(37, 99, 235, .18), 0 0 0 3px rgba(37, 99, 235, .06);
  }
}

@keyframes notice-shine-sweep {
  0%, 32% { left: -36%; opacity: 0; }
  45% { opacity: 1; }
  72% { left: 106%; opacity: 0; }
  100% { left: 106%; opacity: 0; }
}

.salary-row {
  align-items: flex-start;
}

.salary-row input {
  margin-top: 8px;
  font-size: 13px;
}

.notice-content {
  white-space: pre-wrap;
  color: #334155;
}

.notice-content.rich-content {
  white-space: normal;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.notice-content.rich-content p,
.notice-content.rich-content div {
  margin: 0 0 10px;
}

.notice-content.rich-content ul,
.notice-content.rich-content ol {
  margin: 8px 0 10px 22px;
  padding: 0;
}

.notice-content.rich-content li {
  margin: 4px 0;
}

.meta-box {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  padding: 12px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid var(--line);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

table.wide-table {
  min-width: 1900px;
}

table.detail-table {
  min-width: 0;
}

table.detail-table th {
  width: 42%;
  padding-right: 18px;
  text-align: right;
}

th,
td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: #475569;
  background: #f8fafc;
  font-size: 13px;
}

.action-column {
  min-width: 128px;
}

.messages {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.topbar-messages {
  flex: 0 1 min(520px, 46vw);
  min-width: min(360px, 46vw);
  max-width: min(520px, calc(100vw - 96px));
  margin: 0;
}

.message {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}

.topbar-messages .message {
  overflow: visible;
  max-width: 100%;
  padding: 7px 10px;
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.35;
  box-shadow: none;
}

.message.success { color: var(--success); }
.message.error { color: var(--danger); }
.message.lottery {
  position: relative;
  overflow: hidden;
  border-color: rgba(37, 99, 235, .28);
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 18px;
  font-weight: 800;
}
.empty { color: var(--muted); }

.lottery-celebration {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 18%, rgba(250, 204, 21, .5), transparent 20%),
    radial-gradient(circle at 18% 78%, rgba(236, 72, 153, .34), transparent 28%),
    radial-gradient(circle at 82% 72%, rgba(6, 182, 212, .34), transparent 30%),
    linear-gradient(145deg, rgba(15, 23, 42, .92), rgba(30, 41, 59, .82));
  animation: celebration-fade 9.1s ease forwards;
}

.lottery-celebration.lottery-theme-gold {
  background:
    radial-gradient(circle at 50% 18%, rgba(253, 224, 71, .7), transparent 22%),
    radial-gradient(circle at 24% 74%, rgba(245, 158, 11, .42), transparent 30%),
    radial-gradient(circle at 82% 68%, rgba(251, 191, 36, .4), transparent 28%),
    linear-gradient(145deg, rgba(69, 26, 3, .9), rgba(120, 53, 15, .78));
}

.lottery-celebration.lottery-theme-firework {
  background:
    radial-gradient(circle at 22% 24%, rgba(236, 72, 153, .5), transparent 18%),
    radial-gradient(circle at 80% 28%, rgba(34, 211, 238, .42), transparent 20%),
    radial-gradient(circle at 48% 74%, rgba(168, 85, 247, .42), transparent 26%),
    linear-gradient(145deg, rgba(2, 6, 23, .94), rgba(30, 27, 75, .86));
}

.lottery-celebration.lottery-theme-neon {
  background:
    repeating-linear-gradient(110deg, rgba(34, 211, 238, .12) 0 10px, transparent 10px 34px),
    radial-gradient(circle at 20% 72%, rgba(14, 165, 233, .5), transparent 26%),
    radial-gradient(circle at 80% 24%, rgba(236, 72, 153, .52), transparent 28%),
    linear-gradient(145deg, rgba(8, 13, 32, .94), rgba(49, 46, 129, .84));
}

.lottery-celebration.lottery-theme-redcarpet {
  background:
    linear-gradient(90deg, rgba(127, 29, 29, .68), transparent 22%, transparent 78%, rgba(127, 29, 29, .68)),
    radial-gradient(circle at 50% 10%, rgba(254, 240, 138, .56), transparent 22%),
    linear-gradient(145deg, rgba(69, 10, 10, .92), rgba(15, 23, 42, .82));
}

.lottery-glow {
  position: fixed;
  left: 50%;
  top: 48%;
  width: min(920px, 120vw);
  height: min(920px, 120vw);
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(245, 158, 11, .7), rgba(37, 99, 235, .48), rgba(236, 72, 153, .62), rgba(16, 185, 129, .48), rgba(245, 158, 11, .7));
  filter: blur(46px);
  opacity: .82;
  transform: translate(-50%, -50%);
  animation: lottery-glow-spin 9s linear forwards;
}

.lottery-disco-ball {
  position: fixed;
  left: 50%;
  top: 54px;
  z-index: 21;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background:
    linear-gradient(45deg, transparent 44%, rgba(255,255,255,.72) 45%, rgba(255,255,255,.72) 55%, transparent 56%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.35) 0 6px, rgba(37,99,235,.42) 6px 12px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.28) 0 8px, rgba(245,158,11,.42) 8px 16px);
  border: 3px solid rgba(255,255,255,.75);
  box-shadow: 0 0 34px rgba(250, 204, 21, .75), 0 0 90px rgba(236, 72, 153, .38);
  transform: translateX(-50%);
  animation: disco-spin 2.4s linear infinite, disco-drop 9.1s ease forwards;
}

.lottery-beam {
  position: fixed;
  top: -10vh;
  width: 18vw;
  height: 130vh;
  opacity: .55;
  filter: blur(2px);
  transform-origin: top center;
  mix-blend-mode: screen;
  animation: beam-sweep 2.4s ease-in-out infinite alternate;
}

.beam-1 { left: 5vw; background: linear-gradient(to bottom, rgba(245,158,11,.72), transparent); transform: rotate(24deg); }
.beam-2 { left: 26vw; background: linear-gradient(to bottom, rgba(6,182,212,.7), transparent); transform: rotate(-18deg); animation-delay: -.5s; }
.beam-3 { left: 48vw; background: linear-gradient(to bottom, rgba(236,72,153,.68), transparent); transform: rotate(14deg); animation-delay: -1s; }
.beam-4 { left: 68vw; background: linear-gradient(to bottom, rgba(37,99,235,.7), transparent); transform: rotate(-22deg); animation-delay: -.8s; }
.beam-5 { left: 82vw; background: linear-gradient(to bottom, rgba(16,185,129,.66), transparent); transform: rotate(18deg); animation-delay: -1.4s; }
.beam-6 { left: 40vw; background: linear-gradient(to bottom, rgba(250,204,21,.58), transparent); transform: rotate(-4deg); animation-delay: -1.8s; }

.lottery-laser {
  position: fixed;
  left: -18vw;
  width: 136vw;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.95), rgba(34,211,238,.9), transparent);
  box-shadow: 0 0 18px rgba(34,211,238,.95);
  opacity: .74;
  transform: rotate(var(--laser-angle, 0deg));
  animation: laser-flash 1.4s ease-in-out infinite alternate;
}

.lottery-sparkle {
  position: fixed;
  z-index: 21;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.98), rgba(250,204,21,.82) 32%, transparent 68%);
  box-shadow: 0 0 22px rgba(255,255,255,.9), 0 0 42px rgba(250,204,21,.66);
  animation: sparkle-burst 2.3s ease-in-out infinite;
}

.lottery-banner {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 22;
  width: min(780px, calc(100% - 28px));
  padding: 40px 32px;
  border: 3px solid rgba(250, 204, 21, .82);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255,247,237,.98), rgba(255,255,255,.96) 42%, rgba(239,246,255,.98)),
    radial-gradient(circle at 50% 0, rgba(250,204,21,.44), transparent 45%);
  box-shadow: 0 38px 110px rgba(0, 0, 0, .38), 0 0 0 10px rgba(255, 255, 255, .28), 0 0 90px rgba(245, 158, 11, .5);
  color: var(--ink);
  text-align: center;
  transform: translate(-50%, -50%);
  animation: lottery-pop 9s ease forwards;
  pointer-events: none;
}

.lottery-banner.lottery-theme-gold {
  border-color: rgba(251, 191, 36, .96);
  background:
    radial-gradient(circle at 50% 0, rgba(254, 240, 138, .62), transparent 45%),
    linear-gradient(135deg, rgba(255,251,235,.98), rgba(254,243,199,.98));
  box-shadow: 0 38px 120px rgba(69, 26, 3, .48), 0 0 120px rgba(251, 191, 36, .74);
}

.lottery-banner.lottery-theme-firework {
  border-color: rgba(34, 211, 238, .9);
  background:
    radial-gradient(circle at 20% 20%, rgba(244, 114, 182, .3), transparent 34%),
    radial-gradient(circle at 78% 18%, rgba(34, 211, 238, .3), transparent 32%),
    linear-gradient(135deg, rgba(248,250,252,.98), rgba(239,246,255,.97));
  box-shadow: 0 38px 120px rgba(30, 27, 75, .52), 0 0 110px rgba(34, 211, 238, .55);
}

.lottery-banner.lottery-theme-neon {
  color: #f8fafc;
  border-color: rgba(236, 72, 153, .92);
  background:
    linear-gradient(135deg, rgba(15,23,42,.97), rgba(49,46,129,.96)),
    radial-gradient(circle at 50% 0, rgba(34,211,238,.34), transparent 45%);
  box-shadow: 0 38px 120px rgba(0, 0, 0, .58), 0 0 120px rgba(236, 72, 153, .6);
}

.lottery-banner.lottery-theme-redcarpet {
  border-color: rgba(254, 240, 138, .98);
  background:
    linear-gradient(135deg, rgba(255,247,237,.98), rgba(254,226,226,.98)),
    radial-gradient(circle at 50% 0, rgba(254, 240, 138, .58), transparent 48%);
  box-shadow: 0 38px 120px rgba(69, 10, 10, .55), 0 0 120px rgba(239, 68, 68, .42);
}

.lottery-banner b {
  display: block;
  margin-bottom: 12px;
  color: #be123c;
  font-size: clamp(42px, 10vw, 86px);
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 5px 0 rgba(250, 204, 21, .42);
}

.lottery-banner.lottery-theme-gold b { color: #b45309; }
.lottery-banner.lottery-theme-firework b { color: #7c3aed; }
.lottery-banner.lottery-theme-neon b {
  color: #22d3ee;
  text-shadow: 0 0 20px rgba(34, 211, 238, .86), 0 0 34px rgba(236, 72, 153, .7);
}
.lottery-banner.lottery-theme-redcarpet b { color: #dc2626; }

.lottery-banner strong {
  display: block;
  color: #1d4ed8;
  font-size: clamp(26px, 5vw, 42px);
  line-height: 1.35;
}

.lottery-banner.lottery-theme-neon strong,
.lottery-banner.lottery-theme-neon span {
  color: #f8fafc;
}

.lottery-banner span {
  display: block;
  margin-top: 10px;
  color: #64748b;
  font-size: clamp(16px, 2.8vw, 22px);
  font-weight: 800;
}

.lottery-close {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 24;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 2px solid rgba(255, 255, 255, .78);
  border-radius: 50%;
  background: rgba(15, 23, 42, .72);
  color: #fff;
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .38), 0 0 28px rgba(255, 255, 255, .22);
}

.lottery-close:hover {
  background: rgba(220, 38, 38, .92);
  transform: scale(1.05);
}

.lottery-close:focus-visible {
  outline: 3px solid rgba(250, 204, 21, .9);
  outline-offset: 3px;
}

.confetti-piece {
  position: fixed;
  top: -14px;
  width: 12px;
  height: 22px;
  border-radius: 2px;
  animation: confetti-fall var(--fall-duration, 5.2s) linear forwards;
}

@keyframes lottery-pop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.55) rotate(-3deg); }
  9% { opacity: 1; transform: translate(-50%, -50%) scale(1.12) rotate(1deg); }
  16% { transform: translate(-50%, -50%) scale(1) rotate(0); }
  78% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -52%) scale(.9); }
}

@keyframes lottery-glow-spin {
  from { transform: translate(-50%, -50%) rotate(0deg) scale(.9); }
  to { transform: translate(-50%, -50%) rotate(360deg) scale(1.08); }
}

@keyframes celebration-fade {
  0% { opacity: 0; }
  8% { opacity: 1; }
  84% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes disco-spin {
  to { rotate: 360deg; }
}

@keyframes disco-drop {
  0% { opacity: 0; transform: translate(-50%, -20px) scale(.72); }
  10% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  84% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -8px) scale(.92); }
}

@keyframes beam-sweep {
  from { translate: -8vw 0; rotate: -8deg; }
  to { translate: 8vw 0; rotate: 8deg; }
}

@keyframes laser-flash {
  from { opacity: .18; translate: 0 -8px; }
  to { opacity: .86; translate: 0 8px; }
}

@keyframes sparkle-burst {
  0%, 100% { opacity: .18; transform: scale(.4) rotate(0deg); }
  45% { opacity: 1; transform: scale(1.45) rotate(160deg); }
}

@keyframes confetti-fall {
  to {
    transform: translate3d(var(--drift, 0), 110vh, 0) rotate(720deg);
    opacity: 0;
  }
}

.pay-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.pay-grid > div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.pay-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
}

.pay-grid .net {
  border-color: rgba(37, 99, 235, .35);
  background: #eff6ff;
}

.lottery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 12px 0 16px;
}

.lottery-card {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: center;
}

.lottery-card small {
  color: var(--muted);
  font-size: 13px;
}

.prize-float {
  position: relative;
  width: 100%;
  min-height: 34px;
  overflow: hidden;
  border: 1px dashed rgba(37, 99, 235, .22);
  border-radius: 999px;
  background: #eff6ff;
}

.prize-float span {
  position: absolute;
  left: 50%;
  top: 50%;
  display: inline-block;
  min-width: max-content;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  animation: prize-drift 4.8s ease-in-out infinite alternate;
}

.lottery-card:nth-child(2n) .prize-float span {
  animation-duration: 5.6s;
  animation-delay: -.8s;
}

.lottery-card:nth-child(3n) .prize-float span {
  animation-duration: 4.2s;
  animation-delay: -1.4s;
}

@keyframes prize-drift {
  0% { transform: translate(-70%, -58%) rotate(-1deg); }
  35% { transform: translate(-48%, -42%) rotate(1deg); }
  70% { transform: translate(-28%, -56%) rotate(-.5deg); }
  100% { transform: translate(-62%, -44%) rotate(1.2deg); }
}

.lottery-logo {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 28px;
  font-weight: 800;
}

.lottery-card button[disabled] {
  opacity: .45;
  cursor: not-allowed;
}

.pending-benefits {
  border-color: rgba(245, 158, 11, .45);
  background: #fffbeb;
}

.pending-benefits .section-title span {
  color: #92400e;
  font-weight: 800;
}

.pending-benefit-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.pending-benefit-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(245, 158, 11, .35);
  border-radius: 8px;
  background: #fff;
}

.pending-benefit-item strong {
  display: block;
  font-size: 18px;
}

.pending-benefit-item small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-weight: 800;
  white-space: nowrap;
}

.status-badge.pending {
  background: #f59e0b;
  color: #fff;
  box-shadow: 0 8px 18px rgba(245, 158, 11, .22);
}

.status-badge.issued {
  background: #dcfce7;
  color: #166534;
}

.status-badge.expired {
  background: #fee2e2;
  color: #b91c1c;
}

.signature-box {
  position: relative;
  width: 100%;
  padding: 10px;
  border: 1px dashed #94a3b8;
  border-radius: 8px;
  background: #fff;
}

.signature-hint {
  position: absolute;
  inset: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2563eb;
  font-size: 18px;
  font-weight: 800;
  pointer-events: none;
  opacity: .72;
  z-index: 3;
}

.signature-hint.hidden {
  opacity: 0;
}

.signature-box canvas {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 180px;
  touch-action: none;
  background: linear-gradient(#fff, #fff), repeating-linear-gradient(0deg, transparent, transparent 35px, #eef2f7 36px);
}

.signature-box img {
  display: block;
  max-width: 100%;
  max-height: 180px;
}

.attendance-confirm-button {
  min-height: 128px;
  font-size: 36px;
  font-weight: 900;
  width: 100%;
  box-shadow: 0 14px 28px rgba(37, 99, 235, .24);
}

.signature-thumb {
  display: block;
  width: 120px;
  height: 45px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.mini-form {
  display: flex;
  gap: 6px;
  margin: 4px 0;
}

.mini-form input {
  min-width: 160px;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.table-actions .mini-form {
  margin: 0;
}

.anchored-row {
  scroll-margin-top: 120px;
}

#collection-reminder-results {
  scroll-margin-top: 96px;
}

.amount-total {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  color: #1d4ed8;
  background: #eff6ff;
}

.compact-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #475569;
  font-weight: 700;
}

.compact-filter select {
  min-width: 180px;
}

.collection-quick-form {
  gap: 12px;
}

.collection-quick-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 10px;
}

.collection-quick-grid label {
  margin: 0;
}

.collection-quick-grid input {
  min-height: 44px;
}

.collection-note-field {
  grid-column: span 1;
}

.calendar-task-page {
  width: min(1420px, calc(100vw - 128px));
  margin: 0 auto;
}

.calendar-task-panel {
  display: grid;
  gap: 12px;
}

.calendar-toolbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 0;
}

.calendar-toolbar strong {
  text-align: center;
  font-size: 20px;
}

.calendar-range-form {
  display: flex;
  justify-content: flex-end;
  padding: 0 14px;
}

.calendar-range-form label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #475569;
  font-weight: 800;
}

.calendar-range-form select {
  min-width: 110px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  padding: 0 18px 18px;
}

.calendar-weekdays {
  padding-bottom: 0;
  color: #64748b;
  font-weight: 800;
  text-align: center;
}

.calendar-day {
  display: grid;
  align-content: start;
  gap: 9px;
  min-height: 188px;
  padding: 12px 9px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #fff;
  color: #172554;
  text-decoration: none;
}

.calendar-day:hover {
  border-color: #93c5fd;
}

.calendar-day b {
  font-size: 18px;
}

.calendar-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.calendar-day-head small,
.calendar-day-empty,
.calendar-day-more {
  color: #64748b;
  font-size: 12px;
  line-height: 1.25;
}

.calendar-day-tasks {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.calendar-holiday {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 2px 6px;
  border-radius: 5px;
  background: #fff1f2;
  color: #be123c;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.3;
}

.calendar-task-toggle {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin: 0;
  border-radius: 5px;
  background: #8ea2f7;
  overflow: hidden;
}

.calendar-day-task {
  display: flex;
  align-items: flex-start;
  gap: 0;
  width: 100%;
  min-width: 0;
  min-height: 30px;
  padding: 5px 7px 5px 2px;
  border: 0;
  border-radius: 0 5px 5px 0;
  background: transparent;
  color: #172554;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.15;
  text-align: left;
  overflow: hidden;
  white-space: normal;
  cursor: pointer;
}

.calendar-day-task.done {
  color: #64748b;
  text-decoration: line-through;
}

.calendar-task-toggle:has(.calendar-day-task.done) {
  background: #dbe4f0;
}

.calendar-day-task span {
  min-width: 0;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.calendar-task-box {
  display: block;
}

.calendar-task-box-button {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 26px;
  min-height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.calendar-task-box {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  border: 1.5px solid #5166b5;
  border-radius: 3px;
  background: #aebcfb;
}

.calendar-task-box.done {
  position: relative;
  background: #e2e8f0;
  border-color: #64748b;
}

.calendar-task-box.done::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 1px;
  width: 5px;
  height: 8px;
  border: solid #475569;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.calendar-view-content {
  min-height: 96px;
  padding: 14px;
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #fffdf0;
  color: #17202f;
  font-size: 18px;
  font-weight: 750;
  line-height: 1.45;
  white-space: pre-wrap;
}

.calendar-day.active {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: inset 0 0 0 1px #2563eb;
}

.calendar-day.empty {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.calendar-task-form {
  margin: 0 14px 14px;
}

.calendar-task-row.done b {
  color: #64748b;
  text-decoration: line-through;
}

.calendar-sticky-modal[hidden] {
  display: none;
}

.calendar-sticky-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 22px;
}

.calendar-sticky-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .28);
}

.calendar-sticky-note {
  position: relative;
  width: min(420px, 100%);
  padding: 22px;
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #fff7c2;
  box-shadow: 0 22px 60px rgba(15, 23, 42, .25);
}

.calendar-sticky-note form {
  display: grid;
  gap: 12px;
}

.calendar-sticky-note textarea {
  min-height: 130px;
  resize: vertical;
  background: #fffdf0;
}

.calendar-sticky-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(250, 204, 21, .35);
  color: #713f12;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 719px) {
  .calendar-task-page {
    width: 100%;
  }

  .calendar-grid {
    gap: 5px;
    padding-left: 8px;
    padding-right: 8px;
  }

  .calendar-day {
    min-height: 124px;
    padding: 8px 5px;
  }

  .calendar-day-task {
    font-size: 12px;
  }

  .exchange-rate-panel {
    grid-template-columns: 1fr;
  }

  .exchange-rate-grid {
    grid-template-columns: 1fr;
  }

  .section-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-note {
    text-align: left;
  }

  .collection-quick-grid {
    grid-template-columns: 1fr;
  }

  .reminder-snooze-form {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 720px) {
  .page { padding: 28px 20px 56px; }
  .stats-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .form.inline { grid-template-columns: 1fr auto; align-items: end; }
  .delivery-import-form { grid-template-columns: minmax(0, 1fr) auto; }
  .form-grid { grid-template-columns: repeat(3, 1fr); }
  .delivery-reminder-row { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
  .meta-box { grid-template-columns: repeat(3, 1fr); }
  .pay-grid { grid-template-columns: repeat(4, 1fr); }
  .tool-grid { grid-template-columns: 320px minmax(0, 1fr); align-items: start; }
  .tool-entry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 979px) {
  .app-shell {
    grid-template-columns: 92px minmax(0, 1fr);
    align-items: start;
    gap: 8px;
  }

  .sidebar {
    position: sticky;
    top: 64px;
    align-self: start;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    padding: 10px 4px 20px 6px;
  }

  .sidebar nav {
    flex-direction: column;
    gap: 6px;
    overflow: visible;
    white-space: normal;
    font-size: 13px;
  }

  .sidebar nav a {
    justify-content: center;
    width: 82px;
    min-height: 38px;
    padding: 0 6px;
    text-align: center;
    line-height: 1.2;
    white-space: normal;
  }

  .page {
    min-width: 0;
    margin: 0;
    padding-left: 0;
    padding-right: 8px;
  }
}

@media (max-width: 719px) {
  .sidebar nav a.nav-manager-link {
    width: 82px;
    min-height: 114px;
    padding: 0 6px;
    font-size: 28px;
    line-height: 1.15;
  }
}

@media (min-width: 980px) {
  .app-shell {
    grid-template-columns: 230px minmax(0, 1fr);
    align-items: start;
    gap: 16px;
  }

  .sidebar {
    position: sticky;
    top: 74px;
    min-height: calc(100vh - 74px);
    padding: 14px 0 24px 20px;
  }

  .sidebar nav {
    flex-direction: column;
    gap: 6px;
    overflow: visible;
    font-size: 16px;
  }

  .sidebar nav a {
    min-height: 39px;
    padding: 0 14px;
    justify-content: center;
    text-align: center;
    width: 188px;
  }

  .page {
    margin: 0;
  }
}
