* {
  box-sizing: border-box;
}

:root {
  --bg: #f7f8fb;
  --panel: #ffffff;
  --text: #1d2939;
  --muted: #667085;
  --line: #e4e7ec;
  --line-soft: #e4e7ec;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --danger: #b42318;
  --success: #027a48;
  --tap: 48px;
  --soft: #eef4ff;
  --shadow: 0 10px 26px rgba(16, 24, 40, 0.06);
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

.page {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 20px 0 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(247, 248, 251, 0.98);
  box-shadow: 0 8px 22px rgba(16, 24, 40, 0.04);
}

.topbar strong,
.topbar span {
  display: block;
}

.topbar strong {
  font-size: 18px;
}

.topbar span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--primary);
  border-radius: 7px;
  background: #fff;
  color: var(--primary);
  font-weight: 900;
  text-decoration: none;
}
.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.user-chip-secondary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 5px 14px rgba(37, 99, 235, 0.14);
}

.user-chip-secondary:hover {
  background: var(--primary-dark);
  color: #fff;
}

.topnav {
  display: flex;
  gap: 8px;
  margin: 0 0 16px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(247, 248, 251, 0.98);
  box-shadow: 0 8px 22px rgba(16, 24, 40, 0.04);
}

.topnav a,
button,
.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 0 16px;
  border: 1px solid var(--primary);
  border-radius: 7px;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 5px 14px rgba(37, 99, 235, 0.14);
}

.button-secondary,
.topnav a {
  flex: 1 1 0;
  background: #fff;
  color: var(--primary);
  box-shadow: 0 4px 10px rgba(16, 24, 40, 0.04);
}

.topnav a.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 7px 18px rgba(37, 99, 235, 0.18);
}

.topnav a.active:hover {
  background: var(--primary-dark);
}

.button-secondary:hover,
.topnav a:hover,
.user-chip:hover,
.table-action:hover {
  border-color: var(--primary);
  background: var(--soft);
}

.panel {
  margin-bottom: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

h1,
h2 {
  margin: 0 0 16px;
  letter-spacing: 0;
  line-height: 1.25;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 18px;
}

.hint,
.empty {
  color: var(--muted);
}

.status {
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid #d0d7de;
  border-radius: 7px;
  background: #f8fafc;
  color: var(--muted);
  font-weight: 700;
}

.status.loading {
  border-color: #84caff;
  background: #eff8ff;
  color: #175cd3;
}

.status.success {
  border-color: #75e0a7;
  background: #ecfdf3;
  color: var(--success);
}

.status.error {
  border-color: #fda29b;
  background: #fffbfa;
  color: var(--danger);
}

.is-loading {
  opacity: 0.72;
}

button:disabled {
  opacity: 0.72;
  cursor: wait;
}

.notice {
  color: var(--danger);
  font-weight: 800;
}

.success {
  color: var(--success);
  font-weight: 800;
}

.upload-form,
.actions,
.section-title,
.calendar-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.section-title,
.calendar-toolbar {
  justify-content: space-between;
}

label {
  display: grid;
  gap: 7px;
  min-width: 0;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: var(--tap);
  padding: 10px 12px;
  border: 1px solid #d0d5dd;
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 16px;
}

input[type="file"] {
  padding: 9px;
}

input:focus,
select:focus,
button:focus,
.button-secondary:focus,
.topnav a:focus {
  outline: 3px solid rgba(31, 111, 235, 0.18);
  outline-offset: 2px;
}

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

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

.report-form .actions {
  margin-top: 18px;
}

.source-image {
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fbfcff;
}

.source-image-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

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

.modal-open {
  overflow: hidden;
}

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 18px;
}

.image-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 24, 40, 0.72);
}

.image-modal-panel {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(960px, 100%);
  max-height: calc(100vh - 36px);
  padding: 14px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(16, 24, 40, 0.28);
}

.image-modal-panel img {
  display: block;
  width: 100%;
  max-height: calc(100vh - 96px);
  object-fit: contain;
}

.image-modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border-color: #344054;
  background: #fff;
  color: #101828;
  font-size: 24px;
  line-height: 1;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  white-space: nowrap;
}

th {
  background: #f8fbff;
}

.num {
  text-align: right;
}

.table-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--primary);
  border-radius: 6px;
  color: var(--primary);
  font-weight: 900;
  text-decoration: none;
  background: #fff;
}

.table-action.danger {
  border-color: var(--danger);
  background: #fff;
  color: var(--danger);
}

.inline-form {
  display: inline;
  margin: 0;
}

