/* Tours admin — iOS look (owner 17/11: «all pages under /manage/tours should
   have the iOS look and feel»). Loaded by base_admin on a tour shop's
   /manage/tours/ pages with html.tr-ios set. The pages keep their markup;
   this re-skins their classes (tours.css, the settings hub, the setup
   wizard, the tour page forms, the travel desk's .ta-*) and styles the
   one-page desk (.td-ios). Phone rules live inside max-width queries. */

html.tr-ios {
    --ios-bg: #f2f2f7; --ios-card: #fff; --ios-ink: #1c1c1e; --ios-sub: #8e8e93;
    --ios-sep: rgba(60, 60, 67, .13); --ios-fill: rgba(118, 118, 128, .12);
    --ios-blue: #0a84ff; --ios-green: #34c759; --ios-orange: #ff9500; --ios-red: #ff3b30;
    --ios-purple: #af52de; --ios-teal: #30b0c7; --ios-indigo: #5856d6; --ios-gray: #8e8e93;
    --ios-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    /* the older pages' own variables, pointed at iOS values */
    --tr-ink: var(--ios-ink); --tr-paper: var(--ios-card); --tr-rule: var(--ios-sep); --tr-rule-soft: var(--ios-sep);
    --tr-gold-1: var(--ios-blue); --tr-gold-2: var(--ios-blue); --tr-gold-3: var(--ios-blue);
    --tr-success: var(--ios-green); --tr-amber: var(--ios-orange); --tr-danger: var(--ios-red);
}
html.tr-ios .admin-main { background: var(--ios-bg); }
html.tr-ios .admin-main, html.tr-ios .admin-main input, html.tr-ios .admin-main select,
html.tr-ios .admin-main textarea, html.tr-ios .admin-main button { font-family: var(--ios-font); }

/* ── shared page frame ─────────────────────────────────────────── */
html.tr-ios .tours-shell, html.tr-ios .ta { max-width: 1180px; margin: 0 auto; gap: 14px; font-variant-numeric: tabular-nums; }
html.tr-ios .tours-head, html.tr-ios .ta-head { border: 0; padding: 4px 4px 0; align-items: flex-end; flex-wrap: wrap; }
html.tr-ios .tours-head h1, html.tr-ios .ta h1, html.tr-ios .ts-title {
    font-family: var(--ios-font); font-size: 2rem; font-weight: 700; letter-spacing: -.02em; color: var(--ios-ink); margin: 0; }
html.tr-ios .tours-head p, html.tr-ios .ta-head p { color: var(--ios-sub) !important; }
html.tr-ios h2, html.tr-ios h3, html.tr-ios h4 { font-family: var(--ios-font); letter-spacing: -.01em; }

/* buttons → iOS pills */
html.tr-ios .tours-btn, html.tr-ios .ta-btn {
    font-family: var(--ios-font); font-size: .88rem; font-weight: 600; text-transform: none; letter-spacing: 0;
    border-radius: 10px; padding: .5rem .9rem; box-shadow: none; border: 0; line-height: 1.2; }
