/* Shared base for Flask-rendered utility, account, and private dashboard pages.
   Keep page-specific content styles in their component stylesheet; do not repeat
   global type, surface, form, or action rules in response HTML. */
@import url("/site-header.css?v=20260802-sticky-header");

body.server-page {
  margin: 0;
  background: var(--color-cream);
  color: var(--color-ink-900);
  font-family: "Funnel Sans", Arial, sans-serif;
}

.server-page main { max-width: 1040px; margin: 52px auto; padding: 0 24px 60px; }
.server-page .mark { color: var(--color-forest-700); font-weight: 800; letter-spacing: -1px; font-size: 18px; }
.server-page .card { background: var(--color-paper); border: 1px solid var(--color-line); border-radius: 12px; padding: 28px; margin-top: 26px; }
.server-page h1 { font-family: "Oxanium", "Funnel Sans", Arial, sans-serif; letter-spacing: -.05em; font-size: 38px; margin: 12px 0; }
.server-page h2 { letter-spacing: -.03em; }
.server-page p { line-height: 1.6; color: var(--color-text-muted); }
.server-page a { color: var(--color-forest-700); }
.server-page table { width: 100%; border-collapse: collapse; font-size: 13px; }
.server-page th, .server-page td { padding: 12px 8px; text-align: left; border-bottom: 1px solid var(--color-line); }
.server-page th { color: var(--color-text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.server-page input, .server-page select, .server-page textarea { box-sizing: border-box; width: 100%; padding: 12px; border: 1px solid var(--color-line); border-radius: 6px; color: var(--color-ink-900); font: inherit; background: var(--color-paper); }
.server-page form > label { display: block; margin-top: 18px; color: var(--color-ink-900); font-weight: 700; }
.server-page form > label:first-child { margin-top: 0; }
.server-page form > label > input, .server-page form > label > select, .server-page form > label > textarea { display: block; margin-top: 8px; }
.server-page form > label > textarea { min-height: 128px; resize: vertical; }
.server-page form > button, .server-page form > .button { margin-top: 24px; }
.server-page button, .server-page .button { display: inline-block; margin-top: 12px; background: var(--color-ink-900); color: var(--color-paper); border: 0; border-radius: 8px; padding: 11px 15px; font-weight: 700; text-decoration: none; cursor: pointer; }
.server-page .button.secondary { background: var(--color-paper); color: var(--color-forest-700); border: 1px solid var(--color-forest-700); margin-left: 8px; }
.server-page .pill { display: inline-block; background: var(--color-citron-100); color: var(--color-forest-700); border-radius: 2px; padding: 4px 8px; font-size: 11px; font-weight: 700; }

/* Dashboard layout guardrails formerly embedded in simple_page(). */
.server-page .admin-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 18px; }
.server-page .admin-actions a { min-height: 184px; display: flex; flex-direction: column; padding: 18px; background: var(--color-paper); color: var(--color-ink-900); text-decoration: none; border: 1px solid var(--color-line); border-radius: 12px; }
.server-page .admin-icon { width: 31px; height: 31px; display: grid; place-items: center; margin-bottom: 18px; background: var(--color-lime-signal); color: var(--color-ink-900); border-radius: 8px; font-weight: 800; }
.server-page .admin-actions small { display: block; margin-top: 7px; color: var(--color-text-muted); font-size: 11px; line-height: 1.45; }
.server-page .admin-actions b { margin-top: auto; padding-top: 14px; color: var(--color-forest-700); font: 700 11px "Funnel Sans", monospace; }
.server-page .admin-orders-card { padding: 0 !important; overflow: hidden; }
.server-page .admin-section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: 24px 26px 18px; }
.server-page .admin-section-head h2 { margin: 7px 0 0; font-size: 26px; }
.server-page .admin-section-head > p { max-width: 320px; margin: 0; font-size: 11px; }
.server-page .table-scroll { overflow-x: auto; padding: 0 18px 8px; -webkit-overflow-scrolling: touch; }
.server-page .admin-orders-card table { min-width: 1080px; }
.server-page .admin-orders-card th, .server-page .admin-orders-card td { padding: 14px 10px; vertical-align: top; }
.server-page .admin-orders-card td:first-child { min-width: 165px; }
.server-page .admin-orders-card td small { display: block; max-width: 260px; margin-top: 6px; line-height: 1.45; }

/* Recent top-ups must stay readable without hiding the final columns behind a
   horizontal scrollbar. Desktop uses a fitted table; smaller screens use
   labeled records instead of compressing seven columns beyond legibility. */
.server-page .admin-topups-card .table-scroll { overflow-x: visible; }
.server-page .admin-topups-card table { min-width: 0; table-layout: fixed; }
.server-page .admin-topups-card th:nth-child(1), .server-page .admin-topups-card td:nth-child(1) { width: 10%; }
.server-page .admin-topups-card th:nth-child(2), .server-page .admin-topups-card td:nth-child(2) { width: 14%; }
.server-page .admin-topups-card th:nth-child(3), .server-page .admin-topups-card td:nth-child(3) { width: 22%; }
.server-page .admin-topups-card th:nth-child(4), .server-page .admin-topups-card td:nth-child(4) { width: 12%; }
.server-page .admin-topups-card th:nth-child(5), .server-page .admin-topups-card td:nth-child(5) { width: 8%; }
.server-page .admin-topups-card th:nth-child(6), .server-page .admin-topups-card td:nth-child(6) { width: 22%; }
.server-page .admin-topups-card th:nth-child(7), .server-page .admin-topups-card td:nth-child(7) { width: 12%; }
.server-page .admin-topups-card td { min-width: 0; overflow-wrap: anywhere; }
.server-page .admin-topups-card td:last-child { white-space: normal; }

