/*
  Calm, mobile-first visual refresh.
  The markup and all settlement functions stay the same; this layer only improves
  reading order, touch targets, spacing, and prevents wide admin controls.
*/
:root {
  --surface: #ffffff;
  --surface-soft: #f7f9fd;
  --ink-soft: #68758a;
}

body {
  background: linear-gradient(180deg, #f7f9fd 0, #f4f7fb 340px, #f7f9fc 100%);
}

.app-header {
  box-shadow: 0 3px 16px rgba(10, 23, 50, .12);
}

.admin-hero,
.box,
.rider-settings,
.payment-status-card {
  border-color: #e1e7f0;
}

.admin-hero {
  min-height: 162px;
  padding: 29px 32px;
  border-radius: 22px;
  box-shadow: 0 18px 42px rgba(22, 43, 86, .12);
}

.admin-hero h1 {
  font-size: 28px;
}

.admin-layout {
  gap: 20px;
}

.admin-nav {
  gap: 7px;
}

.tab {
  min-height: 64px;
  border: 1px solid #e7ebf2;
  background: rgba(255, 255, 255, .76);
}

.tab:hover {
  border-color: #ccd9f2;
  background: #fff;
}

.tab b {
  color: #3d4b60;
}

.tab.active {
  border-color: #d7e1f5;
  box-shadow: 0 10px 24px rgba(34, 58, 105, .09);
}

.workspace-card {
  min-height: 0;
  padding: 28px;
}

.section-title {
  padding-bottom: 17px;
}

.section-title p,
.retention-note,
.bank-account-note {
  color: var(--ink-soft);
}

.payment-work-card,
.settlement-type-group,
.period-editor,
.rider-settings {
  box-shadow: 0 8px 20px rgba(24, 45, 82, .04);
}

.settlement-type-tools {
  display: flex;
  align-items: flex-end;
  margin-top: 16px;
}

.settlement-type-tools label {
  width: min(100%, 360px);
  margin: 0;
}

.held-dashboard-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  margin-top: 17px;
}

.held-dashboard-summary article {
  padding: 15px;
  border: 1px solid #f0d7d7;
  border-radius: 14px;
  background: #fff9f9;
}

.held-dashboard-summary article:last-child {
  border-color: #dae4f6;
  background: #f5f8ff;
}

.held-dashboard-summary span,
.held-dashboard-summary strong {
  display: block;
}

.held-dashboard-summary span {
  color: #7d8797;
  font-size: 11px;
  font-weight: 750;
}

.held-dashboard-summary strong {
  margin-top: 7px;
  color: #a73d3d;
  font-size: 22px;
  letter-spacing: -.05em;
}

.held-dashboard-summary article:last-child strong {
  color: #315eb9;
}

.held-dashboard-tools {
  display: flex;
  align-items: end;
  gap: 9px;
  margin-top: 16px;
}

.held-dashboard-tools label {
  flex: 1;
  margin: 0;
}

.held-dashboard-tools .rider-action {
  margin: 0 0 1px;
  white-space: nowrap;
}

.held-dashboard-list {
  overflow: hidden;
  margin-top: 10px;
  border: 1px solid #e4e8ef;
  border-radius: 15px;
}

.held-dashboard-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 15px;
  border-bottom: 1px solid #edf0f4;
  background: #fff;
}

.held-dashboard-row:last-child {
  border-bottom: 0;
}

.held-dashboard-main,
.held-dashboard-side {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.held-dashboard-main b {
  overflow: hidden;
  margin-top: 4px;
  color: #344158;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.held-dashboard-main small {
  margin-top: 3px;
  color: #7e8999;
  font-size: 11px;
}

.held-dashboard-period {
  overflow: hidden;
  color: #496faf;
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.held-dashboard-side {
  align-items: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}

.held-dashboard-side strong {
  color: #a43c3c;
  font-size: 14px;
}

.held-dashboard-side div {
  display: flex;
  gap: 5px;
}

.held-dashboard-side .rider-action {
  margin: 0;
  padding: 7px 8px;
  font-size: 11px;
}

.held-dashboard-empty {
  margin: 0;
  padding: 22px 15px;
  color: #8290a3;
  font-size: 12px;
  text-align: center;
}

.held-dashboard-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 13px;
  color: #68768b;
  font-size: 12px;
  font-weight: 750;
}

.held-dashboard-pagination .rider-action {
  margin: 0;
  padding: 7px 12px;
  font-size: 12px;
}

.held-dashboard-pagination .rider-action:disabled {
  cursor: not-allowed;
  opacity: .45;
}

/* Rider dashboard: the amount and the selected period become the clear first view. */
#rider .page-heading {
  align-items: flex-end;
  margin-bottom: 14px;
}

