/*
 * THE PARTNER AREA. 4.1, change 4A.
 *
 * A stylesheet of its own, about 6kb, rather than the dashboard's or the
 * website's.
 *
 * NOT admin.css. That file is ninety kilobytes of load manager, permission
 * grids and pack job tables, none of which a travel agent will ever see, and
 * every class in it is a class somebody could reach for here by accident and
 * end up with half a dashboard.
 *
 * NOT the website's either. The website is a brochure with a hero film. This
 * is four screens somebody uses with a guest standing in front of them.
 *
 * The colours are the site's own, taken from Settings through the same
 * --accent variables the rest of the site uses, so a reseller's partner area
 * matches their site without anybody editing this file.
 */

:root{
  --accent:#A82B13; --accent-dk:#8A2210; --accent-sf:#FBF1EE;
  --ink:#15120E; --body:#3D3831; --mut:#7A736A;
  --paper:#F7F5F1; --card:#FFFFFF; --sand:#F3EFE8;
  --line:#DFD9D0; --line-2:#EDE9E2;
  --ok:#2F7D4F; --ok-sf:#F0F7F2; --warn:#9A6B12; --warn-sf:#FBF6EA;
  --r:3px;
  color-scheme:light;
}

*{box-sizing:border-box}

/*
 * 4.4. THE ONE LINE THIS FILE WAS MISSING, AND IT COST A RELEASE.
 *
 * A class that sets display beats the browser's own [hidden] rule, because
 * an author stylesheet wins over the user agent stylesheet. .field below
 * sets display:block, so `box.hidden = true` on a .field did absolutely
 * nothing: the attribute was set, the box stayed on screen.
 *
 * That is the whole of the 4.3 fault where the country box would not hide
 * for a Nepali citizen. The script ran, the attribute was there, the
 * stylesheet overruled it. site.css has carried this guard and a note about
 * this exact trap since 3.0. This file was written new in 4.3 and never got
 * one.
 *
 * ANY NEW STYLESHEET IN THIS PROJECT NEEDS THIS LINE.
 */
[hidden]{display:none !important}

html,body{margin:0;padding:0}
body{
  background:var(--paper); color:var(--body);
  font:15px/1.6 system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  -webkit-text-size-adjust:100%;
}
a{color:var(--accent)}
h1,h2,h3{margin:0;color:var(--ink);line-height:1.25}
h1{font-size:22px}
h2{font-size:17px}
h3{font-size:14px}
p{margin:0 0 10px}
p:last-child{margin-bottom:0}
code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12.5px;background:var(--sand);padding:1px 5px;border-radius:2px}

/* ---- the frame ------------------------------------------------------- */

.wrap{max-width:1000px;margin:0 auto;padding:0 16px}
.wrap-sm{max-width:460px;margin:0 auto;padding:0 16px}

