:root {
  --brand: #174b6c;
  --brand-dark: #10364f;
  --surface: #f3f6f8;
  --line: #dbe3e9;
}

body { background: var(--surface); color: #172033; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; }
.sidebar { background: var(--brand-dark); color: white; padding: 24px 18px; display: flex; flex-direction: column; min-height: 100vh; }
.brand { font-size: 1.45rem; font-weight: 700; }
.brand-subtitle { color: #d1e1e9; font-size: .88rem; font-weight: 550; letter-spacing: .02em; }
.sidebar .nav-link { color: #dce8ee; border-radius: .5rem; margin-bottom: .35rem; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.1); color: white; }
.sidebar-user { color: #e5eef3; }
.sidebar-user small { color: #aec0cc; }
.main-panel { min-width: 0; }
.topbar { min-height: 64px; background: white; border-bottom: 1px solid var(--line); padding: 0 24px; display: flex; align-items: center; gap: 16px; }
.content-area { padding: 24px; }
.page-heading { display: flex; justify-content: space-between; gap: 16px; align-items: start; margin-bottom: 18px; }
.page-heading h1 { margin: 0; font-size: 1.65rem; }
.page-heading p { margin: .35rem 0 0; color: #647482; }
.section-title { font-size: 1.05rem; color: var(--brand); margin-bottom: 1rem; }
.card { border-color: var(--line); box-shadow: 0 1px 2px rgba(16,54,79,.04); }
.table thead th { background: #edf3f6; color: #3d5261; font-size: .78rem; white-space: nowrap; }
.service-card { border: 1px solid var(--line); border-radius: .65rem; padding: 16px; background: #fbfdfe; }
.sticky-actions { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 12px; padding: 14px; background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: .65rem; }
.status-badge { display: inline-block; border-radius: 999px; padding: .25rem .55rem; font-size: .76rem; background: #e7eef2; color: #375266; }
.status-submitted { background: #fff1cf; color: #795900; }
.status-approved, .status-confirmed, .status-completed { background: #dff4e8; color: #17643a; }
.status-cancelled { background: #fee7e5; color: #922b23; }
.detail-grid, .amount-list { display: grid; grid-template-columns: minmax(150px, .8fr) 1.2fr; gap: .7rem 1rem; margin: 0; }
.detail-grid dt, .amount-list dt { color: #5c6d79; font-weight: 500; }
.detail-grid dd, .amount-list dd { margin: 0; }
.metric-card { background: white; border: 1px solid var(--line); border-radius: .75rem; padding: 18px; }
.metric-card span { display: block; color: #60717e; }
.metric-card strong { display: block; font-size: 2rem; color: var(--brand); margin-top: .5rem; }
.metric-card.compact { padding: 13px 15px; }
.metric-card.compact strong { font-size: 1.55rem; }
.metric-card.metric-warning { border-left: 4px solid #d89b15; }
.metric-card.metric-danger { border-left: 4px solid #c4473d; }
.money-card .money-row { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: .45rem; margin-top: .45rem; }
.money-card .money-row strong { font-size: 1.05rem; margin: 0; font-variant-numeric: tabular-nums; }
.report-filters .form-check-input { margin-top: .7rem; }
.report-table-wrap { max-width: 100%; }
.report-table { min-width: 1200px; }
.boat-note-form { min-width: 180px; }
.master-card { min-height: 110px; color: var(--brand-dark); justify-content: center; gap: .35rem; }
.master-card span { color: #647482; font-size: .9rem; }
.master-form { max-width: 760px; }
.audit-details { display: block; max-width: 520px; white-space: pre-wrap; overflow-wrap: anywhere; }
.empty-state, .error-page { text-align: center; padding: 48px 24px !important; color: #60717e; }
.error-page h1 { color: var(--brand); font-size: 4rem; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(135deg, #10364f, #2f7899); }
.login-card { width: min(430px, 100%); background: white; padding: 34px; border-radius: 1rem; box-shadow: 0 22px 60px rgba(0,0,0,.25); }
.login-brand { color: var(--brand); font-size: 1.8rem; font-weight: 750; }
.login-brand-zh { color: #405968; font-size: 1.05rem; font-weight: 600; letter-spacing: .08em; }
.login-title { word-break: keep-all; overflow-wrap: normal; }

@media (max-width: 991px) {
  .app-shell { display: block; }
  .sidebar { min-height: auto; display: none; }
  .sidebar.open { display: flex; }
  .content-area { padding: 16px; }
  .page-heading { flex-direction: column; }
  .topbar { padding: 0 14px; font-size: .9rem; }
  .topbar > strong { line-height: 1.15; }
  .topbar > span { display: none; }
  .dashboard-grid .metric-card { height: 100%; padding: 14px; }
  .metric-card strong { font-size: 1.55rem; }
  .report-filters .col-6 { min-width: 0; }
  .login-title { font-size: 1.15rem; }
}

@media (max-width: 420px) {
  .login-card { padding: 26px 20px; }
  .login-title { font-size: 1.05rem; }
  .detail-grid, .amount-list { grid-template-columns: 1fr; gap: .25rem; }
  .detail-grid dd, .amount-list dd { margin-bottom: .65rem; }
}