#rider .page-heading h1 {
  font-size: 27px;
}

#rider .stats article {
  border-color: #e0e7f1;
  box-shadow: 0 8px 20px rgba(29, 45, 77, .05);
}

#rider .detail-card {
  overflow: hidden;
}

#rider .detail-card table {
  table-layout: fixed;
}

#rider .detail-card th {
  width: 56%;
}

.rider-settings summary {
  min-height: 58px;
}

.rider-settings[open] {
  border-color: #d6e1f3;
}

@media (max-width: 820px) {
  .admin-layout {
    gap: 13px;
  }

  .admin-nav {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 1px 9px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .admin-nav::-webkit-scrollbar {
    display: none;
  }

  .admin-nav .tab {
    flex: 0 0 128px;
    min-width: 128px;
  }
}

@media (max-width: 560px) {
  body {
    background: #f5f7fb;
  }

  .header-inner {
    gap: 8px;
  }

  .header-actions {
    gap: 5px;
  }

  .app-header .header-actions button {
    padding: 8px 9px;
    font-size: 11px;
  }

  .brand-logo {
    width: 66px;
  }

  main {
    padding: 15px 12px 34px;
  }

  .admin-hero {
    min-height: 0;
    align-items: center;
    flex-direction: row;
    gap: 12px;
    margin-bottom: 13px;
    padding: 18px;
    border-radius: 18px;
  }

  .admin-hero:after,
  .admin-hero .eyebrow,
  .admin-hero p {
    display: none;
  }

  .admin-hero h1 {
    margin: 0;
    font-size: 21px;
    line-height: 1.25;
  }

  .status-pill {
    margin-left: auto;
    padding: 7px 9px;
    font-size: 10px;
  }

  .admin-layout {
    gap: 8px;
  }

  .admin-nav {
    gap: 7px;
    margin: 0 -1px;
    padding: 1px 1px 8px;
  }

  .admin-nav .tab {
    flex: 0 0 88px;
    min-width: 88px;
    min-height: 68px;
    gap: 5px;
    padding: 8px 5px;
    border-radius: 13px;
  }

  .admin-nav .tab-icon {
    width: 29px;
    height: 29px;
    border-radius: 10px;
    font-size: 17px;
  }

  .admin-nav .tab b {
    font-size: 11px;
    line-height: 1.2;
  }

  .workspace-card,
  .box {
    padding: 17px;
    border-radius: 18px;
  }

  .section-title {
    gap: 10px;
    padding-bottom: 14px;
  }

  .section-title>div {
    gap: 10px;
  }

  .section-title h2 {
    font-size: 18px;
  }

  .section-title p {
    font-size: 12px;
    line-height: 1.45;
  }

  .section-icon {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    font-size: 17px;
  }

  .format-note {
    margin-top: 16px;
    padding: 13px;
    font-size: 11px;
  }

  .primary {
    min-height: 50px;
    margin-top: 17px;
  }

  #rider .page-heading {
    align-items: stretch;
    margin-bottom: 10px;
  }

  #rider .page-heading h1 {
    font-size: 23px;
  }

  #rider .page-heading select {
    min-height: 46px;
  }

  #rider .retention-note {
    margin: 0 2px 12px;
    font-size: 10px;
  }

  #rider .stats {
    gap: 8px;
  }

  #rider .stats article,
  #rider .stats .pay-card {
    border-radius: 16px;
  }

  #rider .stats .pay-card {
    min-height: 91px;
  }

  #rider .payment-status-card {
    border-radius: 15px;
  }

  #rider .detail-card th,
  #rider .detail-card td {
    padding: 11px 3px;
  }

  #rider .detail-card th {
    width: 59%;
  }

  .rider-settings {
    border-radius: 15px;
  }

  .rider-settings summary {
    min-height: 54px;
    padding: 12px 14px;
    font-size: 13px;
  }

  .rider-settings summary small {
    font-size: 10px;
  }

  .rider-settings .box {
    padding: 14px;
  }

  .settlement-type-summary,
  .settlement-type-groups {
    gap: 10px;
    margin-top: 14px;
  }

  .settlement-type-tools {
    margin-top: 13px;
  }

  .settlement-type-tools label {
    width: 100%;
  }

  .held-dashboard-summary {
    gap: 8px;
    margin-top: 14px;
  }

  .held-dashboard-summary article {
    padding: 13px;
  }

  .held-dashboard-summary strong {
    font-size: 18px;
  }

  .held-dashboard-tools {
    align-items: stretch;
    flex-direction: column;
    gap: 7px;
    margin-top: 13px;
  }

  .held-dashboard-tools .rider-action {
    width: 100%;
    min-height: 41px;
  }

  .held-dashboard-row {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 13px;
  }

  .held-dashboard-side {
    align-items: stretch;
  }

  .held-dashboard-side strong {
    font-size: 15px;
  }

  .held-dashboard-side div {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .held-dashboard-side .rider-action {
    width: 100%;
    min-height: 39px;
  }

  .settlement-type-summary article {
    padding: 15px;
    border-radius: 14px;
  }

  .settlement-type-list {
    max-height: 420px;
  }
}

