/* TMS admin – Etihad Pioneers branding. Scoped to .tms-admin pages. */
.tms-admin { --dark: #0B3D2C; --brand: #007D70; --green: #00885B; --ink: #383838; --muted: #6B7470; --line: #DDE5E2; --tint: #E6F2EF; --bg: #F3F6F5; color: var(--ink); }
.tms-admin, .tms-admin h1, .tms-admin h2, .tms-admin h3 { font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
#wpbody-content .tms-admin { max-width: 1400px; }
.tms-admin h2 { color: var(--dark); font-size: 16px; font-weight: 700; margin: 4px 0 12px; }

/* Header */
.tms-hero { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; background: var(--dark); color: #fff; border-radius: 14px; padding: 18px 22px; margin: 14px 0 16px; border-bottom: 4px solid var(--green); }
.tms-hero-logo { max-height: 40px; width: auto; display: block; }
.tms-hero .tms-wordmark { display: flex; flex-direction: column; line-height: 1.1; }
.tms-hero .tms-wordmark strong { font-size: 15px; }
.tms-hero .tms-wordmark small { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; opacity: .75; }
.tms-hero-brand { padding-right: 20px; border-right: 1px solid rgba(255,255,255,.2); }
.tms-hero-text { flex: 1; min-width: 220px; }
.tms-hero-text h1 { color: #fff; font-size: 22px; font-weight: 700; margin: 0; padding: 0; line-height: 1.25; }
.tms-hero-text p { margin: 4px 0 0; color: #CFE5DF; font-size: 13px; }
.tms-hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tms-abtn { display: inline-flex; align-items: center; min-height: 38px; padding: 0 16px; border-radius: 10px; background: rgba(255,255,255,.12); color: #fff; text-decoration: none; font-weight: 600; font-size: 13px; border: 1px solid rgba(255,255,255,.25); }
.tms-abtn:hover, .tms-abtn:focus { background: rgba(255,255,255,.22); color: #fff; }
.tms-abtn--primary { background: var(--green); border-color: var(--green); }
.tms-abtn--primary:hover { background: #009966; }

/* Buttons inside our pages */
.tms-admin .button-primary { background: var(--brand); border-color: var(--brand); border-radius: 8px; }
.tms-admin .button-primary:hover, .tms-admin .button-primary:focus { background: #006b60; border-color: #006b60; }
.tms-admin .button { border-radius: 8px; }
.tms-admin a { color: var(--brand); }
.tms-admin .tms-hero a { color: #fff; }

/* Panels */
.tms-panel { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin: 0 0 16px; box-shadow: 0 1px 2px rgba(11,61,44,.04); }
.tms-panel--flush { padding: 8px 14px 14px; }
.tms-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.tms-panel-head h2 { margin: 0; }
.tms-two-col { display: grid; gap: 0 18px; grid-template-columns: minmax(0, 1.7fr) minmax(320px, 1fr); align-items: start; }
@media (max-width: 1100px) { .tms-two-col { grid-template-columns: 1fr; } }
.tms-sub { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.tms-muted { color: #8C948F; }
.tms-warn-text { color: #B54708; font-weight: 600; }
.tms-danger { color: #B42318 !important; }
.tms-bullets { margin: 0; padding-left: 18px; list-style: disc; }
.tms-bullets li { margin-bottom: 8px; }
.tms-inline-form { display: inline-block; margin: 0 6px 6px 0; }
.tms-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: -4px 0 14px; }

/* KPIs */
.tms-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 0 0 16px; }
.tms-kpis--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .tms-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tms-kpi { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; text-decoration: none; color: var(--ink); border-top: 4px solid var(--brand); transition: box-shadow .15s, transform .15s; }
a.tms-kpi:hover { box-shadow: 0 6px 20px rgba(11,61,44,.1); transform: translateY(-1px); color: var(--ink); }
.tms-kpi-num { font-size: 30px; font-weight: 700; line-height: 1.1; color: var(--dark); }
.tms-kpi-label { color: var(--muted); font-size: 13px; margin-top: 4px; font-weight: 500; }

/* Needs attention */
.tms-attention { border-left: 5px solid #F79009; background: #FFFAEB; }
.tms-attention ul { margin: 0; }
.tms-attention li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid #FEDF89; margin: 0; }
.tms-attention li:last-child { border-bottom: 0; }
.tms-attention a { font-weight: 600; white-space: nowrap; }

/* Session list */
.tms-session-list { margin: 0; }
.tms-session-list li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); margin: 0; }
.tms-session-list li:last-child { border-bottom: 0; }
.tms-sl-date { width: 48px; height: 52px; border-radius: 10px; background: var(--tint); color: var(--dark); display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 0 0 auto; }
.tms-sl-date span { font-size: 18px; font-weight: 700; line-height: 1; }
.tms-sl-date small { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.tms-sl-main { flex: 1; min-width: 0; }
.tms-sl-main a { text-decoration: none; color: var(--dark); }
.tms-sl-stats { text-align: center; }
.tms-sl-count { display: block; font-size: 22px; font-weight: 700; color: var(--brand); line-height: 1; }
.tms-sl-stats small { color: var(--muted); font-size: 11px; }

/* Pills */
.tms-pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; line-height: 18px; background: #EEF1F0; color: #50575E; }
.tms-pill--ok { background: #E3F4EC; color: #05603A; }
.tms-pill--warn { background: #FEF0C7; color: #93370D; }
.tms-pill--error { background: #FEE4E2; color: #B42318; }
.tms-pill--neutral, .tms-pill--skipped { background: #EEF1F0; color: #50575E; }

/* Tables */
.tms-admin .wp-list-table { border-radius: 10px; overflow: hidden; border-color: var(--line); }
.tms-admin .wp-list-table thead th, .tms-admin .wp-list-table tfoot th { background: var(--bg); font-weight: 600; }
.tms-admin .row-title { color: var(--dark); }
.tms-mini-table td, .tms-mini-table th { vertical-align: middle; }
.tms-admin .tms-filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tms-admin .tms-w-sm { width: 120px; }

/* Tabs */
.tms-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 0 0 16px; border-bottom: 2px solid var(--line); }
.tms-tabs a { padding: 10px 16px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tms-tabs a:hover { color: var(--dark); }
.tms-tabs a.is-active { color: var(--dark); border-bottom-color: var(--green); }

/* Switch */
.tms-switch { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; cursor: pointer; }
.tms-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tms-switch-ui { flex: 0 0 auto; width: 40px; height: 22px; border-radius: 999px; background: #C7CFCC; position: relative; transition: background .15s; margin-top: 1px; }
.tms-switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.tms-switch input:checked + .tms-switch-ui { background: var(--green); }
.tms-switch input:checked + .tms-switch-ui::after { transform: translateX(18px); }
.tms-switch input:focus-visible + .tms-switch-ui { box-shadow: 0 0 0 3px rgba(0,125,112,.3); }
.tms-switch-text strong { display: block; font-weight: 600; }
.tms-switch-text small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }

/* Filter bar */
.tms-filterbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Timeline */
.tms-timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.tms-timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tms-tl-day { margin: 14px 0 8px 28px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.tms-tl-day:first-child { margin-top: 0; }
.tms-tl-item { position: relative; padding: 0 0 14px 28px; margin: 0; }
.tms-tl-dot { position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--brand); box-sizing: border-box; }
.tms-tl--auto .tms-tl-dot { border-color: var(--green); }
.tms-tl--people .tms-tl-dot { border-color: var(--brand); background: var(--tint); }
.tms-tl--admin .tms-tl-dot { border-color: var(--ink); }
.tms-tl--warn .tms-tl-dot { border-color: #F79009; }
.tms-tl--danger .tms-tl-dot { border-color: #D92D20; background: #FEE4E2; }
.tms-tl-body { background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.tms-tl-head { display: flex; justify-content: space-between; gap: 10px; }
.tms-tl-head strong { color: var(--dark); font-size: 13px; }
.tms-tl-head time { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.tms-tl-body p { margin: 3px 0 0; font-size: 13px; }
.tms-tl-meta { color: var(--muted); font-size: 12px !important; }
.tms-tl-changes { margin-top: 6px; font-size: 12px; }
.tms-tl-changes summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.tms-tl-changes table { margin-top: 6px; border-collapse: collapse; }
.tms-tl-changes th { text-align: left; padding: 2px 10px 2px 0; font-weight: 600; }
.tms-tl-changes td { padding: 2px 8px 2px 0; }
.tms-tl-changes del { color: #B42318; }

/* Steps (Help) */
.tms-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1100px) { .tms-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tms-stepcard h3 { margin: 10px 0 6px; color: var(--dark); font-size: 15px; }
.tms-stepcard p { margin: 0; color: var(--muted); }
.tms-stepnum { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--dark); color: #fff; font-weight: 700; }

/* Misc */
.tms-help pre { background: var(--bg); padding: 10px; overflow: auto; font-size: 12px; white-space: pre; border-radius: 8px; }
.tms-report { margin: 12px 0 16px; }
.tms-qr-panel { text-align: center; }
.tms-admin-qr { display: inline-block; padding: 12px; border-radius: 12px; border: 3px solid var(--green); }
.tms-admin-qr svg { width: 220px; height: auto; display: block; }
.tms-admin-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; list-style: none; margin: 0 0 12px; padding: 0; }
.tms-admin-photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; }
.tms-admin-photos label { font-size: 12px; }
.tms-logo-pick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tms-logo-preview { display: inline-flex; align-items: center; justify-content: center; min-width: 160px; height: 56px; padding: 6px 12px; border-radius: 10px; background: var(--dark); color: #CFE5DF; font-size: 12px; }
.tms-logo-preview img { max-height: 40px; width: auto; }
.tms-admin fieldset[disabled] input, .tms-admin fieldset[disabled] select { background: var(--bg); }
.wp-list-table.learners .column-learner_id { width: 140px; }
.wp-list-table.learners .column-id_number { width: 150px; }
.wp-list-table.learners .column-attendance_status, .wp-list-table.learners .column-training_date { width: 110px; }

/* Create-session form */
.tms-session-form h2 { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.tms-session-form h2:first-of-type { margin-top: 4px; padding-top: 0; border-top: 0; }
.tms-session-form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.tms-fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
@media (max-width: 782px) { .tms-fgrid { grid-template-columns: 1fr; } }
.tms-f { margin: 0; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.tms-f--wide { grid-column: 1 / -1; }
.tms-f label, .tms-flabel { font-weight: 600; color: var(--dark); font-size: 13px; }
.tms-f input[type="text"], .tms-f input[type="date"], .tms-f input[type="number"], .tms-f select, .tms-f textarea { width: 100%; max-width: 100%; min-height: 38px; border-radius: 8px; border-color: #C3CBC8; }
.tms-f input.small-text { width: 120px; }
.tms-f input:focus, .tms-f select:focus, .tms-f textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(0,125,112,.18); }
.tms-help { color: var(--muted); font-size: 12px; }
.tms-req { color: #B42318; }
.tms-radios { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.tms-radios input, .tms-check input { accent-color: var(--brand); }
.tms-check { font-weight: 500 !important; display: flex; gap: 8px; align-items: center; }
.tms-code-preview { display: flex; align-items: center; gap: 8px; min-height: 38px; }
.tms-code-preview code { font-size: 15px; font-weight: 700; color: var(--dark); background: var(--tint); padding: 6px 10px; border-radius: 8px; }
.tms-kpi-of { font-size: 16px; color: var(--muted); font-weight: 600; }
.tms-btnrow { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.tms-howto ol { margin: 0 0 0 18px; display: grid; gap: 10px; color: var(--ink); }
.tms-table-scroll { overflow-x: auto; }
.tms-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 782px) { .tms-seg { grid-template-columns: 1fr; } }
.tms-seg label { position: relative; }
.tms-seg input { position: absolute; opacity: 0; inset: 0; }
.tms-seg span { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 44px; padding: 6px 10px; border: 1.5px solid #C3CBC8; border-radius: 10px; font-weight: 600; font-size: 13px; color: var(--ink); background: #fff; cursor: pointer; }
.tms-seg input:checked + span { border-color: var(--brand); background: var(--tint); color: var(--dark); box-shadow: inset 0 0 0 1px var(--brand); }
.tms-seg input:focus-visible + span { box-shadow: 0 0 0 3px rgba(0,125,112,.3); }
.tms-f input[type="time"] { width: 100%; min-height: 38px; border-radius: 8px; border-color: #C3CBC8; }

/* Certificate cell at the end of learner rows */
.tms-cert-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 150px; }
.tms-cert-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.tms-upload-btn { position: relative; overflow: hidden; }
.tms-upload-btn input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.tms-upload-btn:focus-within { box-shadow: 0 0 0 2px var(--brand); }
.tms-cert-cell.is-busy { opacity: .6; pointer-events: none; }
.tms-cert-msg { font-size: 11.5px; }
.tms-cert-msg.is-ok { color: #05603A; font-weight: 600; }
.tms-cert-msg.is-error { color: #B42318; font-weight: 600; }
.tms-bulk > summary { cursor: pointer; list-style: none; display: flex; flex-direction: column; gap: 2px; }
.tms-bulk > summary::-webkit-details-marker { display: none; }
.tms-bulk > summary strong { color: var(--dark); }
.tms-bulk > summary strong::before { content: "+ "; color: var(--brand); }
.tms-bulk[open] > summary strong::before { content: "– "; }
.tms-bulk[open] > summary { margin-bottom: 12px; }
.tms-bulk .tms-two-col .tms-panel { box-shadow: none; }
.wp-list-table.learners .column-certificate_expiry_date { width: 190px; }

/* Bookings */
.tms-count-badge { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 999px; background: var(--line); color: var(--dark); font-size: 11px; line-height: 18px; text-align: center; margin-left: 4px; }
.tms-count-badge.is-hot { background: #F79009; color: #fff; }
.tms-filterbar--plain { margin: 0 0 12px; display: flex; gap: 6px; }
.tms-filterbar--plain input[type="search"] { min-width: 260px; }
.tms-req-table th.num, .tms-req-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.tms-empty { text-align: center; padding: 36px 16px; }
.tms-step { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--dark); color: #fff; font-size: 12px; margin-right: 6px; vertical-align: 1px; }
.tms-f.has-error input, .tms-f.has-error select, textarea.has-error { border-color: #B42318 !important; background: #FEF3F2; }
.tms-ferr { color: #B42318; font-size: 12px; font-weight: 600; }
.tms-seg--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 782px) { .tms-seg--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tms-avail { font-size: 12px; font-weight: 600; min-height: 1.2em; }
.tms-avail.is-free { color: #05603A; }
.tms-avail.is-busy { color: #B54708; }
.tms-sticky { position: sticky; top: 46px; }
.tms-summary dl { margin: 0 0 14px; display: grid; gap: 8px; }
.tms-summary dl div { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dashed var(--line); padding-bottom: 6px; }
.tms-summary dt { color: var(--muted); font-size: 12px; }
.tms-summary dd { margin: 0; font-weight: 600; color: var(--dark); text-align: right; font-variant-numeric: tabular-nums; }
.tms-wide-btn { width: 100%; justify-content: center; text-align: center; }
.tms-statusbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-radius: 12px; background: #fff; border: 1px solid var(--line); margin-bottom: 16px; }
.tms-statusbar--warn { border-left: 5px solid #F79009; }
.tms-statusbar--ok { border-left: 5px solid var(--green); }
.tms-statusbar--error { border-left: 5px solid #D92D20; }
.tms-statusbar > span:nth-child(2) { flex: 1; color: var(--muted); font-size: 13px; }
.tms-note { border-left: 5px solid var(--brand); }
.tms-note p { margin: 4px 0 0; }
.tms-dl { margin: 0; display: grid; gap: 0; }
.tms-dl div { display: grid; grid-template-columns: 140px 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.tms-dl div:last-child { border-bottom: 0; }
.tms-dl dt { color: var(--muted); font-size: 13px; }
.tms-dl dd { margin: 0; font-weight: 600; color: var(--dark); word-break: break-word; }
.tms-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
@media (max-width: 960px) { .tms-grid2 { grid-template-columns: 1fr; } }
.tms-decide { border-top: 4px solid var(--brand); }
.tms-decide-btns { display: grid; grid-template-columns: 1.5fr 1fr; gap: 8px; }
.tms-decide-btns .button-hero { justify-content: center; text-align: center; }
.tms-btn-danger { color: #B42318 !important; border-color: #FDA29B !important; }
.tms-btn-danger:hover { background: #FEF3F2 !important; }
.tms-conflict { background: #FFFAEB; border: 1px solid #FEDF89; border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: 13px; }
.tms-conflict ul { margin: 6px 0 0 16px; list-style: disc; }
.tms-ok-text { color: #05603A; font-weight: 600; }

/* Calendar */
.tms-cal-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-bottom: 12px; }
.tms-cal-nav { display: flex; align-items: center; gap: 8px; }
.tms-cal-nav h2 { margin: 0 6px; min-width: 150px; text-align: center; }
.tms-cal-legend { display: flex; gap: 8px; margin-left: auto; }
.tms-cal-legend .tms-ev { margin: 0; }
.tms-cal-scroll { overflow-x: auto; }
.tms-cal { display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); min-width: 860px; background: var(--line); gap: 1px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.tms-cal-head { background: var(--dark); color: #fff; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; padding: 8px 10px; }
.tms-cal-day { background: #fff; min-height: 110px; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.tms-cal-day.is-out { background: var(--bg); }
.tms-cal-day.is-past { background: #FAFBFA; }
.tms-cal-day.is-today { box-shadow: inset 0 0 0 2px var(--green); }
.tms-cal-num { display: flex; justify-content: space-between; align-items: center; font-weight: 700; color: var(--dark); font-size: 13px; }
.tms-cal-day.is-today .tms-cal-num span { background: var(--green); color: #fff; border-radius: 999px; padding: 0 7px; }
.tms-cal-add { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; text-decoration: none; color: var(--brand); font-weight: 700; opacity: 0; transition: opacity .15s; }
.tms-cal-day:hover .tms-cal-add, .tms-cal-add:focus { opacity: 1; background: var(--tint); }
.tms-ev { display: block; text-decoration: none; border-radius: 6px; padding: 3px 6px; font-size: 11.5px; line-height: 1.3; border-left: 3px solid; }
.tms-ev small { display: block; color: var(--muted); font-size: 10.5px; }
.tms-ev--session { background: var(--tint); border-color: var(--green); color: var(--dark); }
.tms-ev--pending { background: #FFFAEB; border-color: #F79009; color: #93370D; border-style: dashed; border-left-style: solid; }
.tms-ev:hover { filter: brightness(.97); }
.tms-ev-more { font-size: 11px; color: var(--muted); padding-left: 4px; }

/* Booking wizard (SimplyBook-style) */
.tms-wiz-steps { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.tms-wiz-steps li { margin: 0; position: relative; }
.tms-wiz-steps li + li::before { content: ""; position: absolute; left: -9px; top: 50%; width: 16px; height: 16px; border-top: 1px solid var(--line); border-right: 1px solid var(--line); transform: translateY(-50%) rotate(45deg); background: inherit; z-index: 1; }
.tms-wiz-steps button { width: 100%; min-height: 58px; border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 6px 14px; cursor: pointer; font: inherit; color: var(--muted); }
.tms-wiz-steps button:disabled { cursor: default; opacity: .65; }
.tms-wiz-steps li.is-done, .tms-wiz-steps li.is-current { background: #C9F2C0; }
.tms-wiz-steps li.is-current button { color: var(--dark); font-weight: 700; }
.tms-wiz-steps li.is-done button { color: var(--dark); }
.tms-wiz-l { font-size: 13px; }
.tms-wiz-v { font-size: 11px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 960px) { .tms-wiz-steps { grid-template-columns: repeat(3, 1fr); } .tms-wiz-steps li + li::before { display: none; } }
.tms-wiz-top { display: flex; justify-content: space-between; align-items: center; margin: 0 0 10px; }
.tms-wiz-top .button-link { font-size: 14px; text-decoration: none; }
.tms-pick { display: grid; gap: 10px; max-width: 900px; }
.tms-pick-card { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 16px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; box-shadow: 0 1px 2px rgba(11,61,44,.04); }
.tms-pick-card.is-selected { border-color: var(--green); box-shadow: 0 0 0 1px var(--green); }
.tms-pick-ico svg { width: 44px; height: 44px; fill: none; stroke: var(--green); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.tms-pick-body strong { color: var(--dark); font-size: 14px; }
.tms-pick-card .button-primary { min-width: 110px; justify-content: center; background: var(--green); border-color: var(--green); font-weight: 700; }
.tms-wiz-search { max-width: 900px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; display: flex; gap: 10px; align-items: center; }
.tms-wiz-search label { font-weight: 700; color: var(--dark); }
.tms-wiz-cal { max-width: 1100px; }
.tms-wiz-calhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.tms-wiz-calhead .button-link { color: var(--green); text-decoration: none; font-weight: 600; }
.tms-wiz-calhead strong { color: var(--dark); }
.tms-wiz-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.tms-wd { text-align: center; font-size: 11px; font-weight: 700; color: var(--ink); padding-bottom: 6px; border-bottom: 2px solid var(--line); }
.tms-wd.is-we { color: #C0392B; }
.tms-day { height: 38px; border: 0; border-radius: 8px; background: transparent; font: inherit; font-weight: 600; color: var(--dark); cursor: pointer; }
.tms-day.is-free:hover { background: var(--tint); }
.tms-day.is-past, .tms-day.is-full { color: #B9C2BE; cursor: default; }
.tms-day.is-full { text-decoration: line-through; }
.tms-day.is-loading { color: var(--muted); }
.tms-day.is-today { box-shadow: inset 0 0 0 2px var(--line); }
.tms-day.is-selected { background: #CFE0F7; color: #0B3D2C; }
.tms-wiz-timegrid { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; max-width: 1100px; align-items: start; }
@media (max-width: 782px) { .tms-wiz-timegrid { grid-template-columns: 1fr; } }
.tms-wiz-sidecard strong { display: block; color: var(--dark); }
.tms-wiz-sidecard hr { border: 0; border-top: 1px solid var(--line); margin: 10px 0; }
.tms-slots { display: grid; gap: 8px; max-height: 440px; overflow-y: auto; padding-right: 4px; scroll-behavior: smooth; }
.tms-slot-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tms-slot-h { width: 72px; font-weight: 600; color: var(--ink); font-size: 13px; }
.tms-slot { min-width: 82px; height: 34px; border: 0; border-radius: 6px; font: 600 13px/1 inherit; cursor: pointer; }
.tms-slot.is-free { background: #DCE7F7; color: #1F3B63; }
.tms-slot.is-free:not(.is-inrange):not(.is-start):not(.is-end):hover { background: #B9D3F0; }
.tms-slot.is-inrange { background: #CDEBDD; color: #0B3D2C; }
.tms-slot.is-start, .tms-slot.is-end, .tms-slot.is-selected { background: var(--green); color: #fff; }
.tms-range { min-height: 38px; margin: 0 0 12px; padding: 10px 12px; border-radius: 8px; background: #F3F6F5; font-size: 13px; line-height: 1.5; color: var(--ink); }
.tms-range:empty { display: none; }
.tms-range .button { margin-left: 8px; vertical-align: middle; }
.tms-range-step, .tms-range-ok, .tms-range-bad { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--green); color: #fff; font-weight: 700; font-size: 12px; margin-right: 6px; }
.tms-range-bad { background: #B42318; }
.tms-range-sug { margin-top: 6px; color: var(--muted); }
.tms-slot.is-busy { background: #EEF0EF; color: #B9C2BE; cursor: not-allowed; }
.tms-slot-legend { margin: 12px 0 0; text-align: right; font-size: 12px; color: var(--muted); }
.tms-slot-legend span { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: -2px; margin-left: 10px; }
.tms-slot-legend .is-free { background: #DCE7F7; } .tms-slot-legend .is-range { background: #CDEBDD; } .tms-slot-legend .is-busy { background: #EEF0EF; }
.tms-docs { margin: 0; }
.tms-docs li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); margin: 0; }
.tms-docs li:last-child { border-bottom: 0; }
.tms-rowacts { display: block; font-size: 12px; margin-top: 3px; }
tr.is-hidden td { opacity: .55; }
.tms-course-picks { display: grid; gap: 10px; max-height: 340px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.tms-course-picks fieldset { border: 0; margin: 0; padding: 0; }
.tms-course-picks legend { font-weight: 700; color: var(--dark); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.tms-course-picks label { display: block; font-size: 13px; padding: 2px 0; }

/* Zoho CRM deal check (booking wizard) */
.tms-deal-row { display: flex; gap: 8px; align-items: stretch; }
.tms-deal-row input { flex: 1; min-width: 0; text-transform: uppercase; }
.tms-deal-result:empty { display: none; }
.tms-deal-result { margin: 8px 0 4px; padding: 9px 12px; border-radius: 8px; font-size: 13px; line-height: 1.45; border: 1px solid transparent; }
.tms-deal-result .tms-sub { display: block; }
.tms-deal-result.is-busy { background: #f3f6f5; color: var(--muted); }
.tms-deal-result.is-ok { background: #e7f4ec; border-color: #b9dfc7; color: #14532d; }
.tms-deal-result.is-warn { background: #fff7e6; border-color: #f3d79b; color: #7a4b00; }
.tms-deal-result.is-error { background: #fdecec; border-color: #f2b8b8; color: #8a1c1c; }
.tms-zoho-status { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.tms-zoho-steps { margin: 8px 0 14px 18px; list-style: decimal; }
.tms-zoho-steps li { margin: 4px 0; }

/* Feedback */
.tms-filters-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tms-stars-ro { color: #F2A900; font-size: 16px; letter-spacing: 1px; white-space: nowrap; }
.tms-stars-ro span { color: #d5dcd9; }
.tms-fb-table td { vertical-align: top; }
.tms-fb-table td:nth-child(2) { max-width: 460px; }
.tms-nowrap { white-space: nowrap; }
.tms-empty { padding: 24px; color: var(--muted); }
.tms-fb-link summary { cursor: pointer; color: var(--primary); font-weight: 600; margin: 8px 0; }
.tms-fb-link .tms-admin-qr { max-width: 180px; }
.tms-company-filter { max-width: 220px; }
.tms-admin .tablenav .bulkactions select { max-width: 220px; }
.wp-list-table.sessions .column-course_name { width: 19%; }
.wp-list-table.sessions .column-booking_id { width: 118px; }
.wp-list-table.sessions .column-booking_id code { white-space: nowrap; }
.wp-list-table.sessions .column-company_name { width: 13%; }
.wp-list-table.sessions .column-trainer_name { width: 9%; }
.wp-list-table.sessions .column-location { width: 11%; }
.wp-list-table.sessions .column-training_date { width: 10%; }
.wp-list-table.sessions .column-status { width: 76px; }
.wp-list-table.sessions .column-learners { width: 70px; }
.wp-list-table.sessions .column-photos { width: 52px; }
.wp-list-table.sessions .column-source { width: 104px; }
@media (max-width: 1200px) { .wp-list-table.sessions .column-photos, .wp-list-table.sessions .column-source { display: none; } }

/* Certificate generator */
.tms-cert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.tms-cert-card h3 { margin: 10px 0 2px; font-size: 15px; color: var(--dark); display: flex; gap: 8px; align-items: center; }
.tms-cert-thumb { display: block; aspect-ratio: 1.414; background: var(--bg); border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.tms-cert-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.tms-empty-state { text-align: center; padding: 36px 20px; }
.tms-cert-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .tms-cert-layout { grid-template-columns: 1fr; } }
.tms-cert-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.tms-cert-stage { background: repeating-conic-gradient(#f3f6f5 0 25%, #fff 0 50%) 0 0/20px 20px; border-radius: 10px; padding: 10px; border: 1px solid var(--line); min-height: 200px; display: grid; place-items: center; }
.tms-cert-canvas { position: relative; width: 100%; background: center/100% 100% no-repeat; container-type: inline-size; box-shadow: 0 6px 24px rgba(11,61,44,.15); user-select: none; }
.tms-cert-field { position: absolute; transform: translate(-50%, -50%); white-space: nowrap; cursor: move; line-height: 1.15; padding: 1px 4px; outline: 1px dashed rgba(0,125,112,.5); border-radius: 3px; touch-action: none; }
.tms-cert-field[data-align="left"] { transform: translate(0, -50%); }
.tms-cert-field[data-align="right"] { transform: translate(-100%, -50%); }
.tms-cert-field:hover { outline-color: #007D70; background: rgba(0,125,112,.06); }
.tms-cert-field.is-selected { outline: 2px solid #00885B; background: rgba(0,136,91,.08); }
.tms-cert-field.is-qr { display: grid; place-items: center; background: repeating-linear-gradient(45deg, #0B3D2C 0 3px, #fff 3px 6px); padding: 0; }
.tms-cert-field.is-qr span { background: #fff; font: 700 11px Montserrat, sans-serif; padding: 1px 4px; color: #0B3D2C; }
.tms-cf { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
.tms-cf.is-open { border-color: var(--brand); }
.tms-cf-head { display: flex; gap: 8px; align-items: center; padding: 8px 10px; }
.tms-cf-head .button-link:first-child { font-weight: 700; color: var(--dark); text-decoration: none; flex: 1; text-align: left; }
.tms-cf-head .tms-sub { margin: 0; }
.tms-cf-body { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; padding: 0 10px 10px; }
.tms-cf-body label { display: grid; gap: 3px; font-size: 12px; font-weight: 600; color: var(--muted); }
.tms-cf-body label:has(input[type="text"]), .tms-cf-body p { grid-column: 1 / -1; }
.tms-cf-body input[type="text"], .tms-cf-body select { width: 100%; }
.tms-cf-check { display: flex !important; align-items: center; gap: 6px; }
.tms-stepdot { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 12px; margin-right: 4px; }
.tms-seg--3 { display: grid; grid-template-columns: repeat(3, 1fr); }
.tms-cert-opts { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.tms-cert-learners { max-height: 460px; overflow: auto; }
.tms-cert-preview { margin: 12px 0; }
.tms-cert-preview-img { width: 100%; height: auto; border-radius: 8px; box-shadow: 0 4px 16px rgba(11,61,44,.15); display: block; }
.tms-progress-admin > div { height: 8px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.tms-progress-admin > div span { display: block; height: 100%; width: 0; background: var(--green); transition: width .2s; }
.tms-cert-results { margin: 10px 0 0 18px; font-size: 13px; max-height: 260px; overflow: auto; }
.tms-cert-results .is-ok { color: #05603A; } .tms-cert-results .is-bad { color: #B42318; }

/* Import & export */
.tms-io-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.tms-io-card h2 { margin-top: 0; }
.tms-io-card.is-focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0,125,112,.15); }
.tms-io-upload { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.tms-io-upload input[type="file"] { flex: 1; min-width: 0; font-size: 12px; }
.tms-io-map select { max-width: 260px; }
.tms-io-counts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.tms-io-count { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 12px; color: var(--muted); }
.tms-io-count b { display: block; font-size: 22px; color: var(--dark); }
.tms-io-count--error b { color: #B42318; } .tms-io-count--created b { color: #05603A; }
.tms-io-report { margin: 0 0 0 18px; font-size: 13px; max-height: 520px; overflow: auto; }
.tms-io-report li { margin: 3px 0; } .tms-io-report li span { color: var(--muted); font-size: 12px; }
.tms-io-report .is-error { color: #B42318; } .tms-io-report .is-skipped { color: #B54708; }
.tms-apps { display: flex; gap: 24px; flex-wrap: wrap; margin: 10px 0; }
.tms-app { display: flex; gap: 12px; align-items: center; }
.tms-app img { border-radius: 12px; }

/* Values filled in from Zoho CRM */
.tms-autofilled { background: #F2FAF6 !important; border-color: #9FD3BB !important; }
.tms-from-crm { display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 10px; background: #E3F3EB; color: #00704A; font-size: 11px; font-weight: 600; vertical-align: 1px; }
.tms-deal-link { margin-left: 6px; font-weight: 600; color: #007D70; white-space: nowrap; }

/* Fields hidden by the wizard (e.g. the client address for in-house rooms) */
.tms-f[hidden], [data-address-field][hidden] { display: none !important; }

/* ===================================================================
 * App view (training team): no WordPress chrome, website-style header.
 * =================================================================== */
html.wp-toolbar:has(body.tms-app) { padding-top: 0; }
html:has(body.tms-app), body.tms-app { height: auto !important; min-height: 100%; overflow: visible !important; }
body.tms-app #wpwrap { min-height: 100vh; width: 100% !important; }
body.tms-app #wpcontent, body.tms-app #wpbody { width: auto !important; margin-right: 0 !important; }
body.tms-app { display: block !important; }
body.tms-app { background: #F3F6F5; --dark: #0B3D2C; --brand: #007D70; --green: #00885B; --line: #DDE5E2; }
body.tms-app #wpadminbar, body.tms-app #adminmenumain, body.tms-app #adminmenuback, body.tms-app #adminmenuwrap,
body.tms-app #wpfooter, body.tms-app #screen-meta, body.tms-app #screen-meta-links, body.tms-app .update-nag,
body.tms-app .tms-hero-brand { display: none !important; }
body.tms-app #wpcontent, body.tms-app.auto-fold #wpcontent { margin-left: 0 !important; padding-left: 0 !important; }
body.tms-app #wpbody { padding-top: 0 !important; }
body.tms-app #wpbody-content { padding: 0 24px 40px; box-sizing: border-box; }
body.tms-app #wpbody-content > .wrap, body.tms-app #wpbody-content .tms-admin { max-width: 1320px; margin: 0 auto; }
body.tms-app .tms-hero { margin-top: 18px; }

.tms-appbar { position: sticky; top: 0; z-index: 9990; background: var(--dark); color: #fff; border-bottom: 3px solid var(--green); font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.tms-appbar-in { max-width: 1320px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 22px; min-height: 60px; }
.tms-appbar-brand { display: flex; align-items: center; color: #fff !important; text-decoration: none; flex: 0 0 auto; }
.tms-appbar-brand:focus { box-shadow: none; outline: 2px solid #9FD3BB; outline-offset: 3px; }
.tms-appbar-logo { max-height: 34px; width: auto; display: block; }
.tms-appbar .tms-wordmark { display: flex; flex-direction: column; line-height: 1.1; }
.tms-appbar .tms-wordmark strong { font-size: 15px; }
.tms-appbar .tms-wordmark small { font-size: 9px; letter-spacing: .1em; text-transform: uppercase; opacity: .75; }
.tms-appnav { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; flex-wrap: wrap; }
.tms-appnav a { color: #D6E8E2 !important; text-decoration: none; font-size: 13px; font-weight: 600; padding: 8px 11px; border-radius: 8px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.tms-appnav a:hover, .tms-appnav a:focus { background: rgba(255,255,255,.1); color: #fff !important; box-shadow: none; }
.tms-appnav a.is-active { background: #fff; color: var(--dark) !important; }
.tms-appnav-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #F59E0B; color: #1F2937; font-size: 11px; box-sizing: border-box; }
.tms-appnav-user { margin-left: auto; display: flex; align-items: center; gap: 2px; padding-left: 10px; border-left: 1px solid rgba(255,255,255,.18); }
.tms-appnav-avatar { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--green); color: #fff; font-size: 12px; font-weight: 700; }
.tms-appnav a.is-active .tms-appnav-avatar { background: var(--dark); }
.tms-appbar-toggle { display: none; margin-left: auto; width: 44px; height: 44px; border: 0; border-radius: 10px; background: rgba(255,255,255,.1); cursor: pointer; padding: 12px 11px; flex-direction: column; justify-content: space-between; }
.tms-appbar-toggle span:not(.screen-reader-text) { display: block; height: 2px; background: #fff; border-radius: 2px; transition: transform .2s, opacity .2s; }
.tms-appbar.is-open .tms-appbar-toggle span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.tms-appbar.is-open .tms-appbar-toggle span:nth-child(2) { opacity: 0; }
.tms-appbar.is-open .tms-appbar-toggle span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

@media (max-width: 1180px) {
	.tms-appbar-toggle { display: flex; }
	.tms-appbar-in { flex-wrap: wrap; gap: 0 12px; }
	.tms-appnav { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 2px; padding: 6px 0 14px; }
	.tms-appbar.is-open .tms-appnav { display: flex; }
	.tms-appnav a { font-size: 15px; padding: 12px 12px; }
	.tms-appnav-user { margin: 6px 0 0; padding: 8px 0 0; border-left: 0; border-top: 1px solid rgba(255,255,255,.18); flex-direction: column; align-items: stretch; }
}
@media (max-width: 782px) {
	body.tms-app #wpbody-content { padding: 0 12px 32px; }
	.tms-appbar-in { padding: 0 12px; min-height: 56px; }
	body.tms-app .tms-hero { padding: 14px 16px; margin-top: 12px; border-radius: 12px; }
	body.tms-app .tms-hero-text h1 { font-size: 19px; }
	body.tms-app .tms-panel { padding: 14px; border-radius: 12px; }
	body.tms-app .wp-list-table { font-size: 13px; }
	body.tms-app .tablenav { height: auto; }
	body.tms-app .tablenav .actions, body.tms-app .tablenav .tablenav-pages { float: none; margin: 6px 0; }
}

/* My account */
.tms-account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; align-items: start; }
@media (max-width: 900px) { .tms-account-grid { grid-template-columns: 1fr; } }
.tms-form-stack .tms-f { margin: 0 0 12px; }
.tms-form-stack input[type=password] { max-width: 360px; width: 100%; }
.tms-checklist { margin: 8px 0 10px; list-style: none; padding: 0; }
.tms-checklist li { padding: 6px 0; border-bottom: 1px solid var(--line); margin: 0; }
