/* Revision 11.7 - final UI corrections. Loaded last. Layout, alignment and spacing only; no colours or brand tokens change. */

/* ---- A3/A11: one toolbar rhythm: search, select, Apply (primary) and Clear share a 44px height ---- */
.content .toolbar .filters,
.content .e115-codes > .filters{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin:0 0 14px}
.content .toolbar .filters .search,
.content .e115-codes > .filters .search{flex:1 1 280px;min-width:0;position:relative}
.content .toolbar .filters .search input,
.content .e115-codes > .filters .search input{width:100%;min-height:44px;height:44px;box-sizing:border-box}
.content .toolbar .filters select{flex:0 0 190px;width:190px!important;min-width:0;min-height:44px;height:44px;box-sizing:border-box}
.content .toolbar .filters .btn,
.content .e115-codes > .filters .btn{flex:0 0 auto;min-height:44px;height:44px;padding-block:0;padding-inline:22px;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center}
.content .toolbar .filters .btn-primary,
.content .e115-codes > .filters .btn-primary{background:#0b5f80;border-color:#0b5f80;color:#fff;font-weight:600;min-width:96px}
.content .toolbar .filters .btn-primary:hover,
.content .e115-codes > .filters .btn-primary:hover{background:#094c68;border-color:#094c68}
.content .toolbar .chips,
.content .e115-codes > .chips{margin-top:2px;margin-inline:0;padding-inline:0}
.content .toolbar .filters .search .ic{inset-inline-start:14px}
@media (max-width:640px){
  .content .toolbar .filters .search{flex-basis:100%}
  .content .toolbar .filters select{flex:1 1 0;min-width:0}
}

/* Wide tables must scroll inside their card instead of being cut off by it */
.content .card > .table-wrap,.content .card .table-wrap{max-width:100%;overflow-x:auto}
.content .card:has(> .table-wrap){min-width:0}

/* Complaints list: all seven columns, including the Details action, fit a 1280px workspace without side scrolling */
.content[data-section="admin/complaints"] .table th,.content[data-section="admin/complaints"] .table td{padding-inline:8px}
.content[data-section="admin/complaints"] .table .clip{max-width:148px}
.content[data-section="admin/complaints"] .table td.num{white-space:nowrap}

/* ---- A10: complaint details: no empty column; history sits directly under the update form ---- */
.content[data-section="admin/complaints"] .detail-grid{grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:start;gap:20px}
.content[data-section="admin/complaints"] .detail-aside{position:static;min-width:0}
.content[data-section="admin/complaints"] .detail-grid > .stack{display:grid;gap:20px;min-width:0}
.content[data-section="admin/complaints"] .detail-grid > .e117-history{grid-column:1/-1}
.e117-history .card-head{margin-bottom:8px}
.e117-history .e11-conversation.timeline{display:block;column-count:2;column-gap:20px}
.e117-history .e11-message{break-inside:avoid;margin:0 0 14px!important;max-width:100%}
.e117-history .tl-body{padding:14px 16px}
.e117-history .note{margin-top:10px}
.content[data-section="admin/complaints"] .update-form textarea{min-height:0}
@media (max-width:1100px){
  .content[data-section="admin/complaints"] .detail-grid{grid-template-columns:minmax(0,1fr)}
}
@media (max-width:760px){
  .e117-history .e11-conversation.timeline{column-count:1}
}

/* ---- A2: public form action area ---- */
.pub-main .form .form-actions{display:flex;flex-wrap:wrap;align-items:center;gap:12px 16px;padding-top:22px;margin-top:8px;border-top:1px solid #e3edf2}
.pub-main .form .form-actions .e115-gate-hint{order:-2;flex:0 0 100%;margin:0;font-size:.85rem;color:#5b7484;text-align:start}
.pub-main .form .form-actions .btn-ghost{order:-1;padding-inline-start:0;min-height:44px}
.pub-main .form .form-actions .btn-primary{order:0;margin-inline-start:auto}
@media (max-width:639px){
  .pub-main .form .form-actions{flex-direction:column-reverse;flex-wrap:nowrap;align-items:stretch}
  .pub-main .form .form-actions .e115-gate-hint{order:-3;flex:0 0 auto}
  .pub-main .form .form-actions .btn-primary{margin-inline-start:0}
}

/* ---- A4: inline phone message ---- */
.field-error{display:block;margin-top:6px;color:#a02a24;font-size:.85rem;line-height:1.5}
.field input[aria-invalid="true"]{border-color:#c0392b!important}

/* ---- A9: confirmation pages: compact, clear hierarchy ---- */
.is-receipt .result{gap:14px;padding:26px clamp(18px,4vw,34px) 28px}
.is-receipt .result-ic{width:56px;height:56px}
.is-receipt .result-ic .ic{width:28px;height:28px}
.is-receipt .result h2{margin:0}
.is-receipt .ref-box{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:10px;width:100%;margin:0}
.is-receipt .ref-box>div{background:#f4f9fb;border:1px solid #dfeaf0;border-radius:12px;padding:12px 14px;text-align:start}
.is-receipt .ref-box dt{font-size:.78rem;color:#5b7484;margin:0 0 4px}
.is-receipt .ref-box dd{margin:0;font-weight:600}
.is-receipt .link-box{width:100%;text-align:start}
.is-receipt .link-box .help{margin:8px 0 0}
.is-receipt .steps{width:100%;text-align:start;margin:0;gap:8px}
.is-receipt .result .form-actions{width:100%;justify-content:center;padding-top:6px;margin-top:0;border:0;gap:10px}
.is-receipt .result .form-actions .btn-primary{margin-inline-start:0}
.is-receipt .result>p{max-width:52ch;margin:0}

/* The shared arrow glyph points inline-start; mirror it in left-to-right pages so it points forward */
html[dir="ltr"] .row-link > .ic,html[dir="ltr"] .task > .ic{transform:scaleX(-1)}

/* ---- R11.8 T1: dashboard Upcoming appointments / Examiner workload are the same height and share one rhythm ---- */
.dashboard-view .op-dash{align-items:stretch}
.dashboard-view .op-dash > section.card{display:flex;flex-direction:column}
.dashboard-view .op-dash > section .op-agenda,.dashboard-view .op-dash > section .op-load{margin:8px 0 12px!important}
.dashboard-view .op-dash > section .op-agenda a,.dashboard-view .op-dash > section .op-load > li{min-height:58px!important;box-sizing:border-box}
.dashboard-view .op-dash > section .op-load > li{display:flex;align-items:center;justify-content:space-between;gap:10px}
.dashboard-view .op-dash > section .e11-see-all{margin-top:auto!important;align-self:flex-start}

/* ---- R11.8 T5: Admin sign-in uses the whole viewport between header and footer (like the Authority portal): no white bands ---- */
body:has(> main.auth-premium){min-height:100vh;min-height:100dvh;display:flex;flex-direction:column}
body:has(> main.auth-premium) > main.auth-premium{flex:1 0 auto;display:flex;flex-direction:column;min-height:0;padding:0;margin:0}
main.auth-premium > .auth-stage{flex:1 0 auto;margin:0;min-height:clamp(560px,calc(100dvh - 130px),980px);background-size:cover;background-position:center}
@media (max-width:640px){main.auth-premium > .auth-stage{min-height:clamp(520px,calc(100dvh - 165px),980px)}}

/* ---- R11.8 T2: one centered table layout for every data table (AR and EN, desktop). Phones keep the stacked card layout. ----
   Headings, primary and secondary text, badges, counters, links and actions share the column's centre line. Technical values
   (references, e-mails, usernames, phones, dates) keep left-to-right order and never break; long text is cut with an ellipsis
   and its full value is the tooltip (see edition11.js). Customer data itself is never altered. */
@media (min-width:760px){
  .content table.table :is(th,td){text-align:center!important;vertical-align:middle;padding-block:11px;padding-inline:7px}
  .content table.table th{white-space:nowrap}
  .content[data-section="admin/appointments"] table.table td:nth-last-child(2){white-space:nowrap}
  .content table.table td > :is(.clip,.ix-sub,small,.why,.help){display:block;margin-inline:auto;text-align:center;max-width:min(100%,200px)}
  .content table.table td .clip{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .content table.table td :is(.mono,.ref,.num,[dir="ltr"],a[href^="mailto:"],a[href^="tel:"]){unicode-bidi:isolate;white-space:nowrap}
  .content table.table td.ref,.content table.table td.num{white-space:nowrap;direction:ltr}
  .content table.table td.comment-cell{white-space:normal;max-width:260px;overflow-wrap:anywhere}
  .content table.table :is(td.td-actions,td.td-block){text-align:center!important}
  .content table.table td .row-link{justify-content:center}
  .content table.table td :is(form,.moderation-actions,.op-row,.op-inline,.stack,.cell-actions){justify-content:center;align-items:center}
  .content table.table td :is(.badge,.count-pill,.chip,.tag){vertical-align:middle}
  .content table.table td > .ix-sub{margin-top:2px}
  .content table.table.op-qt :is(td,th){text-align:center!important}
}
@media (min-width:900px){
  .rvw .qh > *,.rvw .qr > *{text-align:center;justify-items:center;justify-content:center}
  .rvw .qv b{max-width:100%}
  .rvw .qv small,.rvw .sig{justify-content:center}
  .rvw .qr .qv b,.rvw .qr .qv small{text-align:center}
}

/* Team: the member table gets the full content width (the Add member card moves below it) until the screen is very wide */
@media (max-width:1599px){.content[data-section="admin/team"] .detail-grid{grid-template-columns:minmax(0,1fr)}}
@media (min-width:760px){ .content[data-section="admin/appointments"] table.table td > .clip{max-width:140px} }

/* ---- R11.9: dates and times always read left-to-right (DD/MM/YYYY, HH:MM), also inside Arabic pages ---- */
.df{position:relative;display:flex;align-items:center;width:100%}
.df > input[type="text"]{flex:1 1 auto;min-width:0;width:100%;direction:ltr;text-align:left;font-variant-numeric:tabular-nums;padding-right:44px;padding-left:12px}
.df-btn{position:absolute;right:4px;left:auto;top:50%;transform:translateY(-50%);display:grid;place-items:center;width:36px;height:36px;border:0;border-radius:9px;background:transparent;color:#0c6f93;cursor:pointer}
.df-btn:hover{background:#eaf4f8}.df-btn:focus-visible{outline:2px solid #0c7a9b;outline-offset:1px}
.df-btn .ic{width:19px;height:19px}
.df-native{position:absolute;inset:0;width:100%;height:100%;opacity:0;pointer-events:none;border:0;padding:0;margin:0}
input.df-time{direction:ltr;text-align:left;font-variant-numeric:tabular-nums}
time,td.num,.num,.ix-sub [dir="ltr"],.op-date{direction:ltr;unicode-bidi:isolate}

/* ---- R11.10 T2: slightly larger type (about +1px on undersized text), proportional through the existing tokens ---- */
:root{--t-xs:.875rem;--t-sm:.9375rem;--t-md:1.0625rem}
small,.ix-sub,.help,.req-note,.kpi-sub,.opt,.why,.e115-gate-hint,.ja-inline-error,.field-error,.task-text small,.e115-load-split,.e115-scope,.op-meta,.e11-pages-info{font-size:max(.875rem,1em)}
.content table.table th{font-size:.875rem}
.content table.table td{font-size:var(--t-sm)}
.badge,.chip,.count-pill,.kind-tag{font-size:.8125rem}
.sidebar a,.nav a,.side-link{font-size:.9375rem}
.field>label,.label{font-size:.9375rem}
.card-head .help,.card-head a{font-size:.9375rem}

/* ---- R11.10 T4: a form action is visibly muted while the form is incomplete ---- */
.btn:disabled,.btn.is-gated,.btn[aria-disabled="true"]{opacity:1;background:#dfe8ed!important;border-color:#d3dfe6!important;color:#7a8f9c!important;cursor:not-allowed;box-shadow:none!important;filter:none}
.btn:disabled:hover,.btn.is-gated:hover{background:#dfe8ed!important;transform:none}

/* ---- R11.10 T5: the expired / invalid page is one compact, centred card ---- */
.pub-main.is-narrow > section.card.empty[role="alert"]{max-width:520px;width:100%;margin:clamp(24px,7vh,64px) auto;flex:0 0 auto!important;align-self:center;height:auto!important;padding:30px 28px 28px;display:grid;justify-items:center;align-content:start;gap:10px;text-align:center;min-height:0}
.pub-main.is-narrow > section.card.empty[role="alert"] .empty-ic{margin:0 0 4px}
.pub-main.is-narrow > section.card.empty[role="alert"] .err-title{margin:0;font-size:1.4rem;line-height:1.35}
.pub-main.is-narrow > section.card.empty[role="alert"] p{margin:0 0 12px;max-width:46ch;text-wrap:balance;color:var(--muted,#5b7484);line-height:1.7}
.pub-main.is-narrow > section.card.empty[role="alert"] .btn{width:auto;min-width:200px;height:auto;min-height:46px;padding:0 28px;align-self:auto}
@media (max-width:520px){.pub-main.is-narrow > section.card.empty[role="alert"]{padding:24px 18px 22px;margin-top:20px}.pub-main.is-narrow > section.card.empty[role="alert"] .btn{width:100%}}

/* ---- R11.10 T7: balanced rhythm around the Complaint / Suggestion selector ---- */
.is-complaint form.form{gap:22px}
.is-complaint form.form > .req-note{margin-bottom:0}
.is-complaint fieldset.seg-field{margin-bottom:0}
.is-complaint fieldset.seg-field legend{margin-bottom:10px}
.is-complaint .group{margin-bottom:0}
@media (min-width:760px){.content[data-section="admin/feedback"] table.table td.comment-cell{max-width:210px}.content[data-section="admin/feedback"] table.table :is(th,td){padding-inline:6px}}
@media (max-width:759px){.table-cards td .ix-sub,.table-cards td small,.table-cards td .clip{white-space:normal;overflow-wrap:anywhere;max-width:100%}}

/* ---- R11.11: appointments table: date, time range and duration on one centred line ---- */
.op-when-line{display:inline-flex;align-items:baseline;justify-content:center;gap:0;white-space:nowrap}
.op-when-t{direction:ltr;unicode-bidi:isolate;font-variant-numeric:tabular-nums}
.op-when-d{color:var(--muted,#5b7484);font-size:.9em}
@media (max-width:759px){.op-when-line{flex-wrap:wrap;white-space:normal;justify-content:flex-end}}

/* ---- R11.11: an empty inline-error node never takes space (it was a hidden extra grid row inside the segmented selector) ---- */
.ja-inline-error:empty{display:none;margin:0}
.segmented > .ja-inline-error{display:none}