.inline-form button {
  font-size: 14px;
}

.ocr-text {
  max-height: 320px;
  overflow: auto;
  padding: 14px;
  border-radius: 7px;
  background: #101828;
  color: #f9fafb;
  white-space: pre-wrap;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays span {
  padding: 10px;
  color: #475467;
  font-weight: 900;
  text-align: center;
}

.calendar-grid {
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.day {
  display: block;
  width: 100%;
  min-height: 118px;
  padding: 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-top: 0;
  border-left: 0;
  border-radius: 0;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 400;
  text-align: left;
  cursor: pointer;
  user-select: none;
}

.day b,
.day strong,
.day span,
.day small {
  display: block;
}

.day b {
  margin-bottom: 8px;
}

.day strong {
  color: var(--primary-dark);
}

.day.has-report {
  background: #f6f9ff;
}

.day.selected {
  box-shadow: inset 0 0 0 2px var(--primary), 0 8px 18px rgba(37, 99, 235, 0.1);
}

.day:focus {
  outline: 3px solid rgba(31, 111, 235, 0.24);
  outline-offset: -3px;
}

.day span {
  margin-top: 4px;
  color: var(--danger);
}

.day small {
  margin-top: 4px;
  color: var(--muted);
}

.day.muted {
  background: #f8fafc;
}

.empty-day {
  color: #98a2b3;
}

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

.month-summary div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fbfcff;
  box-shadow: 0 5px 14px rgba(16, 24, 40, 0.04);
}

.month-summary span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.month-summary strong {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 18px;
  line-height: 1.25;
}

.month-summary div:nth-child(1) strong {
  color: var(--primary-dark);
}

.month-summary div:nth-child(3) strong {
  color: var(--danger);
}

.loading {
  grid-column: 1 / -1;
  padding: 24px;
}

.detail-panel {
  scroll-margin-top: 72px;
}

.detail-summary {
  color: var(--muted);
  font-weight: 800;
}

.detail-empty,
.detail-loading {
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #fbfcff;
  color: var(--muted);
  font-weight: 700;
}

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

.report-detail-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(16, 24, 40, 0.04);
}

.detail-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
}

.detail-card-head strong {
  font-size: 17px;
}

.detail-card-head span {
  color: var(--primary-dark);
  font-weight: 900;
}

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

.detail-fields div {
  min-width: 0;
}