/* Rider-only mobile dashboard: amount first, management options second. */
@media (max-width: 560px) {
  #rider {
    gap: 0;
  }

  #rider>.page-heading {
    margin: 0 0 8px;
    padding: 17px;
    border: 1px solid #e1e7f0;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(29, 45, 77, .04);
  }

  #rider>.page-heading .eyebrow {
    margin-bottom: 7px;
    font-size: 9px;
  }

  #rider>.page-heading h1 {
    margin-bottom: 14px;
    font-size: 22px;
    letter-spacing: -.045em;
  }

  #rider>.page-heading select {
    margin-top: 0;
    padding: 11px 13px;
    border-radius: 12px;
    background: #f7f9fd;
    font-size: 13px;
    font-weight: 750;
  }

  #rider .stats {
    margin: 4px 0 10px;
  }

  #rider .stats .pay-card {
    position: relative;
    overflow: hidden;
    padding: 18px;
    background: linear-gradient(135deg, #18366e 0%, #245ed8 100%);
    box-shadow: 0 15px 26px rgba(34, 86, 204, .23);
  }

  #rider .stats .pay-card:after {
    content: '';
    position: absolute;
    width: 130px;
    height: 130px;
    right: -50px;
    top: -66px;
    border: 24px solid rgba(255, 255, 255, .08);
    border-radius: 50%;
  }

  #rider .stats .pay-card span,
  #rider .stats .pay-card strong,
  #rider .stats .pay-card small {
    position: relative;
    z-index: 1;
  }

  #rider .stats .pay-card strong {
    margin-top: 8px;
    font-size: 31px;
  }

  #rider .stats article:not(.pay-card) {
    min-height: 82px;
    padding: 13px 14px;
    background: #fff;
  }

  #rider .stats article:not(.pay-card):last-child {
    background: #f0f5ff;
  }

  #rider .stats article:not(.pay-card) strong {
    overflow: hidden;
    font-size: 17px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #rider .payment-status-card {
    align-items: center;
    flex-direction: row;
    gap: 10px;
    padding: 12px 14px;
    background: #fff;
  }

  #rider .payment-status-card p {
    margin-left: auto;
    font-size: 10px;
    line-height: 1.35;
    text-align: right;
  }

  #rider .detail-card {
    padding: 0;
    border-radius: 18px;
  }

  #rider .detail-card .section-title {
    padding: 16px 17px 13px;
  }

  #rider .detail-card .section-title p {
    display: none;
  }

  #rider .detail-card table {
    margin: 0;
  }

  #rider .detail-card tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    min-height: 45px;
    margin: 0 17px;
    border-bottom: 1px solid #edf1f6;
  }

  #rider .detail-card th,
  #rider .detail-card td {
    padding: 0;
    border: 0;
    font-size: 13px;
  }

  #rider .detail-card th {
    width: auto;
    color: #617087;
  }

  #rider .detail-card td {
    color: #26344e;
  }

  #rider .detail-card tfoot tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    min-height: 65px;
    padding: 0 17px;
    background: #f2f6ff;
  }

  #rider .detail-card tfoot th,
  #rider .detail-card tfoot td {
    padding: 0;
    font-size: 19px;
  }

  #rider .rider-settings {
    overflow: hidden;
    border-radius: 16px;
    box-shadow: none;
  }

  #rider .rider-settings summary {
    min-height: 58px;
    padding: 14px 15px;
    background: #fff;
  }

  #rider .rider-settings summary>span {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  #rider .rider-settings summary>span:before {
    display: grid;
    place-items: center;
    width: 25px;
    height: 25px;
    border-radius: 8px;
    background: #edf3ff;
    color: #356df3;
    font-size: 13px;
    font-weight: 900;
  }

  #rider .settlement-settings summary>span:before { content: '↻'; }
  #rider .bank-settings summary>span:before { content: '₩'; }
  #rider .inquiry-settings summary>span:before { content: '?'; }

  #rider .rider-settings[open] summary {
    background: #fbfcff;
  }

  #rider .rider-settings .box {
    margin: 0;
    padding: 15px;
    border-radius: 0;
    background: #fbfcff;
  }
}

