/* AdminWeb (super-admin panel). Buttons, search box and side rail are the shared UsersWeb ones; accents are the
   Danti chart palette (Constants/ChartColours.js) with dark text on them. */
@font-face { font-family: "App-Medium"; src: url("/fonts/Nunito-Medium.ttf"); }
@font-face { font-family: "App-Regular"; src: url("/fonts/Nunito-Light.ttf"); }

.adm-login-note { margin: 6px 0 18px; font-size: 13px; color: #5b6770; }

.adm-body { margin: 0; height: 100vh; display: flex; flex-direction: column; background: #fafafa; color: #1f2a30;
  font-family: App-Medium, App-Regular, system-ui, sans-serif; }
.adm-body * { box-sizing: border-box; }
.adm-top { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: #113F57; color: #fff; }
.adm-brand { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.adm-brand-name { font-size: 20px; font-weight: 700; }
.adm-brand-role { font-size: 12px; padding: 3px 10px; border-radius: 12px; background: #ffea9f; color: #1f2a30; white-space: nowrap; }
.adm-top-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.adm-user { font-size: 13px; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40vw; }
.adm-top .btn-outline { background: #fff; }

.adm-layout { flex: 1 1 auto; min-height: 0; }
.adm-main { overflow: auto; padding: 16px 20px 28px; }
.adm-view[hidden] { display: none; }
.adm-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 8px; }
.adm-title { margin: 0; font-size: 20px; }
.adm-count { font-size: 13px; color: #5b6770; }
.adm-search { flex: 1 1 200px; max-width: 340px; margin-left: auto; }
.adm-month { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #5b6770; }
/* Year-month field: one box, two inputs, a fixed hyphen. */
.adm-ym { display: inline-flex; align-items: center; height: 30px; padding: 0 8px; border: 1px solid #d5dbdf; border-radius: 8px; background: #fff; color: #1f2a30; }
.adm-ym:focus-within { border-color: #076A89; box-shadow: 0 0 0 2px rgba(7, 106, 137, .18); }
.adm-ym input { border: 0; outline: 0; padding: 0; background: transparent; font: inherit; font-variant-numeric: tabular-nums; color: inherit; text-align: center; }
.adm-ym-year { width: 4.4ch; }
.adm-ym-month { width: 2.6ch; }
.adm-ym-sep { padding: 0 2px; color: #5b6770; user-select: none; }
.adm-select { height: 30px; padding: 0 8px; border: 1px solid #d5dbdf; border-radius: 8px; font: inherit; font-size: 13px; color: #1f2a30; background: #fff; margin-left: auto; }
.adm-select + .adm-search { margin-left: 0; }
.adm-note { margin: 0 0 12px; font-size: 13px; color: #5b6770; }
.adm-empty { padding: 28px 12px; text-align: center; color: #5b6770; }

.adm-split { display: flex; gap: 16px; align-items: flex-start; }
.adm-table-wrap { flex: 1 1 auto; min-width: 0; overflow-x: auto; background: #fff; border: 1px solid #e6eaec; border-radius: 12px; }
.adm-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.adm-table th { position: sticky; top: 0; text-align: left; font-weight: 700; font-size: 12px; color: #5b6770; background: #f3f6f7;
  padding: 9px 12px; white-space: nowrap; border-bottom: 1px solid #e6eaec; }
.adm-table th button { all: unset; cursor: pointer; }
.adm-table th button:focus-visible { outline: 2px solid #076A89; outline-offset: 2px; border-radius: 4px; }
.adm-table td { padding: 9px 12px; border-bottom: 1px solid #f0f3f4; vertical-align: top; }
.adm-table tbody tr { cursor: pointer; }
.adm-table tbody tr:hover { background: #f6fafb; }
.adm-table tbody tr.is-selected { background: #e6f3f6; box-shadow: inset 3px 0 0 #076A89; }
.adm-table tfoot td { font-weight: 700; background: #f3f6f7; border-top: 1px solid #e6eaec; border-bottom: none; }
.adm-table-num tbody tr { cursor: default; }
.adm-table-num td.num, .adm-table-num th.num { text-align: right; font-variant-numeric: tabular-nums; }
.adm-sub { display: block; font-size: 12px; color: #5b6770; }
.adm-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; word-break: break-all; }
.adm-pill { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; background: #b9d6d1; color: #1f2a30; text-transform: uppercase; }

.adm-detail { flex: 0 0 340px; max-width: 100%; background: #fff; border: 1px solid #e6eaec; border-radius: 12px; padding: 16px; position: sticky; top: 0; }
.adm-detail[hidden] { display: none; }
.adm-detail h2 { margin: 0 0 2px; font-size: 17px; }
.adm-detail dl { margin: 12px 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 13px; }
.adm-detail dt { color: #5b6770; }
.adm-detail dd { margin: 0; word-break: break-word; }
.adm-detail h3 { margin: 14px 0 8px; font-size: 13px; color: #5b6770; font-weight: 700; }
.adm-company { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid #f0f3f4; }
.adm-company-name { min-width: 0; font-size: 14px; }
.adm-detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }

.adm-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.adm-tile { border-radius: 12px; padding: 12px 14px; color: #1f2a30; }
.adm-tile-label { font-size: 12px; }
.adm-tile-value { font-size: 24px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.adm-tile-sub { font-size: 12px; margin-top: 2px; opacity: .8; }

/* The owner's sign-in account, in the detail card */
.adm-account { margin: 4px 0 6px; padding: 10px 0; border-top: 1px solid #f0f3f4; font-size: 13px; }
.adm-account-line { margin: 0 0 8px; color: #5b6770; }
.adm-account-line .adm-sub { display: block; margin-top: 4px; }
.adm-account-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.adm-pill-off { background: #ffaaaa; color: #1f2a30; } /* palette red, dark text */
.adm-account-list { margin: 0 0 10px; padding-left: 18px; font-size: 13px; }
.adm-account-type { display: block; font-size: 13px; color: #5b6770; }
.adm-account-type input { display: block; width: 100%; height: 34px; margin-top: 6px; padding: 0 8px; border: 1px solid #d5dbdf; border-radius: 8px; font: inherit; color: #1f2a30; box-sizing: border-box; }

/* Rows that open a window */
.adm-table tbody tr.is-clickable { cursor: pointer; }
/* Window (company charge, price list) */
.adm-window-back { position: fixed; inset: 0; z-index: 5000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(31, 42, 48, .45); }
.adm-window-back[hidden] { display: none; }
.adm-window { width: 100%; max-width: 620px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: #fff; border-radius: 14px; box-shadow: 0 12px 40px rgba(0, 0, 0, .25); }
.adm-window-head { padding: 16px 18px 8px; }
.adm-window-head h2 { margin: 0 0 2px; font-size: 18px; }
.adm-window-body { padding: 4px 18px 12px; overflow-y: auto; }
.adm-window-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px 16px; border-top: 1px solid #f0f3f4; }
.adm-charge { width: 100%; border-collapse: collapse; font-size: 14px; }
.adm-charge th { text-align: left; font-size: 12px; color: #5b6770; font-weight: 700; padding: 6px 8px; border-bottom: 1px solid #e6eaec; }
.adm-charge td { padding: 8px; border-bottom: 1px solid #f0f3f4; vertical-align: top; }
.adm-charge .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.adm-charge tfoot td { font-weight: 700; border-bottom: 0; }
.adm-charge-total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 12px 0 4px; padding: 12px 14px; border-radius: 12px; color: #1f2a30; }
.adm-charge-figure { text-align: right; }
.adm-charge-figure .adm-sub { display: block; }
.adm-charge-total strong { font-size: 24px; font-variant-numeric: tabular-nums; }
.adm-prices { display: grid; grid-template-columns: 1fr 140px; gap: 10px 12px; align-items: center; font-size: 14px; margin: 8px 0; }
.adm-prices-country { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #5b6770; margin: 4px 0 10px; }
.adm-prices-country .adm-select { margin-left: 0; min-width: 200px; }
.adm-prices label span { display: block; font-size: 12px; color: #5b6770; }
.adm-price { display: flex; align-items: center; height: 34px; padding: 0 8px; border: 1px solid #d5dbdf; border-radius: 8px; background: #fff; }
.adm-price:focus-within { border-color: #076A89; box-shadow: 0 0 0 2px rgba(7, 106, 137, .18); }
.adm-price.is-wrong { border-color: #ff9089; box-shadow: 0 0 0 2px rgba(255, 144, 137, .35); } /* palette red */
.adm-price-cur { font-size: 12px; color: #5b6770; }
.adm-price input { width: 100%; border: 0; outline: 0; background: transparent; font: inherit; text-align: right; font-variant-numeric: tabular-nums; }

/* What the company paid for the month (company window) */
.adm-pay-title { margin: 16px 0 8px; font-size: 13px; color: #5b6770; font-weight: 700; }
.adm-pay { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 18px; margin-bottom: 8px; }
.adm-pay-amount { display: block; flex: 1 1 200px; max-width: 280px; font-size: 13px; color: #5b6770; }
.adm-pay-amount .adm-price { margin-top: 6px; gap: 6px; }
.adm-pay-rf { display: block; flex: 0 1 130px; font-size: 13px; color: #5b6770; }
.adm-pay-rf .adm-price { margin-top: 6px; gap: 6px; }
.adm-pay-breakdown[hidden] { display: none; }
.adm-pay-changed { padding: 8px 10px; border-radius: 8px; background: #ffea9f; color: #1f2a30; } /* palette yellow: a notice */
.adm-pay-paid { display: flex; align-items: center; gap: 8px; height: 34px; font-size: 14px; cursor: pointer; }

/* Owner card: seller link and own prices */
.adm-select.adm-select-inline { margin-left: 0; flex: 1 1 140px; min-width: 0; max-width: 100%; }
.adm-own { display: grid; grid-template-columns: auto minmax(150px, 1fr) 160px; gap: 10px 12px; align-items: center; font-size: 14px; margin: 8px 0; }
.adm-price.is-off { background: #f3f6f7; opacity: .6; }

/* Owner card: the owner's companies with their seller */
.adm-seller-links { display: flex; flex-direction: column; gap: 6px; }
.adm-seller-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; }

/* Sellers */
.adm-window.adm-window-wide { max-width: 860px; }
.adm-seller-actions { display: flex; gap: 6px; white-space: nowrap; }
.adm-seller-info { margin: 4px 0 12px; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; }
.adm-seller-info dt { color: #5b6770; }
.adm-seller-info dd { margin: 0; word-break: break-word; }
.adm-seller-table { margin-bottom: 4px; }
.adm-seller-paid { white-space: nowrap; }
.adm-seller-paid .btn { margin-left: 6px; }
.adm-seller-paid .adm-sub { margin: 2px 0 4px; }
.adm-seller-table tfoot td { border-top: 1px solid #e6eaec; }
.adm-seller-table tr.is-selected { background: #e6f3f6; }
.adm-seller-months { background: #f6fafb; font-size: 13px; }
.adm-seller-month { padding: 2px 0; font-variant-numeric: tabular-nums; }
.adm-seller-form { grid-template-columns: 1fr 240px; }
.adm-seller-form .adm-price input { text-align: left; }
#seller_code { text-transform: uppercase; } /* codes are always capitals (AdminModel.cleanSellerCode; the server does it again) */
.adm-link { all: unset; cursor: pointer; color: #076A89; text-decoration: underline; text-underline-offset: 2px; }
.adm-link:focus-visible { outline: 2px solid #076A89; outline-offset: 2px; border-radius: 4px; }

@media (max-width: 900px) {
  .adm-split { flex-direction: column; }
  .adm-detail { flex: 1 1 auto; width: 100%; position: static; order: -1; }
  .adm-search { margin-left: 0; max-width: none; }
  .adm-select { margin-left: 0; }
  .adm-seller-form { grid-template-columns: 1fr; }
  .adm-own { grid-template-columns: 1fr; }
}