.detail-fields dt {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.detail-fields dd {
  margin: 0;
  min-height: 20px;
  overflow-wrap: anywhere;
}

.detail-image-link {
  display: inline-flex;
  margin-top: 12px;
  color: var(--primary);
  font-weight: 900;
}

.detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

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

@media (max-width: 640px) {
  body {
    background: #fff;
  }

  .page {
    width: 100%;
    padding: 0 0 28px;
  }

  .topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(247, 248, 251, 0.98);
  box-shadow: 0 8px 22px rgba(16, 24, 40, 0.04);
}

  .topnav {
  display: flex;
  gap: 8px;
  margin: 0 0 16px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(247, 248, 251, 0.98);
  box-shadow: 0 8px 22px rgba(16, 24, 40, 0.04);
}

  .topnav a {
    flex: 1 0 auto;
  }

  .panel {
    margin: 0;
    padding: 18px 14px;
    border-width: 0 0 1px;
    border-radius: 0;
    box-shadow: none;
  }

  h1 {
    font-size: 21px;
  }

  h2 {
    font-size: 17px;
  }

  .upload-form,
  .actions,
  .section-title,
  .calendar-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .upload-form label,
  .upload-form button,
  .actions button,
  .actions a,
  .section-title a,
  .calendar-toolbar button,
  .calendar-toolbar h1 {
    width: 100%;
  }

  .calendar-toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .calendar-toolbar h1 {
    grid-column: 1 / -1;
    grid-row: 1;
    margin-bottom: 4px;
    text-align: center;
  }

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

  .report-form .actions {
    position: sticky;
    bottom: 0;
    z-index: 9;
    margin: 16px -14px -18px;
    padding: 10px 14px 14px;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
  }

  .table-wrap {
    margin: 0 -14px;
    padding: 0 14px;
  }

  th,
  td {
    padding: 9px 10px;
    font-size: 14px;
  }

  .calendar-panel {
    padding-left: 8px;
    padding-right: 8px;
  }

  .calendar-weekdays span {
    padding: 8px 2px;
    font-size: 13px;
  }

  .calendar-grid {
    border-left: 0;
  }

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

  .day {
    min-height: 76px;
    padding: 6px 4px;
    font-size: 11px;
  }

  .day b {
    margin-bottom: 3px;
    font-size: 12px;
  }

  .day strong,
  .day span,
  .day small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ocr-text {
    max-height: 220px;
    font-size: 13px;
  }

  .detail-fields {
    grid-template-columns: 1fr;
  }

  .detail-card-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Daily report main screen polish */
.ocr-panel,
.report-input-panel,
.recent-panel {
  border-color: #d7e3f5;
}

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

.ocr-panel h1 {
  margin-bottom: 0;
}

.ocr-panel .upload-form {
  align-items: end;
  gap: 12px;
  padding: 16px;
  border-color: #cfddf5;
  background: linear-gradient(180deg, #f8fbff 0%, #f3f7ff 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.ocr-panel .upload-form label {
  color: #344054;
  font-size: 14px;
}

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

.report-scan-box,
.report-direct-box {
  min-height: 132px;
  padding: 16px;
  border: 1px solid #cfddf5;
  border-radius: 8px;
  background: linear-gradient(180deg, #f8fbff 0%, #f3f7ff 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.report-scan-box {
  display: grid;
  grid-template-columns: 1fr;
  align-content: end;
  gap: 12px;
}

.report-scan-box label {
  color: #344054;
  font-size: 14px;
}

.report-direct-box {
  display: grid;
  align-content: center;
  gap: 8px;
}

.report-direct-box strong {
  color: #0f172a;
  font-size: 18px;
  font-weight: 900;
}

.report-direct-box p {
  margin: 0;
  color: #667085;
  font-size: 14px;
  font-weight: 700;
}

.report-direct-box button {
  width: fit-content;
  min-width: 132px;
  margin-top: 4px;
}

.report-input-panel[hidden] {
  display: none;
}

.ocr-panel input[type="file"] {
  min-height: 52px;
  border-color: #c8d7ee;
  background: #fff;
}

.ocr-panel .status {
  margin: 0;
  padding: 12px 14px;
  border-color: #cbd7ea;
  background: #f8fafc;
  color: #475467;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
}

.ocr-panel .hint {
  margin: 4px 0 0;
  padding-left: 2px;
  color: #667085;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.65;
}

.report-input-panel {
  background:
    linear-gradient(180deg, rgba(248, 251, 255, 0.82) 0%, rgba(255, 255, 255, 1) 140px),
    #fff;
}

.report-input-panel .report-form {
  display: grid;
  gap: 18px;
}

.report-input-panel .form-grid {
  padding: 18px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.045);
}

.report-input-panel label {
  color: #344054;
  font-size: 14px;
}

.report-input-panel input,
.report-input-panel select {
  min-height: 52px;
  border-color: #cfd8e6;
  background: #fcfdff;
  font-weight: 800;
}

.report-input-panel input[name="site_name"],
.report-input-panel input[name="work_content"],
.report-input-panel input[name="memo"] {
  background: #fff;
}

.report-input-panel input[name="amount"],
.report-input-panel input[name="paid_amount"] {
  color: var(--primary-dark);
}

.report-input-panel select[name="payment_status"] {
  color: #0f172a;
}

.report-input-panel .actions {
  justify-content: flex-start;
  margin-top: 0;
}

.report-input-panel .actions button {
  min-width: 110px;
  min-height: 52px;
  border-radius: 8px;
}

.recent-panel .section-title {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e6edf7;
}

.recent-panel .section-title h2 {
  margin-bottom: 0;
}

.recent-panel .section-title h2::after {
  display: none;
}

.recent-panel .table-wrap {
  border: 0;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(16, 24, 40, 0.055);
}

.recent-panel table {
  border-collapse: separate;
  border-spacing: 0;
}

.recent-panel thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 13px 12px;
  border-bottom: 1px solid #dbe3ef;
  background: #f3f7ff;
  color: #344054;
}

.recent-panel tbody td {
  padding: 13px 12px;
  border-bottom: 1px solid #edf1f7;
  vertical-align: middle;
}

.recent-panel tbody tr:last-child td {
  border-bottom: 0;
}

.recent-panel tbody tr:hover td {
  background: #f8fbff;
}

.recent-panel tbody td:nth-child(1) {
  color: #475467;
  font-weight: 900;
}

.recent-panel tbody td:nth-child(2),
.recent-panel tbody td:nth-child(4) {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-panel .table-action {
  min-height: 36px;
  border-radius: 7px;
  font-size: 13px;
}

.recent-panel .table-action.danger:hover {
  border-color: var(--danger);
  background: #fff1f0;
}

.recent-card-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.recent-report-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(16, 24, 40, 0.055);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.recent-report-card:hover {
  border-color: #b9c9e5;
  box-shadow: 0 14px 32px rgba(16, 24, 40, 0.08);
  transform: translateY(-1px);
}

.recent-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #edf1f7;
}

.recent-card-head time {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef4ff;
  color: var(--primary-dark);
  font-weight: 900;
}

.recent-card-head span {
  color: #0f172a;
  font-size: 18px;
  font-weight: 900;
  white-space: nowrap;
}

.recent-card-body {
  display: grid;
  gap: 12px;
}

.recent-main-field {
  display: grid;
  gap: 4px;
}

.recent-main-field span,
.recent-meta dt {
  color: #667085;
  font-size: 12px;
  font-weight: 900;
}

.recent-main-field strong {
  min-height: 26px;
  overflow-wrap: anywhere;
  color: #0f172a;
  font-size: 18px;
  line-height: 1.35;
}

.recent-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.recent-meta div {
  min-width: 0;
  padding: 10px;
  border: 1px solid #edf1f7;
  border-radius: 8px;
  background: #fbfcff;
}

.recent-meta dd {
  margin: 3px 0 0;
  min-height: 21px;
  overflow: hidden;
  color: #344054;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 2px;
}

.recent-card-actions .table-action {
  min-width: 64px;
}

@media (min-width: 900px) {
  .ocr-panel .upload-form {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) auto;
  }

  .ocr-panel .report-scan-box {
    grid-template-columns: 1fr;
  }

  .report-input-panel .form-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .report-input-panel .form-grid label {
    grid-column: span 2;
  }

  .report-input-panel .form-grid label.wide {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .ocr-panel,
  .report-input-panel,
  .recent-panel {
    padding-top: 22px;
  }

  .ocr-panel .upload-form,
  .report-input-panel .form-grid {
    padding: 14px;
    border-radius: 8px;
  }

  .report-start-grid {
    grid-template-columns: 1fr;
  }

  .report-direct-box button {
    width: 100%;
  }

  .recent-panel .section-title {
    align-items: stretch;
  }

  .recent-panel .table-wrap {
    border: 1px solid #dbe3ef;
    box-shadow: none;
  }

  .recent-panel thead th,
  .recent-panel tbody td {
    padding: 11px 10px;
  }

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

  .recent-report-card {
    padding: 14px;
    box-shadow: none;
  }

  .recent-meta {
    grid-template-columns: 1fr;
  }

  .recent-card-actions {
    justify-content: stretch;
  }

  .recent-card-actions .table-action,
  .recent-card-actions .inline-form,
  .recent-card-actions button {
    width: 100%;
  }
}

/* Calendar and business-card pages */
.calendar-panel,
.detail-panel,
.card-ocr-panel,
.card-input-panel,
.card-list-panel,
.card-edit-panel {
  border-color: #d7e3f5;
}

.calendar-toolbar {
  display: grid;
  grid-template-columns: 120px 1fr 120px;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.calendar-toolbar h1 {
  margin: 0;
  text-align: center;
}

.calendar-toolbar button {
  min-height: 46px;
  border-radius: 8px;
}

.calendar-weekdays span {
  color: #344054;
  background: #f3f7ff;
  font-size: 13px;
}

.calendar-grid {
  box-shadow: 0 10px 26px rgba(16, 24, 40, 0.045);
}

.day {
  min-height: 126px;
  padding: 12px;
}

.day b {
  color: #0f172a;
  font-size: 16px;
}

.day strong {
  margin-top: 8px;
  font-size: 15px;
}

.day span,
.day small {
  font-weight: 800;
}

.day.muted {
  background: #f8fafc;
  color: #98a2b3;
}

.month-summary {
  gap: 12px;
  margin-top: 18px;
}

.month-summary div {
  padding: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.month-summary span {
  font-size: 12px;
}

.month-summary strong {
  font-size: 22px;
}

.detail-panel .section-title {
  align-items: flex-start;
  margin-bottom: 14px;
}

.detail-summary {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef4ff;
  color: var(--primary-dark);
}

.card-ocr-panel,
.card-input-panel,
.card-edit-panel {
  display: grid;
  gap: 16px;
}

.card-ocr-panel .upload-form {
  align-items: end;
  padding: 16px;
  border-color: #cfddf5;
  background: linear-gradient(180deg, #f8fbff 0%, #f3f7ff 100%);
}

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

.card-scan-box,
.card-direct-box {
  min-height: 132px;
  padding: 16px;
  border: 1px solid #cfddf5;
  border-radius: 8px;
  background: linear-gradient(180deg, #f8fbff 0%, #f3f7ff 100%);
}

.card-scan-box {
  display: grid;
  grid-template-columns: 1fr;
  align-content: end;
  gap: 12px;
}

.card-scan-box label {
  color: #344054;
  font-size: 14px;
}

.card-direct-box {
  display: grid;
  align-content: center;
  gap: 8px;
}

.card-direct-box strong {
  color: #0f172a;
  font-size: 18px;
  font-weight: 900;
}

.card-direct-box p {
  margin: 0;
  color: #667085;
  font-size: 14px;
  font-weight: 700;
}

.card-direct-box button {
  width: fit-content;
  min-width: 132px;
  margin-top: 4px;
}

.card-input-panel[hidden] {
  display: none;
}

.card-ocr-panel .status {
  margin: 0;
  padding: 12px 14px;
  border-color: #cbd7ea;
  background: #f8fafc;
  color: #475467;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
}

.card-input-panel .report-form,
.card-edit-panel .report-form {
  display: grid;
  gap: 18px;
}

.card-input-panel .form-grid,
.card-edit-panel .form-grid {
  padding: 18px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.045);
}

.card-input-panel label,
.card-edit-panel label {
  color: #344054;
  font-size: 14px;
}

.card-input-panel input,
.card-edit-panel input {
  min-height: 52px;
  border-color: #cfd8e6;
  background: #fcfdff;
  font-weight: 800;
}

.card-list-panel .section-title {
  display: grid;
  grid-template-columns: auto minmax(180px, 260px);
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e6edf7;
}

.card-list-panel .section-title h2 {
  margin: 0;
  line-height: 1.2;
}

.card-list-panel .section-title .button-secondary {
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 800;
  box-shadow: none;
}

.business-card-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.business-card-item {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(16, 24, 40, 0.055);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.business-card-item:hover {
  border-color: #b9c9e5;
  box-shadow: 0 14px 32px rgba(16, 24, 40, 0.08);
  transform: translateY(-1px);
}

.business-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #edf1f7;
}

.business-card-head strong {
  display: block;
  color: #0f172a;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.25;
}

.business-card-head span {
  display: block;
  margin-top: 4px;
  color: #667085;
  font-size: 13px;
  font-weight: 700;
}

.card-vcf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #c7d7fe;
  border-radius: 999px;
  background: #eef4ff;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

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

.business-card-meta div {
  min-width: 0;
  padding: 10px;
  border: 1px solid #edf1f7;
  border-radius: 8px;
  background: #fbfcff;
}

.business-card-meta div.wide {
  grid-column: 1 / -1;
}

.business-card-meta dt {
  color: #667085;
  font-size: 13px;
  font-weight: 700;
}

.business-card-meta dd {
  margin: 3px 0 0;
  min-height: 21px;
  overflow: hidden;
  color: #1d2939;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.business-card-meta div.wide dd {
  white-space: normal;
  line-height: 1.45;
}

.business-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.business-card-actions .table-action {
  min-width: 64px;
}

@media (min-width: 900px) {
  .card-input-panel .form-grid,
  .card-edit-panel .form-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .card-input-panel .form-grid label,
  .card-edit-panel .form-grid label {
    grid-column: span 2;
  }

  .card-input-panel .form-grid label.wide,
  .card-edit-panel .form-grid label.wide {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .card-start-grid {
    grid-template-columns: 1fr;
  }

  .card-direct-box button {
    width: 100%;
  }

  .card-list-panel .section-title {
    grid-template-columns: 1fr;
  }

  .card-list-panel .section-title .button-secondary {
    min-height: 44px;
  }

  .calendar-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .calendar-toolbar h1 {
    grid-column: 1 / -1;
    grid-row: 1;
  }

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

  .business-card-item {
    padding: 14px;
    box-shadow: none;
  }

  .business-card-meta {
    grid-template-columns: 1fr;
  }

  .business-card-actions {
    justify-content: stretch;
  }

  .business-card-actions .table-action,
  .business-card-actions .inline-form,
  .business-card-actions button {
    width: 100%;
  }
}

@media (max-width: 380px) {
  .day {
    min-height: 66px;
    font-size: 10px;
  }

  .topnav a,
  button,
  .button-secondary {
    padding-left: 10px;
    padding-right: 10px;
  }
}

/* Rebuilder-style refinement layer */
body {
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.06), transparent 30%),
    var(--bg);
}

.panel {
  position: relative;
  overflow: hidden;
  border-color: #dbe3ef;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
}

.panel > h1,
.panel > h2,
.section-title h1,
.section-title h2 {
  color: #0f172a;
  font-weight: 900;
}

.panel > h1::after,
.panel > h2::after {
  display: block;
  width: 36px;
  height: 3px;
  margin-top: 10px;
  border-radius: 999px;
  background: var(--primary);
  content: "";
}

.upload-form {
  padding: 14px;
  border: 1px solid #dbe7ff;
  border-radius: 8px;
  background: #f8fbff;
}

.upload-form label {
  flex: 1 1 280px;
}

label {
  color: #0f172a;
}

input,
select {
  border-color: #ccd6e3;
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(16, 24, 40, 0.03);
}

input:hover,
select:hover {
  border-color: #aab9cf;
}

input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

button,
.button-secondary,
.table-action {
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

button:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.button-secondary,
.table-action {
  background: #fff;
}

.status,
.detail-empty,
.detail-loading,
.source-image {
  border-color: #dbe3ef;
  background: #f8fbff;
}

.hint {
  line-height: 1.65;
}

.form-grid {
  gap: 16px;
}

.report-form .actions {
  padding-top: 6px;
}

.table-wrap {
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(16, 24, 40, 0.04);
}

table {
  overflow: hidden;
  border-radius: 8px;
}

th {
  color: #344054;
  font-size: 13px;
  font-weight: 900;
}

td {
  background: #fff;
}

tr:hover td {
  background: #f8fbff;
}

.calendar-panel {
  border-color: #dbe7ff;
}

.calendar-weekdays {
  overflow: hidden;
  border: 1px solid #dbe3ef;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: #f8fbff;
}

.calendar-grid {
  overflow: hidden;
  border-color: #dbe3ef;
  border-radius: 0 0 8px 8px;
  background: #fff;
}

.day {
  border-color: #e5ebf3;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.day:hover {
  background: #f8fbff;
}

.day.has-report {
  background: #f3f7ff;
}

.month-summary div,
.report-detail-card {
  border-color: #dbe3ef;
  background: #fff;
}

.month-summary strong {
  font-size: 20px;
}

.detail-card-head {
  border-bottom-color: #e5ebf3;
}

.detail-actions .table-action,
.detail-actions .button-secondary {
  min-height: 40px;
}

@media (min-width: 900px) {
  .topnav {
  display: flex;
  gap: 8px;
  margin: 0 0 16px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(247, 248, 251, 0.98);
  box-shadow: 0 8px 22px rgba(16, 24, 40, 0.04);
}

  .topnav a {
    min-width: 0;
  }

  .panel {
    padding: 26px;
  }
}

@media (max-width: 640px) {
  body {
    background: #fff;
  }

  .panel {
    background: #fff;
  }

  .upload-form,
  .table-wrap,
  .calendar-weekdays,
  .calendar-grid {
    border-radius: 7px;
  }

  .panel > h1::after,
  .panel > h2::after {
    margin-top: 8px;
  }
}

/* Calendar final Rebuilder-style pass */
.calendar-panel {
  background:
    linear-gradient(180deg, rgba(248, 251, 255, 0.9) 0%, #fff 220px),
    #fff;
}

.calendar-toolbar {
  padding-bottom: 16px;
  border-bottom: 1px solid #e6edf7;
}

.calendar-toolbar h1 {
  color: #0f172a;
  font-size: 25px;
  font-weight: 900;
  letter-spacing: 0;
}

.calendar-toolbar button {
  border-color: var(--primary);
  background: #fff;
  color: var(--primary);
  font-weight: 900;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.08);
}

.calendar-toolbar button:hover {
  background: var(--primary);
  color: #fff;
}

.calendar-weekdays {
  margin-top: 2px;
  border-color: #dbe7ff;
}

.calendar-weekdays span {
  padding: 12px 6px;
  color: #475467;
  font-size: 13px;
  font-weight: 900;
}

.calendar-grid {
  border-color: #dbe7ff;
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.055);
}

.day {
  min-height: 118px;
  padding: 12px;
  background: #fff;
}

.day b {
  width: fit-content;
  min-width: 26px;
  color: #0f172a;
  font-size: 16px;
  font-weight: 900;
}

.day strong {
  display: grid;
  gap: 1px;
  color: var(--primary);
  font-size: 14px;
  line-height: 1.35;
}

.day span {
  display: grid;
  gap: 1px;
  color: #c2410c;
  font-size: 13px;
  line-height: 1.35;
}

.day em,
.day i {
  min-width: 0;
  overflow: hidden;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day em {
  font-size: 12px;
}

.day i {
  font-weight: 900;
}

.day small {
  color: #667085;
  font-size: 12px;
  line-height: 1.35;
}

.day .empty-day {
  color: #d92d20;
  font-size: 12px;
  font-weight: 700;
}

.day.has-report {
  background: linear-gradient(180deg, #f7faff 0%, #ffffff 100%);
  box-shadow: inset 3px 0 0 rgba(37, 99, 235, 0.78);
}

.day.selected {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  background: #eef4ff;
}

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

.month-summary div {
  display: grid;
  gap: 7px;
  min-height: 86px;
  padding: 16px;
  border: 1px solid #dbe7ff;
  border-radius: 8px;
  background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.045);
}

.month-summary span {
  color: #667085;
  font-size: 12px;
  font-weight: 900;
}

.month-summary strong {
  color: #0f172a;
  font-size: 21px;
  line-height: 1.2;
}

.owner-summary {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #e6edf7;
}

.owner-summary .section-title {
  margin-bottom: 12px;
}

.owner-summary-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #dbe7ff;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.045);
}

.owner-summary-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

.owner-summary-table th,
.owner-summary-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #edf1f7;
  text-align: right;
  vertical-align: middle;
  font-size: 14px;
}

.owner-summary-table th {
  background: #f8fbff;
  color: #667085;
  font-size: 12px;
  font-weight: 900;
}

.owner-summary-table th:first-child,
.owner-summary-table td:first-child {
  text-align: left;
}

.owner-summary-table tbody tr:last-child td {
  border-bottom: 0;
}

.owner-summary-table td {
  color: #0f172a;
  font-weight: 800;
}

.owner-summary-table td:first-child {
  display: grid;
  gap: 3px;
}

.owner-summary-table td:first-child strong {
  color: #0f172a;
  font-size: 15px;
  font-weight: 900;
}

.owner-summary-table td:first-child span {
  color: #667085;
  font-size: 12px;
  font-weight: 800;
}

.owner-summary-table .receivable {
  color: #c2410c;
}

.owner-filter-link {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
}

.owner-filter-link:focus,
.owner-filter-link:focus-visible {
  outline: none;
}

.owner-filter-link:hover strong {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

.monthly-list-actions {
  display: flex;
  justify-content: flex-end;
}

.owner-reset-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #b8c7ff;
  border-radius: 8px;
  background: #f8fbff;
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.owner-summary-table .owner-filter-link {
  display: inline-grid;
  width: auto;
  min-width: 0;
}

.monthly-report-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #dbe7ff;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.045);
}

.monthly-report-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
}

.monthly-report-table th,
.monthly-report-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #edf1f7;
  text-align: left;
  vertical-align: middle;
  color: #344054;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
}