/* Rider portal refresh: quiet, trustworthy settlement UI instead of a promotional card dashboard. */
#rider {
  width: min(100%, 920px);
  margin: 0 auto;
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#rider>.page-heading {
  align-items: center;
  margin: 4px 0 12px;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#rider>.page-heading .eyebrow { margin-bottom: 7px; color: #71809a; font-size: 10px; font-weight: 800; letter-spacing: .12em; }
#rider>.page-heading h1 { color: #17243b; font-size: 26px; font-weight: 760; letter-spacing: -.055em; }
#rider>.page-heading select { width: min(100%, 260px); margin: 0; padding: 11px 34px 11px 13px; border: 1px solid #dde3eb; border-radius: 10px; background-color: #fff; box-shadow: none; color: #344158; font-size: 12px; font-weight: 700; }
#rider>.retention-note { margin: 0 2px 16px; color: #9099a7; font-size: 11px; }

#rider .stats { grid-template-columns: 1.45fr .82fr .96fr; gap: 10px; margin-bottom: 10px; }
#rider .stats article { min-height: 132px; padding: 18px; border: 1px solid #e4e8ee; border-radius: 15px; background: #fff; box-shadow: none; }
#rider .stats span { color: #778395; font-size: 11px; font-weight: 750; }
#rider .stats strong { margin-top: 9px; color: #1f2c43; font-size: 22px; font-weight: 760; }
#rider .stats small { color: #9aa3b0; font-size: 10px; }
#rider .stats .pay-card { position: relative; overflow: hidden; border-color: #17243b; border-radius: 15px; background: #17243b; box-shadow: none; }
#rider .stats .pay-card:after { content: ''; position: absolute; top: 18px; right: 18px; width: 26px; height: 3px; border-radius: 99px; background: #77a4ff; }
#rider .stats .pay-card span, #rider .stats .pay-card small { color: rgba(255, 255, 255, .62); }
#rider .stats .pay-card strong { margin-top: 11px; color: #fff; font-size: 31px; }

#rider .payment-status-card { align-items: center; margin: 0 0 14px; padding: 13px 16px; border: 1px solid #e4e8ee; border-left: 3px solid #334d78; border-radius: 12px; background: #fff; box-shadow: none; }
#rider .payment-status-card span { color: #778395; font-size: 11px; }
#rider .payment-status-card strong { margin-top: 3px; color: #243650; font-size: 14px; }
#rider .payment-status-card p { color: #8993a2; font-size: 11px; }

#rider .detail-card { padding: 0; overflow: hidden; border: 1px solid #e1e6ed; border-radius: 15px; background: #fff; box-shadow: none; }
#rider .detail-card .section-title { padding: 19px 20px 15px; border-bottom: 1px solid #edf0f4; }
#rider .detail-card .section-title .section-icon { display: none; }
#rider .detail-card .section-title>div { gap: 0; }
#rider .detail-card .section-title h2 { margin: 0; color: #1d2a41; font-size: 16px; letter-spacing: -.03em; }
#rider .detail-card .section-title p { margin-top: 4px; color: #919aa8; font-size: 11px; }
#rider .detail-card table { margin: 0; }
#rider .detail-card th, #rider .detail-card td { padding: 13px 20px; border-color: #f0f2f5; font-size: 13px; }
#rider .detail-card th { color: #697689; font-weight: 650; }
#rider .detail-card td { color: #26344c; font-weight: 740; }
#rider .detail-card tfoot tr { background: #f6f8fb; }
#rider .detail-card tfoot th, #rider .detail-card tfoot td { padding-top: 17px; padding-bottom: 17px; color: #172f58; font-size: 18px; font-weight: 780; }

