:root {
  color-scheme: light;
  --bg: #f4f7f3;
  --surface: #ffffff;
  --surface-2: #eef4f8;
  --text: #17212b;
  --muted: #66717d;
  --line: #d9e1e6;
  --accent: #176b63;
  --accent-2: #c05621;
  --danger: #b42318;
  --shadow: 0 12px 34px rgba(23, 33, 43, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, "Noto Sans KR", sans-serif;
}

.login-screen {
  align-items: center;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.78), transparent 34%),
    linear-gradient(135deg, #f7f4ea 0%, #eeeadf 48%, #faf8ef 100%);
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  background: rgba(255, 253, 246, 0.74);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(201, 193, 177, 0.46);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(113, 106, 94, 0.12);
  display: grid;
  gap: 15px;
  max-width: 520px;
  padding: 38px 46px;
  width: 100%;
}

.login-card * {
  box-sizing: border-box;
}

.login-logo {
  color: #858482;
  display: grid;
  gap: 8px;
  justify-items: center;
  margin-bottom: 12px;
  text-align: center;
}

.login-logo span {
  font-size: clamp(24px, 4.8vw, 39px);
  font-weight: 300;
  letter-spacing: clamp(0.1em, 1.4vw, 0.2em);
  line-height: 1.1;
  max-width: 100%;
  text-align: center;
  white-space: nowrap;
}

.login-logo small {
  font-size: 15px;
  font-weight: 300;
  letter-spacing: 0.62em;
  line-height: 1.2;
  padding-left: 0.62em;
}

.login-card h1 {
  color: #5f5d58;
  font-size: 24px;
  font-weight: 600;
  margin: 2px 0 0;
  text-align: center;
}

.login-card label {
  color: #746f65;
  display: grid;
  font-size: 13px;
  font-weight: 700;
  gap: 6px;
}

.login-card input {
  background: rgba(247, 243, 232, 0.82);
  border-color: #d5cdbd;
  color: #4d4a44;
  width: 100%;
}

.login-card input:focus {
  border-color: #aaa190;
  box-shadow: 0 0 0 3px rgba(174, 164, 144, 0.2);
  outline: 0;
}

.login-card button {
  background: #8c887d;
  color: #fffdf7;
  margin-top: 3px;
  width: 100%;
}

.login-card button.secondary,
.google-login-button {
  background: rgba(247, 243, 232, 0.82);
  border: 1px solid #d5cdbd;
  color: #5f5d58;
}

.login-card button:hover {
  background: #77736a;
}

.login-card button:disabled {
  background: #b9b3a7;
  opacity: 1;
}

.login-description {
  color: #79746a;
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 8px;
  text-align: center;
}

.login-help {
  color: #8a857b;
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 -4px;
  text-align: center;
}

.login-error {
  background: #fff1f0;
  border: 1px solid #f0b8b2;
  border-radius: 8px;
  color: #b42318;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  margin: 0;
  padding: 10px 12px;
  text-align: center;
  white-space: pre-line;
}

.approval-info {
  display: grid;
  gap: 10px;
}

.approval-info div {
  background: rgba(247, 243, 232, 0.82);
  border: 1px solid #d5cdbd;
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 10px;
}

.approval-info span {
  color: #8a857b;
  font-size: 12px;
  font-weight: 800;
}

.approval-info strong {
  color: #4d4a44;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.login-contact {
  color: #6f6a60;
  font-size: 13px;
  font-weight: 700;
  margin: 0;
  text-align: center;
}

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

button {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  min-height: 40px;
  padding: 0 16px;
}

button.secondary {
  background: #e1e8ed;
  color: var(--text);
}

button.danger {
  background: var(--danger);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.hidden {
  display: none !important;
}

.app-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  align-items: center;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin-bottom: 18px;
}

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

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 30px;
}

h2 {
  font-size: 18px;
}

.auth-panel {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.login-form {
  display: flex;
  gap: 8px;
}

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

textarea {
  resize: vertical;
}

.status-pill {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  padding: 9px 12px;
  white-space: nowrap;
}

.tabs {
  background: #dfe9e8;
  border-radius: 10px;
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 18px;
  padding: 6px;
}

.tab {
  background: transparent;
  color: var(--text);
}

.tab.active {
  background: #fff;
  box-shadow: var(--shadow);
  color: var(--accent);
}

body[data-role="viewer"] .tabs {
  grid-template-columns: 1fr;
}

.subtabs {
  background: #edf2f4;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  margin-bottom: 16px;
  padding: 6px;
  width: 100%;
}

.subtab {
  background: transparent;
  color: var(--text);
}

.subtab.active {
  background: #fff;
  box-shadow: var(--shadow);
  color: var(--accent);
}

#reservationInputTabButton {
  order: 1;
}

#expenseInputTabButton {
  order: 2;
}