.monthly-report-table th {
  background: #f8fbff;
  color: #667085;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.monthly-report-table tbody tr:last-child td {
  border-bottom: 0;
}

.monthly-report-table td:nth-child(8),
.monthly-report-table td:nth-child(9) {
  text-align: right;
  white-space: nowrap;
  color: #0f172a;
  font-weight: 900;
}

.monthly-report-table .receivable {
  color: #c2410c !important;
}

.monthly-report-table td:nth-child(4),
.monthly-report-table td:nth-child(6),
.monthly-report-table td:nth-child(7) {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.monthly-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}

.monthly-row-actions .table-action {
  min-height: 30px;
  padding: 6px 9px;
  font-size: 12px;
}

.detail-panel {
  background:
    linear-gradient(180deg, rgba(248, 251, 255, 0.9) 0%, #fff 160px),
    #fff;
}

.detail-panel .section-title {
  padding-bottom: 14px;
  border-bottom: 1px solid #e6edf7;
}

.detail-summary {
  font-size: 13px;
  font-weight: 900;
}

.detail-empty,
.detail-loading {
  padding: 16px;
  border-color: #dbe7ff;
  background: #f8fbff;
  color: #667085;
  font-size: 14px;
  line-height: 1.55;
}

.report-detail-card {
  padding: 16px;
  border-color: #dbe7ff;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.055);
}

.detail-card-head strong {
  color: #0f172a;
  font-size: 18px;
  font-weight: 900;
}

.detail-card-head span {
  color: var(--primary);
  font-size: 18px;
}

.detail-fields div {
  padding: 10px;
  border: 1px solid #edf1f7;
  border-radius: 8px;
  background: #fbfcff;
}

.detail-fields dd {
  color: #344054;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
}

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

@media (max-width: 640px) {
  .calendar-toolbar {
    grid-template-columns: 1fr 1fr;
    padding-bottom: 12px;
  }

  .calendar-toolbar h1 {
    grid-column: 1 / -1;
    grid-row: 1;
    font-size: 21px;
  }

  .calendar-toolbar button {
    min-height: 44px;
  }

  .day {
    min-height: 82px;
    padding: 7px 5px;
  }

  .day b {
    min-width: 20px;
    font-size: 12px;
  }

  .day strong,
  .day span {
    gap: 0;
    font-size: 11px;
  }

  .day em,
  .day i {
    display: block;
    width: 100%;
  }

  .day em {
    font-size: 11px;
  }

  .day i {
    font-size: 11px;
  }

  .day small {
    font-size: 11px;
  }

  .month-summary div {
    min-height: 76px;
    padding: 12px;
  }

  .month-summary strong {
    font-size: 17px;
  }

  .owner-summary-table th,
  .owner-summary-table td {
    padding: 12px;
    font-size: 13px;
  }

  .monthly-report-table {
    min-width: 980px;
  }

  .monthly-report-table th,
  .monthly-report-table td {
    padding: 10px;
    font-size: 12px;
  }

  .report-detail-card {
    box-shadow: none;
  }
}
/* Intranet home */
.intranet-hero {
  display: flex;
  align-items: center;
  min-height: clamp(420px, 32vw, 560px);
  margin: 0 calc(50% - 50vw) 18px;
  padding: 66px max(24px, calc((100vw - 1120px) / 2 + 24px));
  border-bottom: 1px solid rgba(37, 99, 235, 0.18);
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  overflow: hidden;
}

.intranet-hero-copy {
  width: min(620px, 100%);
  color: #fff;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin-bottom: 14px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
  color: #dbeafe;
  font-size: 13px;
  font-weight: 900;
}

.intranet-hero h1 {
  max-width: 680px;
  margin: 0 0 14px;
  color: #fff;
  font-size: 36px;
  line-height: 1.22;
  text-shadow: 0 4px 22px rgba(0, 0, 0, 0.32);
}

.intranet-hero p {
  max-width: 560px;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

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

.dashboard-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
}

.intranet-card {
  display: grid;
  gap: 8px;
  min-height: 150px;
  padding: 22px;
  border: 1px solid #dbe7ff;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.intranet-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 14px 32px rgba(37, 99, 235, 0.12);
}

.intranet-card span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--primary);
  font-size: 13px;
  font-weight: 950;
}