.top{background:var(--ink);color:#fff}
.top .wrap{display:flex;align-items:center;gap:14px;flex-wrap:wrap;padding-top:14px;padding-bottom:14px}
.top .mark{font-weight:700;font-size:12px;letter-spacing:.2em;text-transform:uppercase;color:#fff;text-decoration:none}
.top .mark small{display:block;letter-spacing:.14em;font-size:9.5px;color:#9A938A;margin-top:3px;font-weight:700}
.top .spacer{flex:1 1 auto}
.top .who{font-size:12.5px;color:#C9C2B8;max-width:100%;overflow-wrap:anywhere}
.top .out{color:#fff;font-size:12.5px;text-decoration:none;border-bottom:1px solid #4A443C;padding-bottom:1px}
.top .out:hover{border-color:#fff}

.tabs{background:#fff;border-bottom:1px solid var(--line)}
.tabs .wrap{display:flex;gap:4px;flex-wrap:wrap;overflow-x:auto}
.tabs a{
  display:block;padding:13px 14px;font-size:13.5px;font-weight:600;
  color:var(--mut);text-decoration:none;border-bottom:2px solid transparent;white-space:nowrap;
}
.tabs a:hover{color:var(--ink)}
.tabs a.on{color:var(--accent);border-bottom-color:var(--accent)}

main{padding:24px 0 48px}
.page-head{margin-bottom:18px}
.page-head .sub{color:var(--mut);font-size:13.5px;margin-top:5px}

.foot{border-top:1px solid var(--line);padding:18px 0 34px;color:var(--mut);font-size:12.5px}

/* ---- cards ----------------------------------------------------------- */

.card{background:var(--card);border:1px solid var(--line);border-radius:var(--r)}
.card + .card{margin-top:16px}
.card-head{
  padding:14px 18px;border-bottom:1px solid var(--line);
  display:flex;align-items:center;gap:10px;flex-wrap:wrap;
}
.card-head .right{margin-left:auto;display:flex;gap:7px;flex-wrap:wrap}
.card-pad{padding:18px}
.stack-16 > * + *{margin-top:16px}

.tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:14px;margin-bottom:20px}
.tile{background:var(--card);border:1px solid var(--line);border-radius:var(--r);padding:15px 17px}
.tile .k{font-size:10.5px;letter-spacing:.12em;text-transform:uppercase;color:var(--mut)}
.tile .v{font-size:27px;line-height:1.05;margin-top:7px;color:var(--ink);font-weight:700;font-variant-numeric:tabular-nums}
.tile .n{font-size:12px;color:var(--mut);margin-top:5px}
.tile.is-accent{border-color:var(--accent);background:var(--accent-sf)}
.tile.is-accent .v{color:var(--accent)}

/* ---- words ----------------------------------------------------------- */

.mut{color:var(--mut)}
.small{font-size:13px}
.tiny{font-size:11.5px}
.mono{font-family:ui-monospace,SFMono-Regular,Menlo,monospace}
.nowrap{white-space:nowrap}
.num{text-align:right;font-variant-numeric:tabular-nums}

.tag{
  display:inline-block;font-size:11px;padding:2px 7px;border-radius:2px;
  border:1px solid var(--line);background:var(--sand);color:var(--mut);
}
.pill{
  display:inline-block;font-size:11px;font-weight:600;padding:2px 8px;border-radius:999px;
  border:1px solid var(--line);background:var(--sand);color:var(--mut);
}
.pill-new{color:var(--accent);border-color:var(--accent);background:var(--accent-sf)}
.pill-ok{color:var(--ok);border-color:#BFD9C8;background:var(--ok-sf)}
.pill-off{text-decoration:line-through}

.empty{padding:40px 20px;text-align:center;color:var(--mut)}
.empty b{display:block;color:var(--ink);margin-bottom:6px}

/* ---- messages -------------------------------------------------------- */

.msg{border:1px solid var(--line);border-left-width:3px;border-radius:var(--r);
     padding:13px 16px;margin-bottom:18px;background:#fff;font-size:14px}
.msg-ok{border-left-color:var(--ok);background:var(--ok-sf)}
.msg-err{border-left-color:var(--accent);background:var(--accent-sf)}
.msg-warn{border-left-color:var(--warn);background:var(--warn-sf)}
.msg b{color:var(--ink)}

/* ---- forms ----------------------------------------------------------- */

.field{display:block;margin-top:14px}
.field:first-child{margin-top:0}
.label{display:block;font-size:11.5px;letter-spacing:.07em;text-transform:uppercase;
       color:var(--mut);font-weight:700;margin-bottom:6px}
.req{color:var(--accent)}
.input,.select,.textarea{
  width:100%;font:inherit;color:var(--ink);background:#fff;
  border:1px solid var(--line);border-radius:var(--r);padding:10px 12px;
}
.input:focus,.select:focus,.textarea:focus{outline:2px solid var(--accent);outline-offset:-1px;border-color:var(--accent)}
.input[readonly]{background:var(--sand);color:var(--mut)}
.textarea{min-height:76px;resize:vertical}
.hint{display:block;font-size:12px;color:var(--mut);margin-top:5px}
.err{display:block;font-size:12.5px;color:var(--accent);margin-top:5px;font-weight:600}
.has-err .input,.has-err .select,.has-err .textarea{border-color:var(--accent)}

.row{display:flex;gap:14px;flex-wrap:wrap}
.row > .field{flex:1 1 180px;margin-top:0}
.row + .row{margin-top:14px}
.w-sm{flex:0 0 110px}
.w-md{flex:0 0 160px}

.check{display:flex;gap:9px;align-items:flex-start;font-size:13.5px;cursor:pointer}
.check input{margin:3px 0 0;width:16px;height:16px;accent-color:var(--accent);flex:none}

.btn{
  display:inline-block;font:inherit;font-weight:600;cursor:pointer;
  background:var(--accent);color:#fff;border:1px solid var(--accent);
  border-radius:var(--r);padding:11px 20px;text-decoration:none;text-align:center;
}
.btn:hover{background:var(--accent-dk);border-color:var(--accent-dk)}
.btn-o{background:#fff;color:var(--ink);border-color:var(--line)}
.btn-o:hover{background:var(--sand);color:var(--ink);border-color:var(--ink)}
.btn-sm{padding:7px 13px;font-size:13px}
.btn-block{display:block;width:100%}
.btn[disabled]{opacity:.5;cursor:not-allowed}

/* A jumper block on the booking form. */
.jblock{border:1px solid var(--line);border-radius:var(--r);padding:16px;background:#fff}
.jblock + .jblock{margin-top:14px}
.jblock > h3{margin-bottom:12px;font-size:13px;letter-spacing:.08em;text-transform:uppercase;color:var(--mut)}

/* The slot and package pickers: a whole box is the target, not the dot. */
.opts{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:10px}
.opt{display:flex;gap:10px;align-items:flex-start;border:1px solid var(--line);
     border-radius:var(--r);padding:12px 14px;cursor:pointer;background:#fff}
.opt:hover{border-color:var(--ink)}
.opt:has(input:checked){border-color:var(--accent);background:var(--accent-sf)}
.opt input{margin:2px 0 0;width:16px;height:16px;accent-color:var(--accent);flex:none}
.opt b{display:block;color:var(--ink);font-size:14px}
.opt small{display:block;color:var(--mut);font-size:12px;margin-top:2px}
.opt.is-out{opacity:.5}
.opt.is-out:hover{border-color:var(--line);cursor:not-allowed}

/* ---- tables ---------------------------------------------------------- */

.tw{overflow-x:auto}
table.data{width:100%;border-collapse:collapse;font-size:13.5px}
table.data th,table.data td{padding:11px 12px;border-bottom:1px solid var(--line-2);text-align:left;vertical-align:top}
table.data th{
  background:var(--sand);color:var(--mut);font-size:10.5px;letter-spacing:.1em;
  text-transform:uppercase;white-space:nowrap;border-bottom:1px solid var(--line);
}
table.data tr:last-child td{border-bottom:0}
table.data td.num,table.data th.num{text-align:right;font-variant-numeric:tabular-nums}
table.data b{color:var(--ink)}

/* ---- the login and set password screens ------------------------------ */

.solo{min-height:100%;padding:40px 0 60px}
.solo .mark{display:block;text-align:center;margin-bottom:22px;color:var(--ink);
            text-decoration:none;font-weight:700;font-size:12px;letter-spacing:.2em;text-transform:uppercase}
.solo .mark small{display:block;color:var(--mut);letter-spacing:.14em;font-size:9.5px;margin-top:4px}

@media (max-width:560px){
  h1{font-size:19px}
  .card-pad{padding:15px}
  .tile .v{font-size:23px}
}

/* ---- 4.3: the Dashboard charts and the new pages -----------------------
 *
 * The charts are SVG written by PHP, so everything here is layout and
 * nothing is a colour the chart depends on: chart_trend() paints with
 * currentColor and var(--accent), so the line follows the palette rather
 * than fighting it.
 */
.chart-wrap{color:var(--ink)}
.chart-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:14px;margin-bottom:20px}
.chart-row .card{margin-bottom:0}

.chart-pie{display:flex;gap:16px;align-items:center;flex-wrap:wrap}
.chart-key{list-style:none;margin:0;padding:0;font-size:12.5px;line-height:1.7;min-width:0}
.chart-key li{white-space:nowrap}
.chart-dot{display:inline-block;width:9px;height:9px;border-radius:2px;margin-right:7px;vertical-align:baseline}

.chart-bars{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:7px}
.chart-bars li{display:grid;grid-template-columns:minmax(72px,auto) 1fr auto;gap:9px;align-items:center;font-size:12.5px}
.chart-bar-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chart-bar-track{background:var(--line);border-radius:3px;height:9px;overflow:hidden}
.chart-bar-fill{display:block;height:100%;background:var(--accent);border-radius:3px}
.chart-bar-n{font-weight:700;font-variant-numeric:tabular-nums}

/* Earning Modality, a card per package. */
.earn-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:14px;margin-bottom:20px}
.earn-cards .card{margin-bottom:0}
.earn-name{font-size:16px;margin:0}
.earn-k{font-size:10.5px;letter-spacing:.12em;text-transform:uppercase;color:var(--mut);margin-top:14px}
.earn-v{font-size:26px;font-weight:700;color:var(--accent);line-height:1.15;font-variant-numeric:tabular-nums}
.earn-rule{height:1px;background:var(--line);margin:14px 0}

/* Booking History filters. */
.hist-filters{display:flex;gap:12px;flex-wrap:wrap;align-items:flex-end}
.hist-filters .field{flex:1 1 170px;min-width:0;margin:0}
.hist-go{display:flex;gap:8px}

/* Payout Settings. */
.payout-waiting{border-color:var(--accent)}
.payout-waiting-h{font-size:15px;margin:0 0 6px;color:var(--accent)}
.payout-withdraw{margin-top:14px}
.payout-ask{display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.tag-warn{border-color:var(--accent);color:var(--accent)}

/* The bank box is one control now, so it needs no row of its own. */
.bank-pick{display:block;position:relative}
.bank-pick-none{color:var(--accent);margin:5px 0 0}

/* ---- 4.4, change 4A: the bank list the page draws itself ---------------
 *
 * A native <datalist> popup is drawn by the browser, outside the page, so no
 * rule in this file can reach it and its width is the browser's decision.
 * Sagar's screenshot showed it narrower than its own field with the bank
 * names cut off.
 *
 * So the list is ours. position:absolute inside .bank-pick with left and
 * right both pinned to 0 is what makes it exactly the field's width, at every
 * screen size, with nothing to keep in step by hand.
 *
 * The <datalist> is still in the markup and is still what works with the
 * script blocked. banks.js takes the `list` attribute off the input only
 * once it has drawn this, so a browser that never runs it keeps the 4.3
 * behaviour rather than losing the list altogether.
 */
.bank-list{
  position:absolute;left:0;right:0;top:100%;z-index:30;
  margin:2px 0 0;padding:4px 0;list-style:none;
  background:#fff;border:1px solid var(--line);border-radius:var(--r);
  box-shadow:0 6px 18px rgba(21,18,14,.13);
  max-height:272px;overflow-y:auto;
}
.bank-opt{
  display:block;width:100%;text-align:left;font:inherit;font-size:14px;
  background:none;border:0;padding:8px 12px;color:var(--ink);cursor:pointer;
  white-space:normal;
}
.bank-opt:hover,.bank-opt.is-on{background:var(--accent-sf);color:var(--accent-dk)}
.bank-opt mark{background:none;color:var(--accent);font-weight:700}
.bank-count{display:block;padding:6px 12px 2px;font-size:11.5px;color:var(--mut)}

/* ---- 4.4, change 3B: the country box that locks to Nepal ---------------
 *
 * Shown instead of the select when Nepali citizens is chosen. It is not a
 * disabled select: a disabled control posts nothing and reads as broken. It
 * is a plain read only line, and the server decides the nationality itself
 * in booking_fill_nationalities(), so nothing here is trusted.
 */
.locked{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  width:100%;background:var(--sand);color:var(--body);
  border:1px solid var(--line);border-radius:var(--r);padding:10px 12px;
}
.locked-k{font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--mut);font-weight:700}

/* ---- 4.4, change 1A: the charts in a rail beside the table -------------
 *
 * The three charts come out of their own row and stack in a rail that starts
 * level with Month by month, so the rail sits beside the long table where
 * there is room for it.
 *
 * flex-wrap with the main column on flex:999 is the shape 4.1 used for the
 * booking form: the rail drops under the main column on a narrow screen with
 * no media query deciding when, because the number it would have to guess is
 * the content's own width.
 */
.dash-split{display:flex;flex-wrap:wrap;gap:14px;align-items:flex-start}
.dash-main{flex:999 1 420px;min-width:0}
.dash-rail{flex:1 1 230px;min-width:0;display:flex;flex-direction:column;gap:14px}
.dash-rail .card{margin-bottom:0}
.dash-main .card:last-child{margin-bottom:0}

/* ---- 4.4, change 10B: the credit line under the footer note ------------ */
.foot-rule{height:1px;background:var(--line);margin:12px 0}
.foot-credit{font-size:12.5px;color:var(--mut);margin:0}
.foot-credit a{font-weight:600}
.foot-heart{vertical-align:-1px}

@media (max-width:640px){
  .chart-key{font-size:12px}
  .hist-filters .field{flex:1 1 100%}
  .bank-list{max-height:216px}
}

/* ---- 4.4, change 5A: the jumper rows and the add button ----------------
 *
 * The heading now sits in a row beside a Remove button, so it is one level
 * deeper than it was and `.jblock > h3` above no longer reaches it. Its
 * whole look is repeated here rather than the earlier selector being
 * loosened, because that selector is also what styles the heading on any
 * jblock without a head row.
 */
.jblock-head{display:flex;align-items:center;gap:12px;justify-content:space-between;margin-bottom:12px}
.jblock-head h3{
  margin:0;font-size:13px;letter-spacing:.08em;text-transform:uppercase;color:var(--mut);
}
.jadd{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:14px}
.jadd .hint{flex:1 1 240px;min-width:0}

/* A combo mark on a receipt or a row. Red, like the agency tag, because it
   is the same kind of fact: something about how the booking was sold. */
.tag-combo{border-color:var(--accent);color:var(--accent);font-weight:700}

/* ---- 4.4, change 2C: the logo mark beside the site name ---------------- */
.mark-row{display:flex;align-items:center;gap:9px}
.mark-logo{
  display:block;height:28px;width:auto;max-width:132px;
  object-fit:contain;flex:0 0 auto;
}
.mark-name{min-width:0}
.solo .mark .mark-row{justify-content:center}
.solo .mark-logo{height:34px;max-width:170px}

/* ---- 4.4.1: THREE SPACING FAULTS, AND THEY ARE ALL ONE FAULT ------------
 *
 * Sagar's screenshots after installing 4.4: the package box jammed against
 * the jumper's name row, the payout buttons jammed against the account
 * number, and the Earning Modality cards sitting at two different heights.
 * Measured in a browser rather than guessed at, which is how the fourth one
 * below turned up, on a page he had not photographed.
 *
 *
 * ONE. A FIELD FOLLOWED BY A ROW HAD NO GAP AT ALL.
 *
 * `.field` carries its own margin-top and `.row + .row` carries one, so
 * every pairing had a gap EXCEPT a field followed by a row, which nothing
 * covered. Nobody had written that pairing before 4.4, and change 5A put a
 * package box directly above the name row in every jumper block.
 *
 * Both orders are written out now, so the next pairing cannot be the one
 * nobody thought of.
 */
.field + .row{margin-top:14px}
.row + .field{margin-top:14px}

/*
 * TWO. THE PAYOUT BUTTONS HAD NO GAP EITHER.
 *
 * Every field above them carries margin-top:14px and `.payout-ask` carried
 * none, so Send the request sat flush against the account number box. Its
 * sibling `.payout-withdraw` has had the margin since 4.3; this one was
 * simply missed.
 */
.payout-ask{margin-top:14px}

/*
 * THREE, AND IT IS THE ONE WORTH READING. `.card + .card` LEAKS INTO EVERY
 * GRID AND EVERY FLEX COLUMN OF CARDS.
 *
 * `.card + .card{margin-top:16px}` is right for cards stacked down a page.
 * Inside a grid or a flex column it is wrong, because the gap already
 * spaces them, and it only hits the cards that have a card before them. So
 * the FIRST card gets nothing and the rest get sixteen pixels, which is
 * exactly what Sagar photographed: Deluxe level with the heading and VIP
 * and Platinum sixteen pixels lower.
 *
 * All three wrappers already said margin-bottom:0 and none of them said
 * margin-top:0. That is the whole fault, in three places, and the third was
 * the Dashboard rail that 4.4 itself added: its spacing was 14, 30, 30
 * rather than 14, 14, 14. He had not reported that one.
 *
 * Written as one rule over the three wrappers rather than three rules, so a
 * fourth wrapper is one word rather than another missed line.
 */
.chart-row .card,
.earn-cards .card,
.dash-rail .card{margin-top:0;margin-bottom:0}