#bulkUploadTabButton {
  order: 3;
}

.tab-panel {
  display: none;
}

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

.subtab-panel {
  display: none;
}

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

.notice {
  align-items: center;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  color: #7c2d12;
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  padding: 14px;
}

.kpi-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
}

.kpi-group {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
  padding: 14px;
}

.kpi-group h2 {
  color: var(--accent);
  font-size: 16px;
}

.kpi-group-values {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}

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

.kpi-card {
  align-items: center;
  display: grid;
  grid-template-rows: auto 1fr;
  justify-items: center;
  min-height: 92px;
  padding: 16px;
  text-align: center;
}

.kpi-card span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
  text-align: center;
}

.kpi-card strong {
  align-items: center;
  align-self: center;
  display: block;
  font-size: clamp(14px, 1.2vw, 20px);
  line-height: 1.2;
  max-width: 100%;
  text-align: center;
  word-break: keep-all;
}

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

.mobile-dashboard {
  display: none;
}

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

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

.panel.half {
  grid-column: span 2;
}

.calendar-panel {
  grid-column: span 3;
}

.calendar-panel.viewer-calendar-only {
  grid-column: 1 / -1;
}

.roster-panel {
  grid-column: span 1;
}

.branch-calendar-panel {
  grid-column: span 2;
}

.chart-tooltip {
  background: rgba(23, 33, 43, 0.9);
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  line-height: 1.55;
  padding: 10px 12px;
  pointer-events: none;
  position: fixed;
  z-index: 30;
}

#profitChart {
  max-width: 100%;
  width: 100%;
}

.analytics-filter-panel {
  margin-bottom: 16px;
}

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

.analytics-filters label {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  font-weight: 800;
  gap: 6px;
}

.analytics-chart {
  display: grid;
  gap: 12px;
}

.analytics-bar-row {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 96px minmax(0, 1fr) 120px;
}

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

.analytics-bar-row strong {
  font-size: 13px;
  text-align: right;
}

.analytics-bar-track {
  background: #e7edf0;
  border-radius: 999px;
  height: 14px;
  overflow: hidden;
}