.intranet-card strong {
  font-size: 20px;
  font-weight: 950;
}

.intranet-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.55;
}

.intranet-card.primary {
  border-color: rgba(37, 99, 235, 0.34);
  background: linear-gradient(135deg, #ffffff 0%, #eef4ff 100%);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.metric-grid div {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.metric-grid span,
.home-recent-item span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.metric-grid strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 19px;
  font-weight: 950;
  line-height: 1.25;
}

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

.quick-action-list a,
.home-recent-item {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-weight: 900;
  text-decoration: none;
}

.quick-action-list a:hover,
.home-recent-item:hover {
  border-color: var(--primary);
  background: var(--soft);
}

.home-recent-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.home-recent-item time {
  color: var(--primary);
  font-size: 13px;
  font-weight: 950;
}

.home-recent-item strong {
  overflow: hidden;
  color: var(--text);
  font-size: 16px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .intranet-grid,
  .dashboard-grid,
  .home-recent-list {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 560px) {
  .intranet-hero {
    min-height: 430px;
    padding: 42px 18px;
    background-position: 58% center;
  }

  .intranet-hero h1 {
    font-size: 27px;
  }

  .intranet-hero p {
    font-size: 14px;
  }

  .hero-actions .button,
  .hero-actions .button-secondary {
    width: 100%;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }
}
.approval-panel {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.approval-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.approval-steps div {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.approval-steps strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 950;
}

.approval-steps span {
  min-width: 0;
  color: var(--text);
  font-weight: 950;
}

.intranet-card.is-locked {
  position: relative;
}

.intranet-card.is-locked::after {
  content: '승인 후 사용';
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 950;
}

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

@media (max-width: 760px) {
  .approval-steps,
  .intro-dashboard {
    grid-template-columns: 1fr;
  }
}
.quick-waiting {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 900;
}