html.tr-ios .tours-btn:hover, html.tr-ios .ta-btn:hover { transform: none; }
html.tr-ios .tours-btn--primary, html.tr-ios .tours-btn:not(.tours-btn--ghost), html.tr-ios .ta-btn:not(.ghost):not(.danger) {
    background: var(--ios-blue); color: #fff !important; }
html.tr-ios .tours-btn--ghost, html.tr-ios .ta-btn.ghost { background: #fff; color: var(--ios-blue) !important; border: 0; box-shadow: none; }
html.tr-ios .ta-btn.danger { background: #fff; color: var(--ios-red) !important; box-shadow: none; }

/* cards → grouped iOS cards */
html.tr-ios .tours-stat-card, html.tr-ios .td-card, html.tr-ios .ta-card, html.tr-ios .ts-card,
html.tr-ios .tours-recent, html.tr-ios .tours-form, html.tr-ios .tours-board-col, html.tr-ios .tours-manifest-doc {
    background: var(--ios-card); border: 0 !important; border-radius: 14px; box-shadow: none; }
html.tr-ios .tours-recent { padding: 14px 16px; }
html.tr-ios .tours-recent h3, html.tr-ios .td-card h3, html.tr-ios .ta-card h2 {
    font-size: .8rem; font-weight: 600; color: var(--ios-sub); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 10px; }
html.tr-ios .tours-stats { gap: 12px; }
html.tr-ios .tours-stat-card { padding: 14px 16px; }
html.tr-ios .tours-stat-num { font-family: var(--ios-font); font-size: 2rem; font-weight: 700; color: var(--ios-ink); letter-spacing: -.02em; }
html.tr-ios .tours-stat-label { font-family: var(--ios-font); font-size: .8rem; font-weight: 600; color: var(--ios-sub); text-transform: none; letter-spacing: 0; }
html.tr-ios .ts-card:hover { transform: none; background: #f7f7fa; }
html.tr-ios .ts-card .icon { border-radius: 8px; }
html.tr-ios .tours-mono { font-family: var(--ios-font); font-variant-numeric: tabular-nums; }

/* tables → inset grouped lists */
html.tr-ios .tours-table, html.tr-ios .ta table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--ios-card); border-radius: 12px; overflow: hidden; font-size: .92rem; }
html.tr-ios .tours-table th, html.tr-ios .ta th { background: transparent; color: var(--ios-sub); font-weight: 600; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; border-bottom: .5px solid var(--ios-sep); padding: 9px 12px; font-family: var(--ios-font); }
html.tr-ios .tours-table td, html.tr-ios .ta td { border-bottom: .5px solid var(--ios-sep); padding: 11px 12px; }
html.tr-ios .tours-table tr:last-child td, html.tr-ios .ta tr:last-child td { border-bottom: 0; }
html.tr-ios .tours-table tbody tr:hover td { background: #f7f7fa; }

/* status chips */
html.tr-ios .tours-status, html.tr-ios .tours-badge { font-family: var(--ios-font); border-radius: 999px; font-size: .74rem; font-weight: 600; letter-spacing: 0; text-transform: none; padding: 3px 9px; }
html.tr-ios .tours-status--open, html.tr-ios .tours-status--confirmed, html.tr-ios .tours-badge--ok { background: rgba(52,199,89,.15); color: #1d7a37; }
html.tr-ios .tours-status--low, html.tr-ios .tours-status--pending { background: rgba(255,149,0,.16); color: #a35a00; }
html.tr-ios .tours-status--on_track { background: rgba(10,132,255,.13); color: #0060c0; }
html.tr-ios .tours-status--sold_out, html.tr-ios .tours-status--departed, html.tr-ios .tours-status--completed, html.tr-ios .tours-badge--off { background: var(--ios-fill); color: #3a3a3c; }
html.tr-ios .tours-status--cancelled, html.tr-ios .tours-status--no_show { background: rgba(255,59,48,.13); color: #c4271c; }
html.tr-ios .tours-meter { background: var(--ios-fill); border-radius: 999px; }
html.tr-ios .tours-meter-fill { background: var(--ios-blue); border-radius: 999px; }

/* board columns */
html.tr-ios .tours-board-col-head { font-family: var(--ios-font); text-transform: none; letter-spacing: 0; font-size: .85rem; border-radius: 14px 14px 0 0; }
html.tr-ios .tours-board-card { border-radius: 12px; border: 0; box-shadow: 0 1px 0 var(--ios-sep); }
html.tr-ios .tours-board-card-title { font-family: var(--ios-font); }

/* forms: 16px inputs (no iPhone zoom), rounded fills */
html.tr-ios .admin-main input[type=text], html.tr-ios .admin-main input[type=number], html.tr-ios .admin-main input[type=date],
html.tr-ios .admin-main input[type=time], html.tr-ios .admin-main input[type=email], html.tr-ios .admin-main input[type=tel],
html.tr-ios .admin-main input[type=search], html.tr-ios .admin-main input[type=url], html.tr-ios .admin-main select, html.tr-ios .admin-main textarea {
    font-size: 16px; border: 0 !important; background: var(--ios-fill) !important; border-radius: 10px !important; padding: 10px 12px; color: var(--ios-ink); outline: none; }
html.tr-ios .admin-main input:focus, html.tr-ios .admin-main select:focus, html.tr-ios .admin-main textarea:focus { box-shadow: 0 0 0 3px rgba(10,132,255,.28) !important; background: #fff !important; }
html.tr-ios .td-card details summary { font-weight: 600; }
html.tr-ios .td-days label { background: #fff; border: 0; box-shadow: inset 0 0 0 1px var(--ios-sep); }
html.tr-ios .td-days label:has(input:checked) { background: rgba(10,132,255,.12); box-shadow: inset 0 0 0 1px rgba(10,132,255,.5); }
html.tr-ios .admin-main input[type=checkbox], html.tr-ios .admin-main input[type=radio] { accent-color: var(--ios-blue); }

/* setup wizard */
html.tr-ios .sw-step-title { font-family: var(--ios-font); font-weight: 700; letter-spacing: -.01em; }
html.tr-ios .sw-step-eyebrow { color: var(--ios-blue); }

/* ── the one-page desk ─────────────────────────────────────────── */
.td-ios { color: var(--ios-ink); max-width: 1240px; margin: 0 auto; padding: 10px 0 90px; font-variant-numeric: tabular-nums; }
.td-ios a { color: inherit; text-decoration: none; }
.td-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 4px 14px; }
.td-cap { font-size: .8rem; font-weight: 600; color: var(--ios-sub); }
.td-title { font-size: 2rem; font-weight: 700; letter-spacing: -.02em; margin: 0; line-height: 1.15; }
.td-head-r { display: flex; gap: 8px; flex-wrap: wrap; }
.td-pill { display: inline-flex; align-items: center; gap: 6px; background: #fff; color: var(--ios-blue) !important; border-radius: 10px; padding: .45rem .8rem; font-weight: 600; font-size: .86rem; white-space: nowrap; border: 0; cursor: pointer; }
.td-pill:hover { background: #e9e9ee; }
.td-pill.fill { background: var(--ios-blue); color: #fff !important; }
.td-sec { font-size: .8rem; font-weight: 600; color: var(--ios-sub); text-transform: uppercase; letter-spacing: .04em; margin: 22px 16px 8px; }
.td-group { background: var(--ios-card); border-radius: 14px; overflow: hidden; margin-bottom: 14px; }
.td-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; position: relative; min-height: 48px; }
.td-row + .td-row::before { content: ''; position: absolute; top: 0; right: 0; left: 56px; border-top: .5px solid var(--ios-sep); }
a.td-row:hover { background: #f7f7fa; }
.td-row-t { flex: 1 1 auto; min-width: 0; font-size: .93rem; }
.td-row-t small { display: block; color: var(--ios-sub); font-size: .8rem; }
.td-row-v { color: var(--ios-sub); font-size: .9rem; text-align: right; white-space: nowrap; }
.td-chev { color: #c7c7cc; font-size: .8rem; }
.td-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #fff; flex: 0 0 auto; font-size: .95rem; background: var(--c, var(--ios-gray)); }
.td-ios .green { --c: var(--ios-green); } .td-ios .blue { --c: var(--ios-blue); } .td-ios .orange { --c: var(--ios-orange); } .td-ios .red { --c: var(--ios-red); }
.td-ios .purple { --c: var(--ios-purple); } .td-ios .teal { --c: var(--ios-teal); } .td-ios .indigo { --c: var(--ios-indigo); } .td-ios .gray { --c: var(--ios-gray); }
.td-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.td-kpi { background: var(--ios-card); border-radius: 16px; padding: 14px 16px; min-width: 0; }
.td-kpi span { font-size: .8rem; font-weight: 600; color: var(--ios-sub); display: block; }
.td-kpi b { font-size: 2rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; display: block; }
.td-kpi small { color: var(--ios-sub); font-size: .8rem; }
.td-kpi.warn b { color: var(--ios-orange); }
.td-cols { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.td-card2 { background: var(--ios-card); border-radius: 16px; padding: 14px 16px; min-width: 0; margin-bottom: 14px; }
.td-card-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.td-card-h > span { font-size: .8rem; font-weight: 600; color: var(--ios-sub); text-transform: uppercase; letter-spacing: .04em; }
.td-card-h a { font-size: .84rem; font-weight: 600; color: var(--ios-blue) !important; }
.td-empty { color: var(--ios-sub); font-size: .9rem; padding: 14px 0 6px; text-align: center; }
.td-dep { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-top: .5px solid var(--ios-sep); }
.td-dep:first-of-type { border-top: 0; }
.td-dep .t { font-weight: 700; font-size: 1.05rem; }
.td-dep .t small { display: block; font-weight: 600; color: var(--ios-sub); font-size: .72rem; text-transform: uppercase; }
.td-dep .n { min-width: 0; }
.td-dep .n b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.td-bar { height: 6px; border-radius: 999px; background: var(--ios-fill); overflow: hidden; margin-top: 6px; }
.td-bar i { display: block; height: 100%; background: var(--ios-blue); border-radius: 999px; }
.td-bar.full i { background: var(--ios-green); }
.td-dep .x { display: flex; gap: 6px; }
.td-mini { display: inline-flex; align-items: center; gap: 4px; background: var(--ios-fill); color: var(--ios-blue) !important; border-radius: 8px; padding: 5px 9px; font-size: .8rem; font-weight: 600; }
.td-chip { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 8px; font-size: .72rem; font-weight: 600; background: var(--ios-fill); color: #3a3a3c; }
.td-chip.ok { background: rgba(52,199,89,.15); color: #1d7a37; }
.td-chip.wait { background: rgba(255,149,0,.16); color: #a35a00; }
.td-chip.no { background: rgba(255,59,48,.13); color: #c4271c; }
.td-chip.info { background: rgba(10,132,255,.13); color: #0060c0; }
.td-search { display: flex; gap: 8px; margin-bottom: 8px; }
.td-search input { flex: 1; }
.td-bk { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 10px 0; border-top: .5px solid var(--ios-sep); font-size: .92rem; }
.td-bk:first-of-type { border-top: 0; }
.td-bk b { font-weight: 600; }
.td-bk small { color: var(--ios-sub); grid-column: 1 / -1; }
.td-tour { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 14px; position: relative; }
.td-tour + .td-tour::before { content: ''; position: absolute; top: 0; right: 0; left: 80px; border-top: .5px solid var(--ios-sep); }
.td-tour .im { width: 54px; height: 54px; border-radius: 10px; overflow: hidden; background: var(--ios-fill); display: grid; place-items: center; color: var(--ios-sub); }
.td-tour .im img { width: 100%; height: 100%; object-fit: cover; }
.td-tour .tt b { display: block; font-weight: 600; }
.td-tour .tt small { color: var(--ios-sub); font-size: .8rem; }
.td-tour .acts { display: flex; gap: 6px; align-items: center; }
.td-switch { position: relative; width: 46px; height: 28px; border-radius: 999px; background: #e9e9ea; border: 0; cursor: pointer; transition: background .2s; }
.td-switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: transform .2s; }
.td-switch.on { background: var(--ios-green); }
.td-switch.on::after { transform: translateX(18px); }
.td-inline { display: flex; gap: 8px; align-items: center; flex: 1 1 260px; min-width: 0; }
.td-inline input { flex: 1; min-width: 0; }
.td-code { width: 100%; font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace !important; background: #f7f7fa !important; border-radius: 10px; padding: 10px; border: 0; resize: none; }
@media (max-width: 1100px) { .td-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .td-cols { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) {
    .td-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .td-kpi b { font-size: 1.6rem; }
    .td-title, html.tr-ios .tours-head h1, html.tr-ios .ta h1 { font-size: 1.6rem; }
    .td-dep .n b { white-space: normal; }
    .td-tour { grid-template-columns: 46px minmax(0, 1fr); }
    .td-tour .im { width: 46px; height: 46px; }
    .td-tour .acts { grid-column: 1 / -1; justify-content: flex-end; }
    html.tr-ios .tours-table { font-size: .85rem; }
}
