:root {
  color-scheme: light;
  --bg: #f6f9fd;
  --panel: #ffffff;
  --panel-soft: #eef5ff;
  --text: #172033;
  --muted: #697386;
  --line: #dbe4f0;
  --blue: #0f68d8;
  --blue-dark: #0a4ea5;
  --green: #16805b;
  --amber: #b66a00;
  --red: #c53b3b;
  --shadow: 0 14px 35px rgba(18, 45, 85, 0.08);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

/* Premium Auto Energjia dashboard refresh */
:root {
  --bg: #f5f8fc;
  --panel: #ffffff;
  --panel-soft: #f1f6ff;
  --text: #111827;
  --muted: #667085;
  --line: #dfe7f2;

  --blue: #1267e3;
  --blue-dark: #0b4fb5;
  --green: #14915f;
  --amber: #d48512;
  --red: #d92d20;
  --purple: #7c3aed;
  --cyan: #0891b2;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 18px 45px rgba(15, 32, 60, 0.08);
  --shadow-soft: 0 8px 26px rgba(15, 32, 60, 0.06);
}

body {
  background:
    radial-gradient(circle at top left, rgba(18, 103, 227, 0.08), transparent 360px),
    linear-gradient(180deg, #f8fbff 0%, #f3f7fc 100%);
  color: var(--text);
}

.topbar {
  width: min(1320px, calc(100% - 28px));
  margin: 14px auto 0;
  border: 1px solid rgba(223, 231, 242, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.service-brand {
  gap: 12px;
}

.service-brand strong {
  letter-spacing: 0.04em;
}

.brand-dot {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(135deg, #1d75ff, #0b4fb5);
  box-shadow: 0 10px 22px rgba(18, 103, 227, 0.24);
}

.session-box {
  background: #f4f8ff;
  border: 1px solid #e3ebf7;
  padding: 8px 10px;
  border-radius: 999px;
}

.session-box #workerName {
  font-size: 14px;
  font-weight: 800;
}

.main-nav {
  width: min(1320px, calc(100% - 28px));
  margin: 12px auto 0;
  padding: 10px;
  gap: 8px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(223, 231, 242, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.main-nav button,
.main-nav select {
  min-height: 46px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  color: #475467;
  padding: 10px 16px;
  font-weight: 800;
  transition: 0.18s ease;
}

.main-nav button:hover,
.main-nav select:hover {
  background: #f2f6fc;
  color: var(--blue-dark);
}

.main-nav button.is-active,
.main-nav select.is-active {
  color: #fff;
  background: linear-gradient(135deg, #1267e3, #0b55c7);
  border-color: #1267e3;
  box-shadow: 0 14px 24px rgba(18, 103, 227, 0.25);
}

.page {
  width: min(1220px, calc(100% - 32px));
  padding-top: 36px;
}

.page-title-row {
  margin-bottom: 26px;
}

.kicker {
  color: #6b7a90;
  font-size: 14px;
  text-transform: none;
  letter-spacing: 0;
}

.page-title-row h2 {
  font-size: clamp(32px, 4vw, 46px);
  letter-spacing: -0.04em;
  line-height: 1;
}

.summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.metric-card {
  min-height: 132px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid rgba(223, 231, 242, 0.95);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.88));
  box-shadow: var(--shadow-soft);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.metric-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: #cfdced;
}

.metric-icon {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 25px;
  font-weight: 900;
}

.metric-content span {
  display: block;
  color: #536176;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
}

.metric-content strong {
  display: block;
  margin-top: 8px;
  font-size: 32px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.metric-content small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.metric-blue .metric-icon {
  background: #eaf2ff;
  color: var(--blue);
}

.metric-amber .metric-icon {
  background: #fff4df;
  color: var(--amber);
}

.metric-green .metric-icon {
  background: #e9fbf2;
  color: var(--green);
}

.metric-red .metric-icon {
  background: #fff0ef;
  color: var(--red);
}

.metric-purple .metric-icon {
  background: #f3eefe;
  color: var(--purple);
}

.metric-cyan .metric-icon {
  background: #e9fbff;
  color: var(--cyan);
}

.content-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(330px, 0.65fr);
  gap: 22px;
}

.panel,
.job-card {
  border-radius: var(--radius);
  border: 1px solid rgba(223, 231, 242, 0.95);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
}

.panel {
  padding: 22px;
}

.panel h3 {
  font-size: 19px;
  letter-spacing: -0.02em;
}

.job-list {
  gap: 12px;
}

.job-card {
  padding: 18px;
  box-shadow: none;
  background: #ffffff;
  transition: 0.18s ease;
}

.job-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(15, 32, 60, 0.07);
  border-color: #cdd9eb;
}

.job-head h3,
.job-head h4 {
  font-size: 18px;
  letter-spacing: -0.02em;
}

.job-head small {
  color: #667085;
  font-size: 13px;
}

.status-chip {
  min-height: 28px;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 900;
}

.status-chip.active,
.status-chip.done {
  background: #e8fbf1;
  color: #087443;
}

.status-chip.pending {
  background: #fff6e6;
  color: #b35c00;
}

.status-chip.inactive {
  background: #fff0ef;
  color: #b42318;
}

.metric-row span {
  border-radius: 999px;
  background: #f4f7fb;
  border: 1px solid #e4ebf5;
  color: #526071;
  font-weight: 750;
  padding: 7px 11px;
}

.progress-shell {
  height: 8px;
  background: #e8eef7;
}

.progress-shell span {
  background: linear-gradient(90deg, #1267e3, #22c55e);
}

.soft-strip {
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #f7faff, #eef5ff);
  border: 1px solid #dce8fb;
}

input,
select,
textarea {
  border-radius: 14px;
  min-height: 46px;
  border-color: #dce5f2;
  background: #ffffff;
}

.primary-button,
.ghost-button,
.small-button,
.danger-button {
  border-radius: 14px;
  min-height: 44px;
  font-weight: 850;
}

.primary-button {
  background: linear-gradient(135deg, #1267e3, #0b55c7);
  box-shadow: 0 14px 24px rgba(18, 103, 227, 0.25);
}

.ghost-button,
.small-button {
  background: #f4f8ff;
  color: var(--blue-dark);
  border: 1px solid #dce8fb;
}

.table-wrap,
.empty-state,
.simple-section,
.more-menu,
.quick-service-form,
.inspection-item,
.inspection-card,
.catalog-card,
.alert-row,
.warning-card,
.damage-card,
.note-card,
.cleanup-row,
.linked-inspection {
  border-radius: var(--radius);
}

.empty-state {
  background: #f8fbff;
  border-color: #d5e2f2;
}

@media (max-width: 980px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-grid,
  .service-workspace,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .main-nav {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .main-nav button,
  .main-nav select {
    white-space: nowrap;
  }
}

@media (max-width: 640px) {
  .topbar,
  .main-nav,
  .page {
    width: min(100% - 20px, 100%);
  }

  .topbar {
    min-height: 58px;
    padding: 10px 12px;
  }

  .service-brand strong {
    font-size: 15px;
  }

  .session-box {
    padding: 6px 8px;
  }

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

  .metric-card {
    min-height: 110px;
    padding: 18px;
  }

  .metric-icon {
    width: 48px;
    height: 48px;
    font-size: 20px;
  }

  .metric-content strong {
    font-size: 28px;
  }

  .page-title-row h2 {
    font-size: 34px;
  }

  .panel {
    padding: 16px;
  }
}

/* Production polish: brand, dropdown, attendance, catalog, commissions */
.brand-logo {
  display: block;
  object-fit: contain;
}

.auth-logo {
  width: 76px;
  height: 56px;
}

.topbar-logo {
  width: auto;
  height: 44px;
  max-width: 190px;
}

.service-brand .brand-fallback {
  font-size: 14px;
}

.nav-more {
  position: relative;
}

.nav-more > button {
  min-height: 46px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  color: #475467;
  padding: 10px 16px;
  font-weight: 800;
}

.nav-more.is-active > button,
.nav-more > button:hover {
  background: #f2f6fc;
  color: var(--blue-dark);
}

.nav-more-menu {
  position: fixed;
  left: var(--more-menu-left, 12px);
  top: var(--more-menu-top, 74px);
  width: var(--more-menu-width, 240px);
  z-index: 80;
  min-width: 230px;
  padding: 8px;
  border: 1px solid #dfe8f5;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 20px 45px rgba(15, 32, 60, 0.14);
}

.nav-more-menu button {
  width: 100%;
  justify-content: flex-start;
  border-radius: 12px;
  background: transparent;
  color: #334155;
}

.nav-more-menu button:hover,
.nav-more-menu button.is-active {
  background: #edf5ff;
  color: var(--blue-dark);
}

.mini-danger {
  min-height: 34px;
  padding: 6px 11px;
  border-radius: 12px;
  font-size: 12px;
}

.panel-head-row,
.attendance-filter-row,
.catalog-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.attendance-filter-row label,
.catalog-toolbar input,
.catalog-toolbar select {
  flex: 1;
}

.attendance-table-wrap {
  overflow-x: visible;
}

.attendance-table th,
.attendance-table td {
  padding: 13px 12px;
}

.attendance-card-list {
  display: grid;
  gap: 10px;
}

.attendance-record-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid #e0e9f6;
  border-radius: 18px;
  background: #fff;
}

.attendance-record-main {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.attendance-record-card p {
  grid-column: 1 / -1;
  margin: 0;
  color: #667085;
}

.status-chip.info {
  background: #eaf2ff;
  color: #0b55c7;
}

.attendance-worker-row {
  border-radius: 18px;
  border: 1px solid #dfe8f5;
  background: #fff;
  box-shadow: 0 8px 20px rgba(15, 32, 60, 0.04);
}

.attendance-worker-row .status-button-row .small-button.is-active[data-attendance-status="present"] {
  background: #e9fbf2;
  color: #087443;
  border-color: #b7ecd1;
}

.attendance-worker-row .status-button-row .small-button.is-active[data-attendance-status="absent"] {
  background: #fff0ef;
  color: #b42318;
  border-color: #ffd1cc;
}

.attendance-worker-row .status-button-row .small-button.is-active[data-attendance-status="late"] {
  background: #fff6e6;
  color: #b35c00;
  border-color: #f8d99a;
}

.attendance-worker-row .status-button-row .small-button.is-active[data-attendance-status="half_day"] {
  background: #eaf2ff;
  color: #0b55c7;
  border-color: #c9dcff;
}

.catalog-page {
  align-items: start;
}

.catalog-form-card,
.catalog-list-card,
.commission-shell {
  border-radius: 24px;
}

.modern-catalog-list {
  display: grid;
  gap: 12px;
}

.modern-catalog-list .catalog-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  transition: 0.18s ease;
}

.modern-catalog-list .catalog-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(15, 32, 60, 0.07);
}

.catalog-main,
.worker-cell {
  display: grid;
  gap: 4px;
}

.catalog-badges {
  display: flex;
  gap: 8px;
  align-items: center;
}

.catalog-badge {
  border-radius: 999px;
  padding: 5px 10px;
  background: #eef5ff;
  color: #0b4fb5;
  font-size: 12px;
  font-weight: 900;
}

.catalog-price,
.earning-value {
  color: #12805c;
  font-weight: 950;
}

.month-card {
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #dfe8f5;
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(15, 32, 60, 0.06);
  display: inline-flex;
  gap: 10px;
  min-height: 52px;
  padding: 0 16px;
  position: relative;
}

.month-card input[type="month"] {
  border: 0;
  opacity: 0;
  position: absolute;
  inset: 0;
  cursor: pointer;
}

.month-icon,
.month-label {
  font-weight: 900;
}

.commission-page {
  display: grid;
  gap: 18px;
}

.commission-shell {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #dfe8f5;
  box-shadow: 0 20px 50px rgba(15, 32, 60, 0.08);
  padding: 22px;
}

.commission-card-head {
  margin-bottom: 18px;
}

.commission-card-head h3 {
  margin: 0;
  font-size: 22px;
}

.commission-card-head p {
  margin: 6px 0 0;
  color: #667085;
}

.commission-table {
  border: 1px solid #dfe8f5;
  border-radius: 18px;
  overflow-x: auto;
  background: #fff;
}

.commission-row {
  display: grid;
  grid-template-columns: minmax(120px, 1.1fr) minmax(110px, .9fr) minmax(140px, 1.2fr) minmax(110px, .9fr) minmax(110px, .85fr) minmax(140px, 1.2fr) minmax(160px, 1.25fr) minmax(160px, 1.25fr) minmax(95px, .65fr);
  gap: 14px;
  align-items: center;
  min-width: 1080px;
  padding: 14px 16px;
  border-bottom: 1px solid #e7eef8;
}

.commission-header {
  background: #f6f9fd;
  color: #536176;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.commission-input {
  width: 100%;
  min-height: 46px;
  border-radius: 14px;
}

.toggle-select {
  align-items: center;
  background: #f3f6fb;
  border: 1px solid #dce6f3;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  gap: 9px;
  min-height: 42px;
  padding: 6px 12px 6px 7px;
}

.toggle-select input {
  display: none;
}

.toggle-select span {
  background: #c3cad6;
  border-radius: 999px;
  display: inline-block;
  height: 20px;
  width: 36px;
  position: relative;
}

.toggle-select span::after {
  background: #fff;
  border-radius: 999px;
  content: "";
  height: 16px;
  left: 2px;
  position: absolute;
  top: 2px;
  transition: 0.18s ease;
  width: 16px;
}

.toggle-select.is-on span {
  background: #0f68d8;
}

.toggle-select.is-on span::after {
  transform: translateX(16px);
}

.money-card {
  align-items: center;
  background: #f7faff;
  border: 1px solid #e1eaf6;
  border-radius: 16px;
  display: flex;
  gap: 12px;
  min-height: 64px;
  padding: 10px 12px;
}

.money-icon,
.task-icon-badge {
  align-items: center;
  background: #eaf2ff;
  border-radius: 50%;
  color: #0f68d8;
  display: inline-flex;
  flex: 0 0 auto;
  font-weight: 900;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.preview-card.is-positive,
.worker-money-grid .metric-green,
.earning-strip {
  background: #f0fdf4;
  border-color: #dcfce7;
}

.worker-money-grid .metric-green .metric-icon,
.preview-card.is-positive .money-icon {
  background: #dcfce7;
  color: #16a34a;
}

.worker-money-grid .metric-green strong,
.preview-card.is-positive strong {
  color: #15803d;
}

.save-commission-button {
  width: 100%;
  min-height: 42px;
  border-radius: 14px;
  border: 1px solid #d6e5fb;
  background: #f4f8ff;
  color: #0b4ea2;
  font-weight: 900;
}

.worker-report-link {
  border: 0;
  background: transparent;
  color: #0b55c7;
  cursor: pointer;
  font: inherit;
  font-weight: 950;
  padding: 0;
  text-align: left;
}

.worker-report-link:hover {
  text-decoration: underline;
}

.app-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(8px);
}

.app-modal {
  position: relative;
  width: min(860px, 100%);
  max-height: min(86vh, 900px);
  overflow: auto;
  border: 1px solid #dfe8f5;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(15, 32, 60, 0.22);
  padding: 24px;
}

.app-modal h3 {
  margin: 0 40px 16px 0;
  font-size: 24px;
  letter-spacing: -0.03em;
}

.modal-close {
  position: absolute;
  right: 16px;
  top: 14px;
  width: 38px;
  height: 38px;
  border: 1px solid #dfe8f5;
  border-radius: 50%;
  background: #f8fbff;
  cursor: pointer;
  font-size: 24px;
}

.modal-body {
  display: grid;
  gap: 14px;
}

.modal-warning {
  border: 1px solid #fed7aa;
  border-radius: 16px;
  background: #fff7ed;
  color: #9a3412;
  padding: 12px 14px;
  font-weight: 800;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.report-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.report-summary-grid div,
.worker-report-job {
  border: 1px solid #e0e9f6;
  border-radius: 18px;
  background: #f8fbff;
  padding: 14px;
}

.report-summary-grid span,
.worker-report-job span {
  display: block;
  color: #667085;
  font-size: 12px;
  font-weight: 850;
}

.worker-report-list {
  display: grid;
  gap: 10px;
}

.worker-report-job {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(180px, 1.4fr) repeat(3, minmax(80px, 0.6fr));
  gap: 12px;
  align-items: start;
  background: #fff;
}

.calc-strip[data-row-calc] {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  background: #f7fbff;
  border: 1px solid #dce8fb;
  border-radius: 14px;
  padding: 12px 14px;
}

.calc-strip[data-row-calc] strong {
  color: #12805c;
}

.calc-strip[data-row-calc] small {
  color: #b45309;
  font-weight: 800;
}

@media (max-width: 760px) {
  .panel-head-row,
  .attendance-filter-row,
  .catalog-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .modern-catalog-list .catalog-card {
    grid-template-columns: 1fr;
  }

  .nav-more-menu {
    width: min(260px, calc(100vw - 24px));
    max-width: calc(100vw - 32px);
  }

  .report-summary-grid,
  .worker-report-job,
  .attendance-record-card {
    grid-template-columns: 1fr;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }
}

/* Final nav popover override: keep More menu out of navbar layout */
html,
body {
  overflow-x: hidden;
}

.main-nav {
  overflow: visible !important;
}

@media (max-width: 980px) {
  .main-nav {
    overflow: visible !important;
    flex-wrap: wrap !important;
  }
}

.nav-more-menu {
  display: none !important;
}

.nav-popover-menu {
  position: fixed;
  z-index: 300;
  padding: 8px;
  border: 1px solid #dfe8f5;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 20px 45px rgba(15, 32, 60, 0.14);
}

.nav-popover-menu button {
  width: 100%;
  min-height: 42px;
  justify-content: flex-start;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #334155;
  padding: 9px 12px;
  font-weight: 850;
  text-align: left;
}

.nav-popover-menu button:hover,
.nav-popover-menu button.is-active {
  background: #edf5ff;
  color: var(--blue-dark);
}

/* Worker dashboard premium pass */
.worker-dashboard-grid .metric-card {
  position: relative;
  overflow: hidden;
  min-height: 128px;
  align-items: center;
}

.worker-dashboard-grid .metric-card::after {
  content: "";
  position: absolute;
  right: -28px;
  top: -28px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: rgba(18, 103, 227, 0.06);
}

.worker-dashboard-grid .metric-icon {
  width: 56px;
  height: 56px;
  font-size: 24px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.worker-dashboard-grid .metric-green {
  border-color: #ccefdc;
  background:
    radial-gradient(circle at top right, rgba(34, 197, 94, 0.10), transparent 110px),
    linear-gradient(180deg, #ffffff, #fbfffd);
}

.worker-dashboard-grid .metric-green .metric-icon {
  background: #dcfce7;
  color: #15803d;
}

.worker-dashboard-grid .metric-green .metric-content strong {
  color: #087443;
}

.worker-dashboard-grid .metric-blue .metric-icon,
.worker-dashboard-grid .metric-cyan .metric-icon,
.worker-dashboard-grid .metric-purple .metric-icon {
  background: #eaf2ff;
}

.worker-dashboard-panels {
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
}

.worker-assigned-panel,
.worker-target-panel {
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(255, 255, 255, 0.92));
}

.panel-title-with-icon {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.panel-title-with-icon span {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: #eaf2ff;
  color: #0b55c7;
  font-size: 18px;
}

.panel-title-with-icon h3 {
  margin: 0;
}

.worker-empty-state {
  display: grid;
  gap: 6px;
  padding: 24px;
  border-style: dashed;
  background: #f8fbff;
}

.worker-empty-state strong {
  color: #344054;
}

.worker-empty-state small {
  color: #667085;
}

.worker-target-panel {
  display: grid;
  align-content: start;
  gap: 16px;
}

.target-score {
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px solid #dbeafe;
  border-radius: 18px;
  background: linear-gradient(135deg, #f7fbff, #eef7ff);
}

.target-score strong {
  color: #0b55c7;
  font-size: 42px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.target-score small {
  color: #667085;
  font-weight: 800;
}

.worker-target-panel .progress-shell {
  height: 12px;
  border-radius: 999px;
  background: #e6edf7;
}

.worker-target-panel .progress-shell span {
  background: linear-gradient(90deg, #1267e3, #16a34a);
  box-shadow: 0 0 18px rgba(22, 163, 74, 0.18);
}

.worker-target-panel .progress-label {
  color: #087443;
  font-weight: 950;
}

.worker-target-panel .earning-strip {
  display: grid;
  gap: 4px;
  padding: 16px;
}

.worker-target-panel .earning-strip strong {
  color: #087443;
  font-size: 30px;
  letter-spacing: -0.03em;
}

@media (max-width: 980px) {
  .worker-dashboard-panels {
    grid-template-columns: 1fr;
  }
}

/* Service workspace cleanup */
.service-workspace {
  grid-template-columns: minmax(320px, 0.78fr) minmax(0, 1.22fr);
  gap: 18px;
  align-items: start;
}

.service-detail-pane {
  overflow: hidden;
}

.service-car {
  border-color: #dbe7f6;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
}

.service-car.is-selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(18, 103, 227, 0.1), var(--shadow-soft);
}

.service-car .job-head {
  align-items: flex-start;
}

.service-car .metric-row {
  gap: 8px;
}

.service-car .metric-row span {
  background: #f6f9fd;
  color: #526071;
}

.service-detail-pane > .job-head {
  align-items: flex-start;
  border-bottom: 1px solid #edf2f8;
  margin-bottom: 14px;
  padding-bottom: 14px;
}

.service-detail-pane .soft-strip {
  margin-bottom: 14px;
}

.compact-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 18px;
}

.compact-summary .metric-card {
  min-height: 100px;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
}

.compact-summary .metric-icon {
  width: 42px;
  height: 42px;
  font-size: 18px;
}

.compact-summary .metric-content {
  min-width: 0;
}

.compact-summary .metric-content span {
  font-size: 12px;
}

.compact-summary .metric-content strong {
  font-size: 24px;
  line-height: 1.06;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.simple-section {
  background: #ffffff;
  border-color: #dce7f5;
  box-shadow: 0 6px 18px rgba(15, 32, 60, 0.035);
}

.simple-section > summary {
  align-items: center;
  color: #172033;
  display: flex;
  font-weight: 900;
  justify-content: space-between;
}

.linked-inspection {
  background: #fbfdff;
  border-color: #dce7f5;
}

.more-menu > summary {
  min-width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  border-radius: 16px;
}

@media (max-width: 1120px) {
  .compact-summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .service-workspace {
    grid-template-columns: 1fr;
  }

  .compact-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .compact-summary {
    grid-template-columns: 1fr;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(15, 104, 216, 0.07), transparent 280px),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}

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

button {
  cursor: pointer;
}

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

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

[hidden] {
  display: none !important;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-panel {
  width: min(420px, 100%);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

.brand-row,
.service-brand,
.session-box,
.topbar,
.main-nav,
.page-title-row,
.page-actions,
.form-actions,
.row-actions,
.job-head,
.metric-row,
.check-row,
.contribution-row {
  display: flex;
  align-items: center;
}

.brand-row {
  gap: 14px;
  margin-bottom: 24px;
}

.brand-row h1 {
  margin: 0;
  font-size: 24px;
}

.brand-row p,
.kicker,
.muted,
.message,
small {
  color: var(--muted);
}

.brand-row p {
  margin: 3px 0 0;
}

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

.stack-form,
.form-grid {
  display: grid;
  gap: 14px;
}

.stack-form label,
.form-grid label,
.filter-field {
  display: grid;
  gap: 7px;
  color: #334155;
  font-size: 13px;
  font-weight: 650;
}

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

textarea {
  min-height: 92px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(15, 104, 216, 0.14);
}

.primary-button,
.ghost-button,
.small-button,
.danger-button {
  border: 0;
  border-radius: var(--radius);
  min-height: 40px;
  padding: 10px 14px;
  font-weight: 750;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

.primary-button {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 10px 22px rgba(15, 104, 216, 0.22);
}

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

.ghost-button,
.small-button {
  background: #edf4ff;
  color: var(--blue-dark);
  border: 1px solid #d5e7ff;
}

.danger-button {
  background: #fff1f1;
  color: var(--red);
  border: 1px solid #ffd0d0;
}

.primary-button:active,
.ghost-button:active,
.small-button:active,
.danger-button:active {
  transform: translateY(1px);
}

.message {
  min-height: 22px;
  margin: 12px 0 0;
  font-size: 14px;
}

.message.is-error {
  color: var(--red);
}

.message.is-success {
  color: var(--green);
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  justify-content: space-between;
  min-height: 64px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(219, 228, 240, 0.82);
}

.service-brand {
  gap: 10px;
  font-size: 18px;
}

.brand-dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 7px rgba(15, 104, 216, 0.12);
}

.session-box {
  gap: 12px;
  font-weight: 750;
}

.main-nav {
  gap: 8px;
  padding: 12px 24px 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.main-nav button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  color: #314158;
  min-height: 38px;
  padding: 8px 12px;
  white-space: nowrap;
  font-weight: 700;
}

.main-nav select {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  color: #314158;
  min-height: 38px;
  padding: 8px 12px;
  white-space: nowrap;
  font-weight: 700;
  width: auto;
}

.main-nav button.is-active,
.main-nav select.is-active {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

.page {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 0 46px;
}

.page-title-row {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.page-title-row h2 {
  margin: 2px 0 0;
  font-size: 28px;
}

.kicker {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.page-actions {
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metric-card,
.panel,
.job-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 16px;
  min-height: 112px;
}

.metric-card span,
.metric-row span,
.status-chip,
.progress-label,
.table-wrap small,
.job-card small {
  font-size: 12px;
}

.metric-card span {
  color: var(--muted);
  font-weight: 800;
}

.metric-card strong {
  display: block;
  margin-top: 10px;
  font-size: 26px;
}

.metric-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(310px, 0.65fr);
  gap: 16px;
}

.service-workspace {
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(0, 1.2fr);
  gap: 16px;
}

.panel {
  padding: 18px;
  min-width: 0;
}

.panel h3 {
  margin: 0 0 14px;
  font-size: 18px;
}

.panel + .panel {
  margin-top: 16px;
}

.wide-panel {
  grid-column: 1 / -1;
}

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

.job-card {
  padding: 15px;
  display: grid;
  gap: 12px;
}

.job-card.is-selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(15, 104, 216, 0.12), var(--shadow);
}

.job-head {
  justify-content: space-between;
  gap: 14px;
}

.job-head h3,
.job-head h4 {
  margin: 0;
}

.job-head small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  font-weight: 800;
  color: #21405f;
  background: #e8f1ff;
  white-space: nowrap;
}

.status-chip.active {
  background: #e5f8f0;
  color: var(--green);
}

.status-chip.pending {
  background: #fff4dc;
  color: var(--amber);
}

.status-chip.done {
  background: #e8fff1;
  color: var(--green);
}

.status-chip.inactive {
  background: #fff0f0;
  color: var(--red);
}

.metric-row {
  gap: 8px;
  flex-wrap: wrap;
}

.metric-row span {
  background: #f3f7fc;
  border: 1px solid #e3ebf5;
  border-radius: var(--radius);
  padding: 6px 8px;
  color: #415066;
}

.progress-shell {
  width: 100%;
  height: 8px;
  background: #e6edf6;
  border-radius: 999px;
  overflow: hidden;
}

.progress-shell span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--blue), #18a174);
  border-radius: inherit;
}

.progress-label {
  color: var(--muted);
  font-weight: 750;
}

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

.form-grid .wide,
.form-actions.wide,
.wide {
  grid-column: 1 / -1;
}

.form-actions {
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.task-grid,
.skill-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.task-grid label,
.skill-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  background: #f7fbff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  color: #314158;
  font-weight: 750;
}

.task-grid input,
.skill-grid input {
  width: 16px;
  min-height: 16px;
  padding: 0;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

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

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

th {
  color: #49566b;
  background: #f5f8fc;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

td small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

tr:last-child td {
  border-bottom: 0;
}

.row-actions {
  gap: 7px;
  flex-wrap: wrap;
}

.empty-state {
  border: 1px dashed #c9d6e6;
  background: #f7fbff;
  border-radius: var(--radius);
  padding: 18px;
  color: var(--muted);
  font-weight: 700;
}

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

.check-row {
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #fbfdff;
}

.check-row > input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  margin-top: 3px;
}

.check-body {
  display: grid;
  gap: 8px;
  width: 100%;
}

.check-body strong {
  line-height: 1.3;
}

.check-body img {
  width: 92px;
  height: 68px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
}

.recommend-box {
  display: grid;
  gap: 10px;
}

.recommend-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #f9fcff;
}

.recommend-card strong,
.recommend-card small {
  display: block;
}

.recommend-score {
  margin-top: 8px;
}

.contribution-row {
  gap: 8px;
  margin-bottom: 8px;
}

.contribution-row select {
  min-width: 180px;
}

.contribution-row input {
  max-width: 120px;
}

.split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.compact-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 12px 0;
}

.simple-section,
.more-menu,
.quick-service-form {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
}

.simple-section {
  margin-top: 10px;
}

.simple-section > summary,
.more-menu > summary {
  list-style: none;
  cursor: pointer;
  padding: 12px;
  font-weight: 850;
}

.simple-section > summary::-webkit-details-marker,
.more-menu > summary::-webkit-details-marker {
  display: none;
}

.simple-section > *:not(summary) {
  margin: 0 12px 12px;
}

.more-menu {
  position: relative;
  padding: 0;
}

.more-menu[open] {
  z-index: 2;
}

.more-menu button {
  display: block;
  width: 100%;
  border: 0;
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
  text-align: left;
}

.quick-service-form {
  display: grid;
  gap: 10px;
  padding: 12px;
  margin-top: 10px;
}

.quick-service-form h3 {
  margin: 0;
  font-size: 15px;
}

.template-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.attendance-quick-list,
.worker-checkbox-grid {
  display: grid;
  gap: 8px;
}

.attendance-worker-row {
  align-items: center;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(160px, 1fr) auto minmax(150px, 0.7fr);
  padding: 10px;
}

.attendance-worker-row small,
.check-card span {
  color: var(--muted);
}

.check-card {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  gap: 8px;
  padding: 10px;
}

.worker-checkbox-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.monthly-worker-report-print {
  display: none;
  margin-top: 14px;
}

.worker-month-section {
  break-inside: avoid;
  page-break-inside: avoid;
}

.checklist-toolbar {
  margin-bottom: 10px;
}

.service-part-picker {
  display: grid;
  gap: 8px;
}

.service-part-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.service-part-choice {
  align-items: center;
  background: #f8fbff;
  border: 1px solid #dce7f5;
  border-radius: 14px;
  display: flex;
  gap: 9px;
  padding: 10px;
}

.add-service-row-box {
  background: #fbfdff;
  border: 1px dashed #bfd0e8;
  border-radius: var(--radius);
  margin-bottom: 12px;
  padding: 10px;
}

.add-service-row-box > summary {
  cursor: pointer;
  font-weight: 900;
}

.legacy-task-picker {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
}

.row-photo-preview {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  max-height: 180px;
  object-fit: cover;
  width: 100%;
}

.approval-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.approval-actions-panel {
  background: #fff8e8;
  border: 1px solid #f4d59d;
  border-radius: var(--radius);
  padding: 12px;
}

.status-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-button-row .small-button.is-active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.soft-strip {
  background: var(--panel-soft);
  border: 1px solid #d8e9ff;
  border-radius: var(--radius);
  padding: 12px;
}

.inspection-items,
.service-section-list,
.service-row-list,
.catalog-list,
.alert-list,
.warning-list,
.note-list {
  display: grid;
  gap: 10px;
}

.inspection-item,
.inspection-card,
.catalog-card,
.alert-row,
.warning-card,
.damage-card,
.note-card,
.cleanup-row,
.linked-inspection {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
  padding: 12px;
}

.inspection-item,
.inspection-card-body {
  display: grid;
  gap: 10px;
}

.inspection-card {
  padding: 0;
}

.inspection-card summary,
.linked-inspection summary,
.problem-picker summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  padding: 12px;
}

.inspection-card summary::-webkit-details-marker,
.linked-inspection summary::-webkit-details-marker,
.problem-picker summary::-webkit-details-marker {
  display: none;
}

.inspection-card-body {
  padding: 0 12px 12px;
}

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

.condition-choice {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  padding: 8px;
  font-weight: 800;
  color: #334155;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.condition-choice.compact {
  min-height: 34px;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
}

.condition-grid.tight {
  grid-template-columns: repeat(3, max-content);
}

.condition-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.condition-choice.green:has(input:checked) {
  background: #e8fff1;
  border-color: #8ed9b6;
  color: var(--green);
}

.condition-choice.orange:has(input:checked) {
  background: #fff4dc;
  border-color: #ffd08a;
  color: var(--amber);
}

.condition-choice.red:has(input:checked) {
  background: #fff0f0;
  border-color: #ffb2b2;
  color: var(--red);
}

.condition-choice:hover,
.service-row:hover,
.catalog-card:hover,
.job-card:hover {
  transform: translateY(-1px);
}

.service-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

.service-section > summary,
.service-row > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  font-weight: 850;
}

.service-section > summary {
  background: #f5f8fc;
}

.service-section > summary::-webkit-details-marker,
.service-row > summary::-webkit-details-marker {
  display: none;
}

.service-row {
  border: 1px solid #edf2f8;
  border-radius: var(--radius);
  background: #fbfdff;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.service-row-body {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 0 14px 14px;
}

.service-row-body .wide,
.calc-strip.wide,
.history-strip.wide {
  grid-column: 1 / -1;
}

.condition-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 auto;
}

.condition-dot.green {
  background: var(--green);
}

.condition-dot.orange {
  background: var(--amber);
}

.condition-dot.red {
  background: var(--red);
}

.calc-strip,
.history-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  border: 1px solid #e3ebf5;
  border-radius: var(--radius);
  background: #f7fbff;
  padding: 10px;
}

.catalog-card,
.alert-row,
.cleanup-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.cleanup-list,
.inspection-summary-grid {
  display: grid;
  gap: 10px;
}

.problem-picker {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.problem-picker label {
  display: block;
  padding: 8px 12px;
}

.inspection-summary-grid {
  padding: 0 12px 12px;
}

.inspection-summary-grid > div {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 8px;
  align-items: center;
}

.inspection-summary-grid small {
  grid-column: 2;
}

.clickable-card {
  cursor: pointer;
}

.alert-row {
  width: 100%;
  text-align: left;
}

.warning-badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 850;
  background: #eef5ff;
  color: #21405f;
}

.warning-badge.level-1,
.warning-card.level-1,
.alert-row.warning-1 {
  background: #fff4dc;
  color: var(--amber);
}

.warning-badge.level-2,
.warning-card.level-2,
.alert-row.warning-2 {
  background: #ffe8dc;
  color: #b94900;
}

.warning-badge.level-3,
.warning-card.level-3,
.alert-row.warning-3,
.danger-strip {
  background: #fff0f0;
  color: var(--red);
  border-color: #ffb2b2;
}

.danger-strip {
  border: 1px solid #ffb2b2;
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 14px;
  font-weight: 850;
}

.compact-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 10px;
}

.note-card.urgent {
  border-color: #ffb2b2;
  background: #fff0f0;
}

.note-card p,
.warning-card p,
.damage-card p {
  margin: 6px 0;
}

.final-report {
  margin-top: 16px;
}

.print-report-holder {
  display: none;
}

.ae-report-sheet {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--shadow);
  color: #111827;
  margin: 0 auto;
  min-height: 297mm;
  padding: 14mm;
  width: min(100%, 210mm);
}

.ae-report-header {
  align-items: flex-start;
  border-bottom: 2px solid #111827;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 14px;
}

.ae-report-brand {
  align-items: center;
  display: flex;
  gap: 12px;
}

.ae-report-logo {
  align-items: center;
  background: var(--blue);
  border-radius: 6px;
  color: #fff;
  display: grid;
  font-weight: 900;
  height: 44px;
  justify-items: center;
  letter-spacing: 0;
  width: 44px;
}

.ae-report-brand h2,
.ae-report-section h3 {
  margin: 0;
}

.ae-report-brand p,
.ae-report-meta span,
.ae-report-info-grid span,
.ae-report-mini-grid span,
.ae-report-footer,
.ae-report-table td span,
.ae-report-table small {
  color: #64748b;
}

.ae-report-meta {
  display: grid;
  gap: 4px;
  font-size: 12px;
  justify-items: end;
  text-align: right;
}

.ae-report-section {
  margin-top: 16px;
}

.ae-report-section-title {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.ae-report-info-grid,
.ae-report-mini-grid {
  display: grid;
  gap: 8px;
}

.ae-report-info-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ae-report-mini-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 10px;
}

.ae-report-info-grid > div,
.ae-report-mini-grid > div,
.ae-report-callout,
.ae-report-notes > div {
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: 9px;
}

.ae-report-info-grid span,
.ae-report-mini-grid span {
  display: block;
  font-size: 11px;
  margin-bottom: 4px;
}

.ae-report-callout {
  display: grid;
  gap: 5px;
}

.ae-report-table {
  border-collapse: collapse;
  font-size: 12px;
  width: 100%;
}

.ae-report-table th,
.ae-report-table td {
  border: 1px solid #e5e7eb;
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

.ae-report-table th {
  background: #f3f6fb;
  color: #334155;
  font-size: 11px;
  text-transform: uppercase;
}

.ae-report-table td strong,
.ae-report-table td span,
.ae-report-table small {
  display: block;
}

.ae-report-table .num,
.ae-report-total {
  text-align: right;
}

.ae-condition-pill {
  border-radius: 999px;
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
}

.ae-condition-pill.green {
  background: #e7f7ef;
  color: #13724f;
}

.ae-condition-pill.orange {
  background: #fff1d6;
  color: #9b5800;
}

.ae-condition-pill.red {
  background: #ffe4e4;
  color: #a72626;
}

.ae-report-notes {
  display: grid;
  gap: 8px;
}

.ae-report-notes p {
  margin: 5px 0;
}

.ae-report-total {
  align-items: center;
  background: #eef5ff;
  border: 1px solid #cfe1ff;
  border-radius: 4px;
  display: flex;
  justify-content: flex-end;
  gap: 18px;
  margin-top: 18px;
  padding: 12px;
}

.ae-report-total strong {
  font-size: 24px;
}

.ae-report-footer {
  border-top: 1px solid #e5e7eb;
  display: flex;
  font-size: 11px;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
  padding-top: 10px;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.report-grid > div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  display: grid;
  gap: 4px;
}

.print-only {
  display: none;
}

@page {
  size: A4;
  margin: 12mm;
}

@media print {
  body {
    background: #fff !important;
  }

  body * {
    visibility: hidden;
  }

  .print-report-holder {
    display: block !important;
  }

  .monthly-worker-report-print {
    display: block !important;
  }

  .ae-report-sheet,
  .ae-report-sheet * {
    visibility: visible;
  }

  .ae-report-sheet {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    left: 0;
    margin: 0;
    min-height: auto;
    padding: 0;
    position: absolute;
    top: 0;
    width: 186mm;
  }

  #printReportBtn,
  .topbar,
  .main-nav,
  .page-title-row,
  .final-report > .job-head {
    display: none !important;
  }
}

@media (max-width: 980px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-grid,
  .service-workspace,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .form-grid,
  .task-grid,
  .skill-grid,
  .condition-grid,
  .service-row-body,
  .report-grid,
  .worker-checkbox-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .attendance-worker-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .topbar {
    padding: 10px 14px;
  }

  .main-nav {
    padding: 10px 14px 0;
    display: grid;
    grid-template-columns: 1fr;
  }

  .main-nav button,
  .main-nav select {
    width: 100%;
  }

  .page {
    width: min(100% - 20px, 1220px);
    padding-top: 18px;
  }

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

  .page-title-row h2 {
    font-size: 24px;
  }

  .summary-grid,
  .compact-summary,
  .form-grid,
  .task-grid,
  .skill-grid,
  .split-grid,
  .condition-grid,
  .service-row-body,
  .report-grid,
  .worker-checkbox-grid,
  .compact-form {
    grid-template-columns: 1fr;
  }

  .condition-grid.tight {
    grid-template-columns: 1fr;
  }

  .metric-card strong {
    font-size: 23px;
  }

  .job-head,
  .session-box {
    align-items: flex-start;
    flex-direction: column;
  }

  .session-box {
    gap: 7px;
  }

  .auth-panel,
  .panel,
  .job-card {
    padding: 15px;
  }

  .contribution-row {
    align-items: stretch;
    flex-direction: column;
  }

  .contribution-row select,
  .contribution-row input {
    min-width: 0;
    max-width: none;
  }
}

/* Final dashboard polish overrides */
:root {
  --bg: #f5f8fc;
  --panel: #ffffff;
  --panel-soft: #f1f6ff;
  --text: #111827;
  --muted: #667085;
  --line: #dfe7f2;
  --blue: #1267e3;
  --blue-dark: #0b4fb5;
  --green: #14915f;
  --amber: #d48512;
  --red: #d92d20;
  --purple: #7c3aed;
  --cyan: #0891b2;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 18px 45px rgba(15, 32, 60, 0.08);
  --shadow-soft: 0 8px 26px rgba(15, 32, 60, 0.06);
}

body {
  background:
    radial-gradient(circle at top left, rgba(18, 103, 227, 0.08), transparent 360px),
    linear-gradient(180deg, #f8fbff 0%, #f3f7fc 100%);
  color: var(--text);
}

.topbar,
.main-nav {
  width: min(1320px, calc(100% - 28px));
  margin-left: auto;
  margin-right: auto;
  border: 1px solid rgba(223, 231, 242, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.topbar {
  margin-top: 14px;
}

.main-nav {
  margin-top: 12px;
  padding: 10px;
  gap: 8px;
}

.main-nav button,
.main-nav select {
  min-height: 46px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  color: #475467;
  padding: 10px 16px;
  font-weight: 800;
  transition: 0.18s ease;
}

.main-nav button:hover,
.main-nav select:hover {
  background: #f2f6fc;
  color: var(--blue-dark);
}

.main-nav button.is-active,
.main-nav select.is-active {
  color: #fff;
  background: linear-gradient(135deg, #1267e3, #0b55c7);
  border-color: #1267e3;
  box-shadow: 0 14px 24px rgba(18, 103, 227, 0.25);
}

.brand-dot {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(135deg, #1d75ff, #0b4fb5);
  box-shadow: 0 10px 22px rgba(18, 103, 227, 0.24);
}

.service-brand {
  gap: 12px;
}

.service-brand strong {
  letter-spacing: 0.04em;
}

.session-box {
  background: #f4f8ff;
  border: 1px solid #e3ebf7;
  padding: 8px 10px;
  border-radius: 999px;
}

.session-box #workerName {
  font-size: 14px;
  font-weight: 800;
}

.page {
  width: min(1220px, calc(100% - 32px));
  padding-top: 36px;
}

.page-title-row {
  margin-bottom: 26px;
}

.kicker {
  color: #6b7a90;
  font-size: 14px;
  text-transform: none;
  letter-spacing: 0;
}

.page-title-row h2 {
  font-size: clamp(32px, 4vw, 46px);
  letter-spacing: -0.04em;
  line-height: 1;
}

.summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.metric-card {
  min-height: 132px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid rgba(223, 231, 242, 0.95);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.88));
  box-shadow: var(--shadow-soft);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.metric-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: #cfdced;
}

.metric-icon {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 25px;
  font-weight: 900;
}

.metric-content span {
  display: block;
  color: #536176;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
}

.metric-content strong {
  display: block;
  margin-top: 8px;
  font-size: 32px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.metric-content small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.metric-blue .metric-icon { background: #eaf2ff; color: var(--blue); }
.metric-amber .metric-icon { background: #fff4df; color: var(--amber); }
.metric-green .metric-icon { background: #e9fbf2; color: var(--green); }
.metric-red .metric-icon { background: #fff0ef; color: var(--red); }
.metric-purple .metric-icon { background: #f3eefe; color: var(--purple); }
.metric-cyan .metric-icon { background: #e9fbff; color: var(--cyan); }

.content-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(330px, 0.65fr);
  gap: 22px;
}

.panel,
.job-card {
  border-radius: var(--radius);
  border: 1px solid rgba(223, 231, 242, 0.95);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
}

.panel {
  padding: 22px;
}

.job-card {
  padding: 18px;
  box-shadow: none;
  background: #fff;
  transition: 0.18s ease;
}

.job-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(15, 32, 60, 0.07);
  border-color: #cdd9eb;
}

.status-chip,
.metric-row span {
  border-radius: 999px;
  font-weight: 900;
}

.metric-row span {
  background: #f4f7fb;
  border: 1px solid #e4ebf5;
  color: #526071;
  padding: 7px 11px;
}

.progress-shell {
  height: 8px;
  background: #e8eef7;
}

.progress-shell span {
  background: linear-gradient(90deg, #1267e3, #22c55e);
}

.soft-strip {
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #f7faff, #eef5ff);
  border: 1px solid #dce8fb;
}

input,
select,
textarea,
.primary-button,
.ghost-button,
.small-button,
.danger-button {
  border-radius: 14px;
}

.primary-button,
.ghost-button,
.small-button,
.danger-button {
  min-height: 44px;
  font-weight: 850;
}

.primary-button {
  background: linear-gradient(135deg, #1267e3, #0b55c7);
  box-shadow: 0 14px 24px rgba(18, 103, 227, 0.25);
}

.ghost-button,
.small-button {
  background: #f4f8ff;
  color: var(--blue-dark);
  border: 1px solid #dce8fb;
}

@media (max-width: 980px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-grid,
  .service-workspace,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .main-nav {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .main-nav button,
  .main-nav select {
    white-space: nowrap;
  }
}

@media (max-width: 640px) {
  .topbar,
  .main-nav,
  .page {
    width: min(100% - 20px, 100%);
  }

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

  .metric-card {
    min-height: 110px;
    padding: 18px;
  }

  .metric-icon {
    width: 48px;
    height: 48px;
    font-size: 20px;
  }

  .metric-content strong {
    font-size: 28px;
  }

  .page-title-row h2 {
    font-size: 34px;
  }

  .panel {
    padding: 16px;
  }
}
/* Helper colleague requests */
.helper-request-panel {
  margin-bottom: 22px;
}

.helper-request-list {
  display: grid;
  gap: 12px;
}

.helper-request-card {
  align-items: center;
  background: #fff;
  border: 1px solid #dfe8f5;
  border-radius: 18px;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 14px;
  box-shadow: 0 10px 24px rgba(15, 32, 60, 0.05);
}

.helper-request-card h4,
.helper-request-card p {
  margin: 6px 0 0;
}

.helper-request-card small {
  color: #667085;
  display: block;
  margin-top: 5px;
}

.helper-request-box {
  background: #f7faff;
  border: 1px solid #dce8fb;
  border-radius: 16px;
  padding: 12px;
}

.helper-request-box summary {
  color: #0b4fb5;
  cursor: pointer;
  font-weight: 900;
}

.helper-admin-actions {
  align-items: center;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.helper-admin-actions input {
  max-width: 100px;
}

.compact-helper {
  box-shadow: none;
  background: #f8fbff;
}

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

  .helper-admin-actions,
  .helper-request-card .row-actions {
    justify-content: stretch;
  }

  .helper-admin-actions button,
  .helper-request-card .row-actions button {
    width: 100%;
  }
}
/* Mobile app responsiveness and realtime notification UI */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: clip;
}

img,
svg,
video,
canvas {
  max-width: 100%;
}

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

.notification-bell {
  align-items: center;
  background: #f4f8ff;
  border: 1px solid #dce8fb;
  border-radius: 999px;
  color: #0b4fb5;
  cursor: pointer;
  display: inline-flex;
  height: 42px;
  justify-content: center;
  min-width: 42px;
  position: relative;
}

.notification-bell span {
  align-items: center;
  background: #d92d20;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 11px;
  font-weight: 900;
  height: 20px;
  justify-content: center;
  min-width: 20px;
  padding: 0 5px;
  position: absolute;
  right: -5px;
  top: -5px;
}

.notification-popover {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #dfe8f5;
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(15, 32, 60, 0.16);
  display: grid;
  gap: 8px;
  max-height: min(520px, calc(100vh - 120px));
  overflow: auto;
  padding: 10px;
  position: fixed;
  z-index: 10000;
}

.notification-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  padding: 6px 6px 10px;
}

.notification-item {
  background: #fff;
  border: 1px solid #e4edf8;
  border-radius: 14px;
  color: #172033;
  cursor: pointer;
  display: grid;
  gap: 4px;
  min-height: 64px;
  padding: 12px;
  text-align: left;
  width: 100%;
}

.notification-item.is-unread {
  background: #f0f7ff;
  border-color: #cfe2fb;
}

.notification-item span,
.notification-item small {
  color: #667085;
}

@media (max-width: 1024px) {
  .page,
  .topbar,
  .main-nav {
    width: min(100% - 24px, 100%);
  }

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

  .content-grid,
  .service-workspace,
  .detail-grid,
  .catalog-layout,
  .reports-grid {
    grid-template-columns: 1fr;
  }

  .commission-row {
    min-width: 0;
  }
}

@media (max-width: 768px) {
  body {
    padding-bottom: calc(92px + env(safe-area-inset-bottom));
  }

  .topbar {
    align-items: center;
    border-radius: 0 0 22px 22px;
    margin: 0;
    min-height: 64px;
    padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
    width: 100%;
  }

  .topbar-logo {
    max-height: 36px;
    object-fit: contain;
  }

  .brand-fallback {
    display: none;
  }

  .session-box {
    gap: 7px;
    padding: 6px;
  }

  .session-box #workerName {
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .session-box .ghost-button {
    min-height: 38px;
    padding: 8px 10px;
  }

  .main-nav {
    align-items: center;
    backdrop-filter: blur(18px);
    background: rgba(255, 255, 255, 0.95);
    border-radius: 22px 22px 0 0;
    bottom: 0;
    box-shadow: 0 -12px 35px rgba(15, 32, 60, 0.12);
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    left: 0;
    margin: 0;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    position: fixed;
    right: 0;
    width: 100%;
    z-index: 9000;
  }

  .main-nav button,
  .main-nav select,
  .nav-more button {
    font-size: 12px;
    min-height: 46px;
    padding: 8px 6px;
    white-space: normal;
    width: 100%;
  }

  .nav-more {
    min-width: 0;
  }

  .page {
    padding-top: 22px;
    width: min(100% - 20px, 100%);
  }

  .page-title-row {
    align-items: stretch;
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
  }

  .page-title-row h2 {
    font-size: clamp(30px, 9vw, 38px);
    line-height: 1.05;
    overflow-wrap: anywhere;
  }

  .page-actions,
  .page-actions > * {
    width: 100%;
  }

  .summary-grid,
  .worker-dashboard-grid,
  .compact-summary {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .metric-card {
    min-height: 96px;
    padding: 16px;
  }

  .metric-icon {
    height: 46px;
    width: 46px;
  }

  .metric-content strong {
    font-size: 28px;
  }

  .panel,
  .job-card,
  .service-row,
  .inspection-card,
  .catalog-card,
  .warning-card,
  .damage-card,
  .note-card,
  .cleanup-row,
  .linked-inspection {
    border-radius: 18px;
    padding: 16px;
  }

  .job-head,
  .row-actions,
  .metric-row,
  .form-actions {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .row-actions > *,
  .form-actions > *,
  .job-card button,
  .primary-button,
  .ghost-button,
  .small-button,
  .danger-button {
    min-height: 46px;
  }

  .row-actions > button,
  .form-actions > button,
  .job-card .row-actions button {
    flex: 1 1 100%;
  }

  .form-grid,
  .inspection-form,
  .quick-service-form,
  .service-row-body,
  .stack-form {
    grid-template-columns: 1fr !important;
  }

  label,
  input,
  select,
  textarea {
    max-width: 100%;
    width: 100%;
  }

  input,
  select,
  textarea {
    font-size: 16px;
    min-height: 48px;
  }

  textarea {
    min-height: 96px;
  }

  .status-button-row {
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr;
  }

  .status-button-row button {
    min-height: 50px;
  }

  .table-wrap,
  .commission-table {
    border: 0;
    overflow: visible;
  }

  .table-wrap table,
  .table-wrap thead,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap th,
  .table-wrap td {
    display: block;
    width: 100%;
  }

  .table-wrap thead,
  .commission-header {
    display: none;
  }

  .table-wrap tr {
    background: #fff;
    border: 1px solid #dfe8f5;
    border-radius: 16px;
    margin-bottom: 10px;
    padding: 10px;
  }

  .table-wrap td {
    border: 0;
    padding: 8px 4px;
  }

  .commission-row {
    background: #fff;
    border: 1px solid #dfe8f5;
    border-radius: 18px;
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr;
    margin-bottom: 12px;
    min-width: 0;
    padding: 14px;
  }

  .commission-input,
  .save-commission-button,
  .money-card {
    width: 100%;
  }

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

  .app-modal {
    border-radius: 24px 24px 0 0;
    max-height: calc(92vh - env(safe-area-inset-top));
    overflow: auto;
    padding: 18px;
    width: 100%;
  }

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

  .nav-popover-menu,
  .notification-popover {
    left: 10px !important;
    max-height: calc(100vh - 130px);
    right: 10px;
    width: calc(100vw - 20px) !important;
  }
}

@media (max-width: 480px) {
  .main-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    gap: 8px;
  }

  .service-brand {
    min-width: 0;
  }

  .auth-panel {
    border-radius: 22px;
    margin: 10px;
    padding: 18px;
    width: calc(100% - 20px);
  }

  .panel,
  .job-card,
  .metric-card {
    box-shadow: 0 8px 24px rgba(15, 32, 60, 0.06);
  }

  .metric-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .helper-request-card,
  .attendance-entry-card,
  .catalog-list-card,
  .salary-job-card {
    align-items: stretch;
    flex-direction: column;
  }
}