.analytics-bar-track i {
  background: linear-gradient(90deg, #176b63, #2563eb);
  border-radius: inherit;
  display: block;
  height: 100%;
}

.analytics-table-detail summary,
.mobile-accordion summary {
  cursor: pointer;
  font-size: 18px;
  font-weight: 800;
  list-style: none;
}

.analytics-table-detail summary::-webkit-details-marker,
.mobile-accordion summary::-webkit-details-marker {
  display: none;
}

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

.mobile-summary-card,
.mobile-list-item,
.mobile-accordion {
  background: #f7fafb;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.mobile-list-item.platform-space,
.mobile-summary-card.platform-space {
  background: #ede9fe;
}

.mobile-list-item.platform-yeogi {
  background: #fee2e2;
}

.mobile-list-item.platform-naver {
  background: #dcfce7;
}

.mobile-list-item.platform-direct {
  background: #f3efe7;
}

.mobile-list-item.platform-etc {
  background: #f1f5f9;
}

.mobile-branch-group {
  display: grid;
  gap: 8px;
}

.mobile-branch-group > strong,
.mobile-date-picker {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.mobile-date-picker {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.mobile-summary-card span,
.mobile-list-item span,
.mobile-summary-card small {
  color: var(--muted);
  display: block;
  font-size: 13px;
}

.mobile-summary-card strong,
.mobile-list-item strong {
  display: block;
  font-size: 17px;
  margin-top: 4px;
}

.mobile-accordion-body {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  padding-top: 10px;
}

.panel-heading {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.panel-heading span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.calendar-controls {
  align-items: center;
  display: flex;
  gap: 8px;
}

.calendar-controls button {
  min-height: 34px;
  padding: 0;
  width: 34px;
}

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

.calendar-cell,
.calendar-dayname {
  border-radius: 6px;
  min-height: 156px;
  padding: 8px;
}

.calendar-dayname {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  min-height: auto;
  text-align: center;
}

.calendar-cell {
  background: #f7fafb;
  border: 1px solid var(--line);
  position: relative;
}

.calendar-cell.outside {
  opacity: 0.42;
}

.calendar-date {
  display: block;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 5px;
}

.calendar-event {
  background: #dbeafe;
  border-left: 3px solid #2563eb;
  border-radius: 4px;
  font-size: 11px;
  margin-top: 4px;
  overflow: visible;
  padding: 4px;
  white-space: normal;
}

.calendar-split,
.calendar-lane {
  position: relative;
}

.calendar-split {
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: 104px;
}

.calendar-lane {
  border-left: 1px dashed #d9e1e6;
  min-height: 104px;
}

.calendar-lane:first-child {
  border-left: 0;
}

.calendar-lane.single {
  min-height: 104px;
}

.calendar-event button {
  background: transparent;
  color: inherit;
  display: grid;
  gap: 1px;
  font-size: inherit;
  font-weight: 800;
  min-height: 0;
  line-height: 1.35;
  overflow: visible;
  padding: 0;
  text-align: left;
  width: 100%;
}

.calendar-event-time {
  display: block;
  font-size: 10px;
  letter-spacing: 0;
  line-height: 1.15;
  overflow: visible;
  white-space: nowrap;
}

.calendar-event-name {
  display: block;
  line-height: 1.2;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.calendar-split .calendar-event-time {
  font-size: 9px;
}

.calendar-event.cleaning {
  background: #e5e7eb;
  border-left-color: #16a34a;
}

.calendar-event.platform-space {
  background: #ede9fe;
  border-left-color: #7c3aed;
}

.calendar-event.platform-yeogi {
  background: #fee2e2;
  border-left-color: #dc2626;
}

.calendar-event.platform-naver {
  background: #dcfce7;
  border-left-color: #16a34a;
}

.calendar-event.platform-direct {
  background: #f3efe7;
  border-left-color: #8c887d;
}

.calendar-event.platform-etc {
  background: #f1f5f9;
  border-left-color: #94a3b8;
}

.refund-pending {
  color: #b42318;
}

.refund-done {
  color: #111827;
}

.roster-list {
  display: grid;
  gap: 10px;
  max-height: 620px;
  overflow: auto;
}

.roster-item {
  background: #f7fafb;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  padding: 12px;
}

.roster-item strong {
  font-size: 14px;
}

.roster-meta {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  gap: 3px;
}

.refund-check {
  align-items: center;
  color: var(--text);
  display: flex;
  font-size: 13px;
  font-weight: 800;
  gap: 8px;
  margin-top: 4px;
}

.refund-check input,
.checkbox-label input {
  min-height: auto;
  width: auto;
}

.checkbox-label {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

.phone-inputs {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(58px, 0.6fr) auto minmax(90px, 1fr) auto minmax(90px, 1fr);
}

.phone-inputs span {
  color: var(--muted);
  font-weight: 800;
}

.compact-calendar .calendar-cell {
  min-height: 132px;
}

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

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

.settings-form {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  margin-bottom: 14px;
}

.settings-form label {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  font-weight: 800;
  gap: 6px;
}

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

.settings-item {
  align-items: center;
  background: #f7fafb;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr auto;
  padding: 10px;
}

.settings-item-actions {
  display: flex;
  gap: 8px;
}

.admin-settings-list .settings-item {
  grid-template-columns: 1fr 150px 110px auto;
}

.settings-note {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 14px;
}

.timeline {
  display: grid;
  gap: 8px;
}

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

.timeline-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.timeline-item strong {
  display: block;
}

.timeline-item span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  margin-top: 3px;
}

.management-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 16px;
}

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

.data-form label {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  font-weight: 800;
  gap: 6px;
}

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

.cleaning-fields {
  background: #f1f8f2;
  border: 1px solid #c9dfcf;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 12px;
}

.bulk-upload-controls {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(260px, 1fr) auto;
  margin-bottom: 16px;
}

.bulk-upload-controls label {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  font-weight: 800;
  gap: 6px;
}

.bulk-preview-table {
  min-width: 1120px;
}

.status-chip {
  border-radius: 999px;
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 8px;
  white-space: nowrap;
}

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

.status-missing,
.status-time {
  background: #fee2e2;
  color: #991b1b;
}

.status-duplicate {
  background: #fef3c7;
  color: #92400e;
}

.status-excluded {
  background: #e5e7eb;
  color: #4b5563;
}

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

.table-panel {
  margin-bottom: 16px;
}

.search {
  max-width: 320px;
}

.reservation-list-tools {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.reservation-select-col {
  width: 42px;
}

.table-wrap {
  overflow-x: auto;
}

.customer-filter-panel {
  margin-bottom: 16px;
}

.customer-filters {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px) minmax(160px, 220px);
}

.customer-extra-filters,
.quick-time-buttons {
  align-items: center;
  display: grid;
  gap: 8px;
}

.customer-extra-filters {
  display: flex;
  flex-wrap: wrap;
}

.customer-extra-filters label {
  align-items: center;
  background: #f8faf8;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  gap: 6px;
  padding: 8px 10px;
}

.customer-extra-filters input {
  min-height: 0;
  width: auto;
}

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

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

#returningCustomerPanel {
  order: 1;
}

#extraChargeCustomerPanel {
  order: 2;
}

#customerReservationPanel {
  order: 3;
}

#allCustomerPanel {
  order: 4;
}

#customerExpensePanel {
  order: 5;
}

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

.customer-row {
  align-items: center;
  background: #f8faf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: 1.2fr 1.2fr 0.8fr 0.9fr;
  padding: 12px;
}