#rider .rider-settings { margin: 10px 0 0; overflow: hidden; border: 1px solid #e1e6ed; border-radius: 13px; background: #fff; box-shadow: none; }
#rider .rider-settings summary { min-height: 59px; padding: 14px 17px; color: #26344c; font-size: 13px; font-weight: 760; }
#rider .rider-settings summary>span { display: flex; align-items: center; gap: 10px; }
#rider .rider-settings summary>span:before, #rider .settlement-settings summary>span:before, #rider .bank-settings summary>span:before, #rider .inquiry-settings summary>span:before { content: '' !important; width: 6px; height: 6px; border: 1px solid #98a4b5; border-radius: 50%; background: #fff; }
#rider .rider-settings summary small { color: #929caa; font-size: 11px; font-weight: 600; }
#rider .rider-settings summary:after { width: 21px; height: 21px; border: 1px solid #e0e5ec; border-radius: 7px; background: #fff; color: #66758a; font-size: 18px; }
#rider .rider-settings[open] summary { border-bottom-color: #edf0f4; background: #fbfcfe; }
#rider .rider-settings .box { margin: 0; padding: 18px; border: 0; border-radius: 0; background: #fbfcfe; box-shadow: none; }
#rider .rider-settings .section-icon { display: none; }
#rider .rider-settings .section-title { padding-bottom: 14px; }
#rider .rider-settings .section-title>div { gap: 0; }
#rider .rider-settings .section-title h2 { font-size: 15px; }
#rider .rider-settings .section-title p { margin-top: 4px; font-size: 11px; }
#rider .primary { border-radius: 11px; background: #1b2c49; box-shadow: none; }
#rider .primary:hover { background: #263d63; box-shadow: none; transform: none; }

@media (max-width: 560px) {
  #rider>.page-heading { align-items: stretch; margin: 2px 0 9px; padding: 0 2px; background: transparent; }
  #rider>.page-heading h1 { margin-bottom: 13px; font-size: 23px; }
  #rider>.page-heading select { min-height: 44px; padding: 10px 31px 10px 12px; border-radius: 10px; background-color: #fff; font-size: 12px; }
  #rider>.retention-note { margin: 0 2px 13px; font-size: 10px; }
  #rider .stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin: 0 0 9px; min-width: 0; }
  #rider .stats article, #rider .stats article:not(.pay-card), #rider .stats article:not(.pay-card):last-child { min-width: 0; min-height: 82px; padding: 13px; border-radius: 12px; background: #fff; }
  #rider .stats .pay-card { grid-column: 1 / -1; min-height: 112px; padding: 17px; border-radius: 14px; background: #17243b; box-shadow: none; }
  #rider .stats .pay-card:after { top: 17px; right: 17px; width: 22px; }
  #rider .stats .pay-card strong { margin-top: 9px; font-size: 30px; }
  /* The selected period is already shown in the picker above. On a phone, a second long period title only causes horizontal overflow. */
  #rider .stats article:nth-child(3) { display: none; }
  #rider .stats article:not(.pay-card) { grid-column: 1 / -1; flex-direction: row; align-items: center; min-height: 60px; padding: 12px 14px; }
  #rider .stats article:not(.pay-card) strong { min-width: 0; margin: 0 0 0 auto; overflow: hidden; font-size: 18px; text-overflow: ellipsis; white-space: nowrap; }
  #rider .stats article:not(.pay-card) small { display: none; }
  #rider .payment-status-card { gap: 8px; margin-bottom: 11px; padding: 11px 13px; border-radius: 11px; }
  #rider .payment-status-card p { font-size: 10px; }
  #rider .detail-card { border-radius: 14px; }
  #rider .detail-card .section-title { padding: 16px 16px 12px; }
  #rider .detail-card tbody tr { margin: 0 16px; }
  #rider .detail-card th, #rider .detail-card td { font-size: 12px; }
  #rider .detail-card tfoot tr { padding: 0 16px; background: #f6f8fb; }
  #rider .detail-card tfoot th, #rider .detail-card tfoot td { font-size: 18px; }
  #rider .rider-settings { margin-top: 8px; border-radius: 12px; }
  #rider .rider-settings summary { min-height: 56px; padding: 13px 14px; font-size: 12px; }
  #rider .rider-settings .box { padding: 15px; }
}