/* The dashboard activity feed must not require a side-scroll just to reach
   routine actions. Keep its table compact on desktop, then turn each row into
   a labeled record when a narrow viewport would otherwise clip it. */
.server-page .admin-activity-card .table-scroll { overflow-x: visible; }
.server-page .admin-activity-card table { min-width: 0; table-layout: fixed; }
.server-page .admin-activity-card th:nth-child(1), .server-page .admin-activity-card td:nth-child(1) { width: 20%; }
.server-page .admin-activity-card th:nth-child(2), .server-page .admin-activity-card td:nth-child(2) { width: 9%; }
.server-page .admin-activity-card th:nth-child(3), .server-page .admin-activity-card td:nth-child(3) { width: 11%; }
.server-page .admin-activity-card th:nth-child(4), .server-page .admin-activity-card td:nth-child(4) { width: 7%; white-space: nowrap; }
.server-page .admin-activity-card th:nth-child(5), .server-page .admin-activity-card td:nth-child(5) { width: 12%; }
.server-page .admin-activity-card th:nth-child(6), .server-page .admin-activity-card td:nth-child(6) { width: 8%; }
.server-page .admin-activity-card th:nth-child(7), .server-page .admin-activity-card td:nth-child(7) { width: 14%; white-space: nowrap; }
.server-page .admin-activity-card th:nth-child(8), .server-page .admin-activity-card td:nth-child(8) { width: 19%; }
.server-page .admin-activity-card td { overflow-wrap: anywhere; }
.server-page .admin-row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.server-page .admin-row-actions form { flex: 0 0 auto; margin: 0; }
.server-page .admin-row-action,
.server-page form > .admin-row-action {
  box-sizing: border-box;
  width: auto;
  min-height: 36px;
  margin: 0;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.1;
  white-space: nowrap;
}

@media (max-width: 820px) {
  .server-page .admin-record-table .table-scroll { overflow-x: visible; padding: 0 12px 14px; }
  .server-page .admin-record-table table,
  .server-page .admin-record-table tbody,
  .server-page .admin-record-table tr,
  .server-page .admin-record-table td { display: block; width: 100%; min-width: 0; }
  .server-page .admin-record-table table { min-width: 0; table-layout: auto; }
  .server-page .admin-record-table thead { display: none; }
  .server-page .admin-record-table tbody {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .server-page .admin-record-table tr {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    gap: 13px 16px;
    padding: 16px;
    border: 1px solid var(--color-line);
    border-radius: 10px;
    background: var(--color-paper);
  }
  .server-page .admin-record-table td {
    box-sizing: border-box;
    width: auto !important;
    min-width: 0 !important;
    padding: 0;
    border: 0;
    overflow-wrap: anywhere;
  }
  .server-page .admin-record-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: var(--color-text-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
  }
  .server-page .admin-record-table td[data-label='Plan'],
  .server-page .admin-record-table td[data-label='Status'],
  .server-page .admin-record-table td[data-label='Progress'],
  .server-page .admin-record-table td[data-label='Resolve'],
  .server-page .admin-record-table td[data-label='Resolution'],
  .server-page .admin-record-table td[data-label='Actions'],
  .server-page .admin-record-table td[data-label='Original eSIM'],
  .server-page .admin-record-table td[data-label='Selected top-up'],
  .server-page .admin-record-table .empty-state,
  .server-page .admin-record-table .admin-empty-row { grid-column: 1 / -1; }
  .server-page .admin-record-table td small { max-width: none; }
  .server-page .admin-record-table td code { font-size: 11px; }
  .server-page .admin-record-table input { min-height: 42px; }
  .server-page .admin-record-table td[data-label='Resolve'] form,
  .server-page .admin-record-table td[data-label='Resolution'] form { display: grid; gap: 8px; }
  .server-page .admin-record-table td[data-label='Resolve'] button,
  .server-page .admin-record-table td[data-label='Resolution'] button { width: 100%; margin: 0 !important; }
  .server-page .admin-record-table .admin-row-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .server-page .admin-record-table .admin-row-actions form { min-width: 0; }
  .server-page .admin-record-table .admin-action--deletion { grid-column: 1 / -1; }
  .server-page .admin-record-table .admin-row-action,
  .server-page .admin-record-table form > .admin-row-action { width: 100%; min-height: 42px; white-space: normal; }
}

@media (max-width: 540px) {
  .server-page main { margin: 24px auto; padding: 0 14px 40px; }
  .server-page .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .server-page .admin-actions { grid-template-columns: 1fr; }
  .server-page .admin-section-head { display: block; padding: 20px 18px 16px; }
  .server-page .admin-section-head h2 { font-size: 23px; }
  .server-page .admin-section-head > p { margin-top: 10px; }
  .server-page .admin-record-table .table-scroll { padding: 0 10px 10px; }
  .server-page .admin-record-table tbody { grid-template-columns: 1fr; gap: 10px; }
  .server-page .admin-record-table tr { padding: 15px 14px; }
  .server-page .admin-record-table .admin-row-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .server-page .admin-record-table .admin-action--approval,
  .server-page .admin-record-table .admin-action--provision,
  .server-page .admin-record-table .admin-action--recovery,
  .server-page .admin-record-table .admin-action--deletion { grid-column: 1 / -1; }
  .server-page .admin-record-table .admin-row-action,
  .server-page .admin-record-table form > .admin-row-action {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    min-height: 44px;
    padding: 8px 10px;
  }
  .server-page .admin-record-table .admin-action--deletion { margin-top: 4px; }
}