.customer-row div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.customer-row strong,
.customer-row span {
  overflow-wrap: anywhere;
}

.customer-row span {
  color: var(--muted);
  font-size: 13px;
}

.customer-money {
  text-align: right;
}

.quick-time-buttons {
  background: #f8faf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 10px;
}

.quick-time-buttons span {
  display: none;
}

.quick-time-buttons button {
  width: 100%;
}

.quick-time-buttons span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin-right: auto;
}

.customer-toggle {
  justify-self: stretch;
  width: 100%;
}

.analytics-summary-cards {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.analytics-summary-panel {
  order: 1;
}

.analytics-chart-panel {
  order: 2;
}

.analytics-grid .insight {
  order: 3;
}

.analytics-table-detail {
  order: 4;
}

.analytics-grid > article:not(.analytics-summary-panel):not(.analytics-chart-panel):not(.insight) {
  order: 5;
}

.analytics-summary-card {
  background: #f8faf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  min-height: 86px;
  padding: 12px;
}

.analytics-summary-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.analytics-summary-card strong {
  font-size: 19px;
  overflow-wrap: anywhere;
}

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

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

th {
  color: var(--muted);
  font-size: 12px;
}

td {
  font-size: 14px;
}

td button {
  min-height: 32px;
  padding: 0 10px;
}

.metric-list,
.statement {
  display: grid;
  gap: 8px;
}

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

.metric-row span {
  color: var(--muted);
}

.metric-row strong {
  text-align: right;
}

.statement-table {
  min-width: 720px;
}

.insight p {
  color: var(--text);
  font-size: 17px;
  line-height: 1.6;
  margin: 0;
}

.toast {
  background: #17212b;
  border-radius: 8px;
  bottom: 22px;
  color: #fff;
  left: 50%;
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px 16px;
  position: fixed;
  transform: translateX(-50%);
  z-index: 20;
}

@media (max-width: 1180px) {
  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 880px) {
  body {
    overflow-x: hidden;
  }

  .app-shell {
    padding: 16px;
    width: 100%;
  }

  .topbar,
  .login-form,
  .management-layout,
  .dashboard-grid,
  .analytics-grid,
  .settings-grid,
  .settings-form {
    grid-template-columns: 1fr;
  }

  .topbar,
  .auth-panel,
  .login-form {
    align-items: stretch;
    display: grid;
  }

  .tabs,
  .subtabs,
  .kpi-grid,
  .kpi-group-values,
  .quick-time-buttons,
  .analytics-filters,
  .analytics-summary-cards,
  .customer-filters,
  .customer-grid,
  .customer-row,
  .data-form,
  .cleaning-fields {
    grid-template-columns: 1fr;
  }

  .mobile-dashboard {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
  }

  #financialKpis,
  #dashboard .dashboard-grid {
    display: none;
  }

  body[data-role="viewer"] #dashboard .dashboard-grid {
    display: grid;
  }

  body[data-role="viewer"] #mobileDashboard {
    display: none !important;
  }

  .tabs,
  .subtabs {
    width: 100%;
  }

  .tab,
  .subtab {
    min-width: 0;
    white-space: normal;
  }

  .calendar-panel,
  .panel.half,
  .roster-panel,
  .branch-calendar-panel,
  .customer-grid .wide,
  .settings-panel.wide {
    grid-column: auto;
  }

  .customer-money {
    text-align: left;
  }

  .settings-item,
  .admin-settings-list .settings-item,
  .phone-inputs,
  .bulk-upload-controls {
    grid-template-columns: 1fr;
  }

  .phone-inputs span {
    display: none;
  }

  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .calendar-cell {
    min-height: 64px;
    padding: 5px;
  }

  .calendar-event,
  .calendar-event button {
    line-height: 1.35;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    word-break: keep-all;
  }

  .roster-list {
    max-height: none;
    overflow: visible;
  }

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

  table,
  thead,
  tbody,
  tr,
  td {
    display: block;
    min-width: 0;
    width: 100%;
  }

  thead {
    display: none;
  }

  tr {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 10px;
    padding: 8px;
  }

  td {
    border-bottom: 0;
    padding: 7px 4px;
    word-break: break-word;
  }

  td button {
    width: 100%;
  }

  .bulk-preview-table,
  .statement-table {
    min-width: 0;
  }

  .analytics-bar-row {
    align-items: start;
    grid-template-columns: 1fr;
  }

  .analytics-bar-row strong {
    text-align: left;
  }

  .analytics-table-detail:not([open]) {
    padding-bottom: 18px;
  }
}

@media (max-width: 560px) {
  .login-card {
    max-width: 100%;
    padding: 30px 22px;
  }

  .login-logo span {
    font-size: clamp(20px, 7vw, 28px);
    letter-spacing: 0.08em;
  }
}
