/* ===========================================================================
   GLOBAL SHELL FOUNDATION (v5 / RC3)
   ===========================================================================
   Base typography + body color/background come from default-fuib.css (linked
   first in App.razor). This block only owns the document HEIGHT so the
   FluentLayout shell ("Height=100vh") fills the viewport, and a couple of
   global niceties. Colors here ALWAYS go through Fluent design tokens
   (var(--colorNeutral*)), never hardcoded hex, so light AND dark themes both
   render with correct contrast automatically.
   --------------------------------------------------------------------------- */
html,
body {
    height: 100%;
    margin: 0;
}

/* ---------------------------------------------------------------------------
   BRAND / ACCENT COLOR — single source of truth
   ---------------------------------------------------------------------------
   The brand/accent is generated as a full, coherent Fluent brand ramp
   (--colorBrandBackground, --colorBrandForegroundLink, --colorCompoundBrand*,
   etc.) by IThemeService from ONE hex. That hex lives in exactly one place:

       Components/Layout/ThemeController.razor  →  BrandColorHex = "#2B6FAB"

   To recolor the whole app later, change that single constant — do NOT scatter
   --colorBrand* overrides across components. (#2B6FAB since the "paper" theme,
   diary 0186; it was Fluent's default #0F6CBD per diary 0030. The neutral tokens
   and page/card surfaces of that theme are in css/theme.css.)

   This CSS block is intentionally the fallback-only escape hatch: if you ever
   need a pure-CSS brand override instead of the JS ramp, set it here once.
   Leaving it commented keeps IThemeService as the authoritative single source.
   :root {
       --colorBrandBackground: #0F6CBD;
   }
   --------------------------------------------------------------------------- */

/* ---------------------------------------------------------------------------
   FluentDataGrid full-width convention (v5 / RC3)
   ---------------------------------------------------------------------------
   In v5 the grid renders in DisplayMode.Grid (display:grid) and the upstream
   stylesheet sets `.fluent-data-grid { width: auto; }`, so the table shrinks to
   its content width and leaves empty space on the right of the page.

   `.data-grid-fullwidth` overrides that so the grid spans the full content
   column. The grid <table> is also a flex item (flex: 1 1 0%) and a FluentUI
   LIBRARY rule of element+class specificity (e.g. `table.fluent-data-grid`,
   ~(0,1,1)) BEATS a plain single-class `.data-grid-fullwidth { width: 100% }`
   (0,1,0), so on narrow grids the table would still size to its content. We win
   the cascade cleanly by MATCHING that specificity: the selector below is
   `table.data-grid-fullwidth` (also (0,1,1)) and, because app.css loads AFTER
   the library bundle, it wins on the tie — no `min-width` hack needed. Apply it
   via `Class="data-grid-fullwidth"`.

   Auto-fit columns: pair this class with a `GridTemplateColumns` on the grid
   using `1fr` fractions for the data columns (and a fixed track such as `160px`
   for a narrow actions column). Do NOT also set column-level `Width=` — v5
   throws if both `GridTemplateColumns` and a column `Width` are supplied.
   Do NOT set `AutoFit="true"` — it makes JS compute pixel widths from content,
   which fights full-width and re-introduces the right-hand gap.

       <MercuryDataGrid Items="@data.AsQueryable()"
                        ResizableColumns="true"
                        Class="data-grid-fullwidth"
                        GridTemplateColumns="160px 1fr 1fr 1fr"
                        Pagination="@paginationState">
--------------------------------------------------------------------------- */
table.data-grid-fullwidth {
    /* A plain `.data-grid-fullwidth { width: 100% }` (specificity 0,1,0) is NOT
       enough. The v5 grid <table> is a flex item (flex: 1 1 0%) and a FluentUI
       LIBRARY rule of element+class specificity (e.g. `table.fluent-data-grid`,
       0,1,1) OVERRIDES our single-class rule, so the table sizes to its CONTENT.
       On WIDE grids content ≈ container so it looks full; on NARROW grids (e.g.
       /admin/kategoriler, /admin/kdv) the table is visibly short of the
       container. We beat the library rule by MATCHING its specificity: the
       `table.` prefix makes this `table.data-grid-fullwidth` (0,1,1 too), and
       because app.css loads AFTER the library bundle it wins on the tie. So a
       single clean `width: 100%` fills the container — NO `min-width` hack. Only
       then does the `datagrid-fullwidth.js` `1fr` resize-filler have slack to
       flex into, so the grid stays 100% wide on column resize. */
    width: 100%;
}

/* ---------------------------------------------------------------------------
   Global row/cell vertical spacing for our grids.
   ---------------------------------------------------------------------------
   In v5 the grid renders as display:grid with rows as `display: contents`, so
   the grid items are the cells (`td`/`th`), not the rows. Upstream gives data
   cells `padding: 0 18px` (zero vertical) which makes rows feel cramped — the
   inline action buttons (Düzenle/Sil) end up squished with no margin above or
   below. We add vertical breathing room here, scoped to `.data-grid-fullwidth`
   so other Fluent tables are untouched. min-height targets a ~44px row; the
   vertical padding gives buttons margin; align-content/items center keeps the
   content vertically centred. Horizontal padding (18px) is preserved.
   Do NOT set per-page row heights — this is the single source of truth.
   Need taller rows? Use the modifiers below (data-grid-images / data-grid-two-line /
   data-grid-autorow). */
.data-grid-fullwidth td,
.data-grid-fullwidth th {
    min-height: 44px;
    padding-top: 6px;
    padding-bottom: 6px;
    align-content: center;
    align-items: center;
}

/* ---------------------------------------------------------------------------
   Taller rows for grids that show product image thumbnails (#0052).
   ---------------------------------------------------------------------------
   The standard ~44px row above is too short for a ~60px image thumbnail. This
   modifier raises the row min-height to ~72px (plus a little extra vertical
   padding) so thumbnails sit comfortably. Apply it ALONGSIDE
   `.data-grid-fullwidth` (e.g. Class="data-grid-fullwidth data-grid-images").

   Why app.css (global) and NOT a scoped *.razor.css rule: v5 renders rows as
   `display: contents`, so the grid items are the internally-generated cells
   (td/th). Blazor CSS isolation only stamps the scope attribute (b-xxxxx) on
   elements authored in .razor MARKUP — the grid's own row/cell DOM gets no
   scope attribute, so a scoped rule would never match it (DESIGN-GUIDELINES
   §9, trap 2). A global rule reaches those cells; a scoped one cannot. Per the
   DataGrid §5 rule "do NOT set per-page row heights", this is a dedicated,
   reusable modifier class rather than an inline per-row hack.

   `.data-grid-two-line` shares the same metrics for grids whose cells stack
   TWO lines of text (e.g. bold computer name over username, or a badge over
   its annotation — RelayDetailPage). Distinct name so intent stays readable
   at the call site; same rule so the heights never drift apart. */
.data-grid-images td,
.data-grid-images th,
.data-grid-two-line td,
.data-grid-two-line th {
    min-height: 72px;
    padding-top: 8px;
    padding-bottom: 8px;
}

/* ---------------------------------------------------------------------------
   Rows that grow to fit their content (`.data-grid-autorow`).
   ---------------------------------------------------------------------------
   For grids where a cell holds a variable number of lines (e.g. one line per
   ordered product on CargoTrackingPage). Pair it with `MultiLine="true"` on the
   grid. FluentDataGrid pins every td to the RowSize height (an inline 32px-ish
   height) and gives multiline cells overflow:auto + align-content:start, so a
   long cell is clipped or scrolls. Here the height is freed (min-height:44px
   above still applies), every cell in the row stretches to the tallest one so
   the row dividers line up, and content stays vertically centred.
   Global for the same reason as data-grid-images (the cells carry no scope). */
.data-grid-autorow td {
    height: auto !important;
    align-self: stretch;
}
/* table. prefix: the scoped-CSS bundle @imports the library CSS again AFTER app.css, so its
   equal-specificity .fluent-data-grid td[multiline=true] { overflow: auto } would win the tie and
   put scrollbars in cells. (0,2,2) beats (0,2,1). */
table.data-grid-autorow td[multiline=true] {
    overflow: visible;
    align-content: center;
}

/* ---------------------------------------------------------------------------
   The row being edited in a card above the grid (#996 v2, /admin/kuponlar).
   ---------------------------------------------------------------------------
   CouponsPage edits a coupon in a .product-form card above the grid, not in
   the row (a grid cell clips CustomerSuggestInput's dropdown and is far too
   narrow for date+time pickers; CustomerSuggestInGridTests keeps the
   autocomplete out of grids). The grid's RowClass marks the row that is open
   in the card so the user can see which one it is. Rows are display:contents,
   so the tint goes on the cells; global app.css because the td is library
   DOM (§9 trap 2). */
table.data-grid-fullwidth tr.coupon-row-editing > td {
    background-color: var(--colorBrandBackground2, #ebf3fc);
}

/* NOTE(#0094): a `.data-grid-actions-right` content-alignment modifier briefly lived here — it
   right-aligned only the header text (the RowActions stack fills its cell, so cell-level
   justify-content had nothing to push). Replaced by the real fix: an `auto` action TRACK, enabled
   by datagrid-fullwidth.js placing its resize-filler on the last `1fr` track instead of blindly
   the last track. See that file's header comment. */

/* ---------------------------------------------------------------------------
   No resizer on the LAST column (#0094).
   ---------------------------------------------------------------------------
   v5 puts a `[resize-handle]` drag strip at the right edge of EVERY header cell,
   including the last one — but the last column's width is never the user's to
   set: it is either the resize filler (minmax(80px,1fr)) or a content-sized
   `auto` action column, and dragging it just fights the datagrid-fullwidth.js
   write-back (visible as a broken/jumpy layout). Hide that one handle; interior
   dividers keep working. display:none also removes its pointer events, so the
   library's drag code never even starts. Global app.css because the handle DOM
   is library-generated (no Blazor scope attribute — §9 trap 2). */
.data-grid-fullwidth th:last-child [resize-handle] {
    display: none;
}

/* Since 5.0, FluentText As="TextTag.Hx" renders a real <hx> inside <fluent-text>, which picks up the
   reboot.css heading size and margin. The text's own Size/Weight stay in charge, as they did on rc.4. */
fluent-text > :is(h1, h2, h3, h4, h5, h6) {
    display: inline;
    margin: 0;
    font-size: inherit;
    line-height: inherit;
    font-weight: inherit;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

/* ───────────────────────── Veri İçe Aktarma (Import) ─────────────────────────
   Ported from v4 ImportPage.razor.css. Global (not scoped) so the shell + both
   sections + the progress component all share it. v4 design-token CSS vars are
   replaced with v5 tokens + literal fallbacks (a wrong var fails silently). */
.import-container { display: flex; flex-direction: column; gap: 20px; }
.tab-content { margin-top: 16px; }
.import-section { display: flex; flex-direction: column; gap: 20px; }

.info-section {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 16px; border-radius: 6px;
    background: rgba(15, 108, 189, 0.1); border-left: 3px solid #0F6CBD;
    font-size: 14px; line-height: 1.5;
}
.info-section a { color: #0F6CBD; text-decoration: underline; }

.format-section { display: flex; flex-direction: column; gap: 12px; }
.format-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.format-table th, .format-table td {
    padding: 8px 12px; text-align: left;
    border: 1px solid var(--colorNeutralStroke1, #d1d1d1);
}
.format-table th { background: var(--colorNeutralBackground2, #f5f5f5); font-weight: 600; }
.format-table tr:nth-child(even) td { background: var(--colorNeutralBackground1, #fff); }

.upload-section { display: flex; flex-direction: column; gap: 12px; }
.upload-controls { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.upload-button-section { margin-top: 4px; }

.file-input-label {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 16px; border-radius: 4px; cursor: pointer;
    background: var(--colorNeutralBackground2, #f5f5f5);
    border: 1px solid var(--colorNeutralStroke1, #d1d1d1);
    transition: all 0.15s ease; font-size: 14px; min-width: 200px;
    position: relative; overflow: hidden;
}
.file-input-label:hover {
    background: var(--colorNeutralBackground3, #ebebeb);
    border-color: var(--colorBrandBackground, #0F6CBD);
}
.file-input-label input[type="file"] {
    position: absolute; left: -9999px; opacity: 0; width: 0; height: 0;
}
.file-info { color: var(--colorNeutralForeground3, #707070); font-size: 12px; }

.progress-section { display: flex; flex-direction: column; gap: 16px; }
.status-badge { display: inline-block; padding: 6px 16px; border-radius: 16px; font-weight: 500; width: fit-content; }
.status-idle { background: var(--colorNeutralStroke1, #d1d1d1); color: var(--colorNeutralForeground1, #242424); }
.status-queued { background: #6366f1; color: #fff; }
.status-running { background: #0F6CBD; color: #fff; }
.status-completed { background: #22c55e; color: #fff; }
.status-failed { background: #ef4444; color: #fff; }
.status-cancelled { background: #f59e0b; color: #000; }

.progress-bar-container { display: flex; flex-direction: column; gap: 8px; }
.import-progress-track { width: 100%; height: 8px; border-radius: 4px; background: var(--colorNeutralBackground3, #ebebeb); overflow: hidden; }
.import-progress-fill { height: 100%; background: #0F6CBD; transition: width 0.3s ease; }

.statistics {
    display: flex; gap: 24px; flex-wrap: wrap; padding: 12px; border-radius: 8px;
    background: var(--colorNeutralBackground2, #f5f5f5);
}
.stat-item { display: flex; align-items: center; gap: 6px; font-size: 14px; }

.error-section {
    display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 8px;
    border: 1px solid var(--colorNeutralStroke1, #d1d1d1);
    background: var(--colorNeutralBackground1, #fff);
}
.error-header { display: flex; justify-content: space-between; align-items: center; }
.error-list {
    max-height: 300px; overflow-y: auto; font-size: 12px; font-family: monospace;
    background: var(--colorNeutralBackground2, #f5f5f5); border-radius: 4px;
}
.error-item { padding: 6px 10px; border-bottom: 1px solid var(--colorNeutralStroke2, #e0e0e0); }
.error-item:last-child { border-bottom: none; }
.timestamp { color: var(--colorNeutralForeground3, #707070); font-size: 12px; }

.danger-section { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.danger-controls { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.danger-warning { color: var(--colorNeutralForeground3, #707070); font-size: 12px; font-style: italic; }

/* Paylaşılan modal overlay (Takviye + Çapraz Öneri bileşenleri). Global — birden çok bileşen kullanır. */
.supp-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.supp-modal { background: var(--colorNeutralBackground1, #fff); border-radius: 8px; width: min(520px, 92vw); max-height: 90vh; overflow: auto; padding: 20px; box-shadow: 0 8px 32px rgba(0,0,0,0.25); }

/* Ürün Ekle / Güncelle formu — responsive 2 kolon (masaüstü), mobilde tek kolon. Global çünkü iki sayfa
   paylaşır ve FluentUI custom element'lerini (::deep gerektirmeden) alan genişliğine zorlar. */
.product-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; max-width: 920px; align-items: start; }
.product-form .pf-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.product-form .pf-field > label { font-size: 12px; font-weight: 600; color: var(--colorNeutralForeground2); }
.product-form .pf-full { grid-column: 1 / -1; }
.product-form .pf-actions { display: flex; gap: 10px; margin-top: 8px; }
/* İki sütunu kaplayan tam genişlik kaydet butonu (Set/ödeme formları). FluentButton'ın shadow
   max-width sınırını + iç genişliğini kaldırıp .pf-actions'ı (pf-full) tam doldurur. */
.product-form fluent-button.pf-btn-full { width: 100%; max-width: none !important; --inline-size: 100%; }
/* Kontroller alanın tamamını doldursun. NB: gerçek custom-element adları — FluentSelect=<fluent-dropdown>,
   FluentTextArea=<fluent-textarea> (tiresiz). Yanlış adla (fluent-select/fluent-text-area) eşleşmez. */
/* NB: FluentUI kontrollerinin shadow DOM :host kuralında max-width:400px var → alanı tam dolduramıyor
   ve native datetime (sınırsız) yanında dar/eşitsiz kalıyor. max-width sınırını kaldırıyoruz (!important
   ile shadow :host'u geçer). */
/* --inline-size: FluentUI kontrolün iç genişliğini var(--inline-size)=18rem'e sabitler; width:100%
   host'a verilse de iç kontrol 18rem'de kalır. 100%'e çekerek iç kontrol kolonu tam doldursun. */
.product-form fluent-text-input,
.product-form fluent-textarea { width: 100%; max-width: none !important; --inline-size: 100%; display: block; box-sizing: border-box; }
.product-form fluent-dropdown,
.product-form fluent-select { width: 100%; max-width: none !important; --inline-size: 100%; box-sizing: border-box; display: block; }
.product-form fluent-textarea::part(control),
.product-form fluent-select::part(control),
.product-form fluent-dropdown::part(control) { width: 100%; box-sizing: border-box; }
/* Date + time picker pair in one field (#996 v2, CouponsPage): `<div class="pf-datetime">` around a
   FluentDatePicker + FluentTimePicker. A horizontal FluentStack overflowed its column: the time
   picker's inner dropdown has a shadow `.control { min-width: 160px }` (no part to override) that
   ignores the picker's Width="110px", so it ran into the next field (over the Bitiş date at 1440px)
   and past the card edge on a phone. Here the time picker is exactly that 10rem floor, the date
   picker takes the rest of the column (both fit on one line down to a 390px phone), and a column
   too narrow for both drops the time to its own line instead of overflowing. */
.product-form .pf-datetime { display: flex; flex-wrap: wrap; gap: 8px; }
.product-form .pf-datetime > fluent-field.fluent-datepicker { flex: 1 1 9rem; min-width: 0; grid-template-columns: minmax(0, 1fr); }
.product-form .pf-datetime > fluent-field.fluent-timepicker { flex: 0 0 10rem; }
/* Field validation (#984, ProductFieldError). The red border re-points the stroke tokens on the invalid
   field: custom properties inherit into the controls' shadow DOM, where the border reads them. */
.product-form .pf-req { color: var(--colorPaletteRedForeground1); }
.product-form .pf-error { font-size: 12px; color: var(--colorPaletteRedForeground1); }
.product-form .pf-invalid { --colorNeutralStroke1: var(--colorPaletteRedBorder2); --colorNeutralStroke1Hover: var(--colorPaletteRedBorder2); --colorNeutralStrokeAccessible: var(--colorPaletteRedBorder2); --colorNeutralStrokeAccessibleHover: var(--colorPaletteRedBorder2); }
/* Native datetime input'a FluentUI'nin .my-3-o class'ı dikey margin (var(--spacingVerticalM)) ekleyip
   diğer kontrollerle hizayı bozuyor — form içinde bu margin'i sıfırla. Kütüphane kuralı bazen aynı
   özgüllükte olduğundan !important ile kesinleştiriyoruz. */
.product-form input[type="datetime-local"] { margin: 0 !important; }
.product-form .my-3-o { margin-top: 0 !important; margin-bottom: 0 !important; }
.product-form .pf-field > .my-3-o,
.product-form .pf-field input { margin: 0 !important; }

/* Label kullanan Fluent kontroller (FluentSelect/FluentDatePicker/FluentTextInput+Label …) kök olarak
   <fluent-field class="my-3-o"> render eder; FluentUI .my-3-o ile dikey margin (var(--spacingVerticalM))
   ekler. Bu, gap-tabanlı düzenlerde (FluentStack boşluğu flexbox row-gap/column-gap ile verir — .my-3-o
   ile DEĞİL) gereksiz ve alanları birbirinden/harici-label'lı alanlardan hizasız bırakıyor. v5 GENELİNDE
   bu dikey margin'i sıfırlıyoruz; FluentStack spacing'i flexbox gap ile sağladığından bozulmaz. */
.my-3-o { margin-top: 0 !important; margin-bottom: 0 !important; }

/* Ödeme Bilgileri formu — Havale + Taksit textarea'ları eşit boy + tam genişlik (FluentUI shadow
   max-width:400px kaldırılır), seçenekler (switch) yan yana, Kaydet tam genişlik. */
.payment-form { width: 100%; max-width: 640px; display: flex; flex-direction: column; gap: 16px; }
.payment-form fluent-textarea { width: 100%; max-width: none !important; --inline-size: 100%; display: block; box-sizing: border-box; }
.payment-form fluent-button { width: 100%; max-width: none !important; }
.payment-toggles { display: flex; gap: 32px; flex-wrap: wrap; align-items: center; }

/* VPN "Hedefi Düzenle" popup'ı — Tip/Değer/Etiket/Not kontrolleri eşit (hepsi modal genişliğinde);
   FluentUI shadow max-width:400px + --inline-size:18rem sınırlarını kaldır. Popup genişliği içeriğe
   göre (markup'ta width:min(400px,94vw)). */
.vpn-target-modal fluent-text-input,
.vpn-target-modal fluent-textarea,
.vpn-target-modal fluent-select,
.vpn-target-modal fluent-dropdown { width: 100%; max-width: none !important; --inline-size: 100%; display: block; box-sizing: border-box; }
.vpn-target-modal fluent-select::part(control),
.vpn-target-modal fluent-dropdown::part(control) { width: 100%; box-sizing: border-box; }
/* Özel Uyarılı İlaç ekle/güncelle — Barkod (text-input) ve Uyarı (textarea) eşit genişlik;
   FluentUI shadow max-width:400px + --inline-size:18rem sınırlarını kaldır. */
.special-drug-form fluent-text-input,
.special-drug-form fluent-textarea { width: 100%; max-width: none !important; --inline-size: 100%; display: block; box-sizing: border-box; }
.special-drug-form fluent-textarea::part(control) { width: 100%; box-sizing: border-box; }

/* Müşteri Tarifi güncelle — tüm text-input + textarea'lar eşit (konteyner) genişlikte;
   FluentUI shadow max-width:400px + --inline-size:18rem sınırlarını kaldır. */
.recipe-form fluent-text-input,
.recipe-form fluent-textarea { width: 100%; max-width: none !important; --inline-size: 100%; display: block; box-sizing: border-box; }
.recipe-form fluent-textarea::part(control) { width: 100%; box-sizing: border-box; }

/* Şifreli Reçete Gönder (/recete-gonder) — Reçete JSON + Public Key textarea'ları tam genişlik;
   FluentUI shadow max-width:400px + --inline-size:18rem sınırlarını kaldır. Kutucuk minicik kalıp
   seçim sırasında kayıyordu (#772); yükseklik markup'ta Height= ile (rc.4'te Rows yok). */
.prescription-send-form fluent-textarea { width: 100%; max-width: none !important; --inline-size: 100%; display: block; box-sizing: border-box; }
.prescription-send-form fluent-textarea::part(control) { width: 100%; box-sizing: border-box; }

/* #774: Reçete JSON renkli önizleme — kütüphanesiz (span'lar server-side System.Text.Json ile
   üretiliyor, Utils/JsonPretty). Kutu textarea gibi resize:both ile serbestçe boyutlandırılır.
   Renk paleti VS/VS Code light JSON şemasını izler. */
.json-preview {
    width: 100%;
    height: 320px;
    resize: both;
    overflow: auto;
    box-sizing: border-box;
    margin: 0;
    padding: 8px 10px;
    font-family: monospace;
    font-size: 12px;
    line-height: 1.5;
    border: 1px solid #d1d1d1;
    border-radius: 4px;
    background: #fff;
    white-space: pre;
}
/* .payload-code: the bank traffic's raw payload on /admin/odemeler/{id} (BankPayloadFormatter). */
.json-preview .json-key, .payload-code .json-key { color: #0451a5; font-weight: 600; }
.json-preview .json-string, .payload-code .json-string { color: #a31515; }
.json-preview .json-number, .payload-code .json-number { color: #098658; }
.json-preview .json-literal, .payload-code .json-literal { color: #0000ff; }
/* XML in the same palette: tags like JSON keys, values and text like JSON strings. */
.payload-code .xml-tag { color: #0451a5; font-weight: 600; }
.payload-code .xml-attr { color: #098658; }
.payload-code .xml-value, .payload-code .xml-text { color: #a31515; }
.payload-code .xml-decl { color: #6a737d; }

/* Tooltips are text only: let the pointer pass through to whatever they overlap (a neighbouring
   button), and since the library keeps a tooltip open while it is hovered, this also lets it close
   once the pointer leaves its anchor. */
fluent-tooltip { pointer-events: none; }

/* A tooltip rendered inside a one-line container (a data-grid cell is white-space: nowrap) inherits
   that, so longer text ran straight out of the tooltip's box instead of wrapping inside it. */
fluent-tooltip { white-space: normal; overflow-wrap: break-word; }

/* Pagination nav butonları çok geniş — FluentButton :host min-width:96px'i ok/ilk-son butonları için
   daralt (ikon-only olduklarından kareye yakın dursunlar). */
.fluent-paginator fluent-button { min-width: 32px !important; }

/* ── İKİ SATIRLI DÜZEN (.td-two-row): Son Yorum kaydın altında tam genişlik ────────────────────
   FluentDataGrid'de detay-satırı yok; grid `display:grid`, satırlar `display:contents` olduğundan
   Son Yorum hücresine grid-column:1/-1 verince auto-placement onu bir alt grid satırına (tüm izleri
   kaplayacak şekilde) taşır. Üst satırın 8 hücresi izleri doldurur, 9. hücre (Son Yorum) sığmayıp
   alta iner. Başlığını (th) gizliyoruz ki üst iz sayısı (8) bozulmasın. */
/* !important ŞART: FluentDataGridCell her hücreye INLINE `grid-column: N` basıyor (GridColumn
   param'ı). Inline stil normalde class kuralını ezer; stylesheet'teki !important ise inline'ı
   geçen TEK durumdur. Bu olmadan Son Yorum kendi sütun indeksinde (sağda) kalıyordu — alt satıra
   inmiyordu. 1/-1 + otomatik satır yerleşimi → hücre bir sonraki tam-genişlik grid satırına iner. */
.td-two-row td.td-comment-fullrow { grid-column: 1 / -1 !important; }
.td-two-row th.td-comment-fullrow { display: none; }

/* Kaydı TEK BLOK gibi göstermek için: üst satır hücrelerinin alt çizgisini kaldır, ayırıcı çizgiyi
   yalnızca tam-genişlik Son Yorum hücresine bırak (kayıtlar arası gerçek ayraç odur). Başlık <th>
   çizgisi etkilenmez (td değil).
   !important ŞART: kütüphanenin `.fluent-data-grid td { border-bottom }` kuralı EŞİT özgüllükte
   olduğundan yükleme sırasına göre kazanabiliyor ve üst satır ile kendi Son Yorum'u ARASINA çizgi
   koyuyordu (yorum ayrı bir kayıtmış gibi görünüyordu). !important ile üst hücrelerin çizgisi kesin
   kalkar; ayraç yalnızca Son Yorum hücresinde kalır → üst satır + yorum tek blok okunur. */
.td-two-row td { border-bottom: none !important; }
.td-two-row td.td-comment-fullrow { border-bottom: var(--strokeWidthThin, 1px) solid var(--colorNeutralStroke2) !important; }

/* Who wrote the last comment, in parentheses after it. */
.td-comment-author { color: #616161; }
/* Telefon numarasının yanındaki kopyala butonu (ve aynı stili paylaşan WhatsApp/Ara linkleri). */
.td-comment-copy { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; margin: 0 2px; padding: 1px 3px; border: none; background: transparent; color: #0f6cbd; cursor: pointer; border-radius: 3px; line-height: 1; user-select: none; text-decoration: none; }
.td-comment-copy:hover { background: #e5f1fb; }
/* WhatsApp linki — yeşil. wa.me → WhatsApp Web/uygulama. */
.td-comment-wa { color: #25d366; }
.td-comment-wa:hover { background: #e6f9ec; }
/* Ara linki — mavi. tel: → stopphone / varsayılan telefon uygulaması. */
.td-comment-call { color: #0f6cbd; }
.td-comment-call:hover { background: #e5f1fb; }
/* A time in a comment; td-support.js sets its state (timeState). td-blink: under 30 minutes ahead,
   a slow breathing glow that never fades out (steady under reduced motion). td-past: gone today,
   amber with a clock. Later times and earlier days' times keep the plain look. */
.td-comment-time { font-weight: 600; border-radius: var(--borderRadiusMedium); }
.td-comment-time.td-blink { color: var(--colorPaletteRedForeground1); animation: td-time-pulse 2.4s ease-in-out infinite; }
.td-comment-time.td-past { color: var(--colorStatusWarningForeground3); }
@keyframes td-time-pulse {
    0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--colorPaletteRedBorder2) 0%, transparent); }
    50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--colorPaletteRedBorder2) 40%, transparent); }
}
@media (prefers-reduced-motion: reduce) {
    .td-comment-time.td-blink { animation: none; box-shadow: 0 0 0 2px color-mix(in srgb, var(--colorPaletteRedBorder2) 40%, transparent); }
}
.td-comment-time.td-past::before {
    content: "";
    display: inline-block;
    width: 0.9em;
    height: 0.9em;
    margin-right: 3px;
    vertical-align: -0.1em;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1a7 7 0 1 1 0 14A7 7 0 0 1 8 1Zm0 1.2a5.8 5.8 0 1 0 0 11.6A5.8 5.8 0 0 0 8 2.2ZM7.6 4a.6.6 0 0 1 .6.6v3.2h2.2a.6.6 0 0 1 0 1.2H7.6a.6.6 0 0 1-.6-.6V4.6a.6.6 0 0 1 .6-.6Z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1a7 7 0 1 1 0 14A7 7 0 0 1 8 1Zm0 1.2a5.8 5.8 0 1 0 0 11.6A5.8 5.8 0 0 0 8 2.2ZM7.6 4a.6.6 0 0 1 .6.6v3.2h2.2a.6.6 0 0 1 0 1.2H7.6a.6.6 0 0 1-.6-.6V4.6a.6.6 0 0 1 .6-.6Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ── Teknik Destek (.tds-grid, 2026-10 redesign) — the cell-level half; the content inside the
   cells is styled in SupportPage.razor.css. Rows are display:contents, so everything here targets
   the td. Rows have no background of their own; a taken task is outlined as a card (below)
   and its taker's colour is on a card in the Eklendi / Alındı cell. Row height comes from
   .data-grid-autorow (with MultiLine on the grid): rows grow to the full comment. */
.tds-grid td {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
}
/* The task line keeps the library's per-cell scrolling: a visible-overflow cell cannot shrink below
   its content, so on a narrow screen the whole grid would scroll sideways. The comment line spans
   every track, so it wraps instead and is never clipped. */
table.tds-grid td:not(.td-comment-fullrow) { overflow: auto; }
.tds-grid td.td-comment-fullrow { padding-top: 0; justify-content: flex-start; }
/* The comment line covers only Müşteri + Telefonlar (tracks 1-2); Eklendi and İşlemler (tds-tall)
   span both lines. Auto-placement then puts the comment cell in the free tracks under the task.
   table. prefix + !important: beats .td-two-row's 1 / -1 and the cell's inline grid-column. */
table.tds-grid td.td-comment-fullrow { grid-column: 1 / 3 !important; }
table.tds-grid td.tds-tall {
    grid-row: span 2;
    justify-content: flex-start;
    border-bottom: var(--strokeWidthThin, 1px) solid var(--colorNeutralStroke2) !important;
}
/* A taken task (tr.tds-taken, RowClass) is one card over both lines. The row is display:contents,
   so the outline is drawn piecewise on the cells at its edges: line-1 cells (incl. the two tall ones)
   carry the top, the comment and tall cells the bottom, the first and comment cells the left,
   İşlemler the right, all 1px; the four corner cells get the radius. The margins keep adjacent
   cards apart and grow the auto row tracks, so the pieces still meet after a column resize. */
table.tds-grid tr.tds-taken > td {
    --tds-card: var(--colorBrandStroke1);
    border-bottom: none !important;
}
/* The card is the separator: a free row right above one drops its own bottom line. */
table.tds-grid tbody tr:not(.tds-taken):has(+ tr.tds-taken) > td { border-bottom: none !important; }
table.tds-grid tr.tds-taken > td:not(.td-comment-fullrow) {
    border-top: 1px solid var(--tds-card) !important;
    margin-top: 3px;
}
table.tds-grid tr.tds-taken > td.td-comment-fullrow,
table.tds-grid tr.tds-taken > td.tds-tall {
    border-bottom: 1px solid var(--tds-card) !important;
    margin-bottom: 3px;
}
table.tds-grid tr.tds-taken > td:first-child,
table.tds-grid tr.tds-taken > td.td-comment-fullrow { border-left: 1px solid var(--tds-card) !important; }
table.tds-grid tr.tds-taken > td.tds-action-cell { border-right: 1px solid var(--tds-card) !important; }
table.tds-grid tr.tds-taken > td:first-child { border-top-left-radius: 5px; }
table.tds-grid tr.tds-taken > td.td-comment-fullrow { border-bottom-left-radius: 5px; }
table.tds-grid tr.tds-taken > td.tds-action-cell { border-top-right-radius: 5px; border-bottom-right-radius: 5px; }
/* Content shared by the support lists' cells (TD Takip and the two watch lists; markup in each page,
   so it cannot be scoped to one of them). İşlemler is a fixed grid of 38px icon buttons, one slot per
   action so each sits in the same place on every row, three columns on every list.
   Each slot holds its button and that button's tooltip element, so a tooltip never takes a cell. */
.tds-actions {
    display: grid;
    grid-template-columns: repeat(var(--tds-action-cols, 3), 38px);
    grid-auto-rows: 38px;
    gap: 4px;
    justify-content: end;
    padding-top: var(--spacingVerticalXS);
}
.tds-slot { display: flex; }
/* An own row's third line in İşlemler: Yorum yaz (TaskWriteButton), as wide as the grid (3 × 38px + 2 gaps). */
.tds-write { display: flex; width: calc(3 * 38px + 2 * 4px); margin: var(--spacingVerticalS) 0 0 auto; }
/* The second line's last comment (TaskLastComment); on an own row it opens the comment dialog. */
.tds-last { display: grid; }
.tds-last-mine { margin: -4px -8px; padding: 4px 8px; border-radius: var(--borderRadiusMedium); cursor: pointer; }
.tds-last-mine:hover { background: var(--colorSubtleBackgroundHover); }
.tds-last-mine:focus-visible { outline: 2px solid var(--colorStrokeFocus2); }
.tds-comment { padding: 2px 0 var(--spacingVerticalM); }
.tds-muted { color: var(--colorNeutralForeground3); font-size: var(--fontSizeBase200); }
.tds-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacingHorizontalS);
    padding: var(--spacingVerticalXXL);
    color: var(--colorNeutralForeground3);
}
/* Times in a support-list comment bubble are chips (TD Takip and the watch lists): neutral at rest,
   red and pulsing when due soon, amber once gone today. "kurulum" is marked, as the support
   team's extension did. */
.td-comment-time.td-comment-chip { display: inline-block; padding: 0 5px; border: 1px solid var(--colorNeutralStroke2); border-radius: var(--borderRadiusMedium); background: var(--colorNeutralBackground3); color: var(--colorNeutralForeground2); font-variant-numeric: tabular-nums; }
.td-comment-time.td-comment-chip.td-blink { border-color: var(--colorPaletteRedBorder1); background: var(--colorPaletteRedBackground1); color: var(--colorPaletteRedForeground1); }
.td-comment-time.td-comment-chip.td-past { border-color: var(--colorStatusWarningBorder1); background: var(--colorStatusWarningBackground1); color: var(--colorStatusWarningForeground3); }
.td-comment-keyword { padding: 0 4px; border-radius: var(--borderRadiusMedium); background: var(--colorPaletteMarigoldBackground2); color: var(--colorPaletteMarigoldForeground2); font-weight: var(--fontWeightSemibold); }
.tds-grid .td-comment-author { color: var(--colorNeutralForeground3); }

/* The support lists on a phone (TD Takip, Havale Takip, Yazılım Takip). Four tracks side by side
   did not fit: İşlemler (3 × 38px buttons) and the Eklendi card kept their width, so the customer and
   the phones were cut and the grid ran off the screen. Below 720px a task is one stacked card:
   Müşteri / Eczane, Telefonlar, Eklendi / Alındı, İşlemler, then the last comment, each the full
   width, in DOM order. The header row has nothing to head any more and is hidden. The desktop
   layout above is untouched. !important: the cells carry an inline grid-column, the grid an inline
   template (column resize). The rules come after the card rules above so they win on source order. */
@media (max-width: 720px) {
    table.tds-grid { grid-template-columns: minmax(0, 1fr) !important; }
    table.tds-grid th { display: none !important; }
    table.tds-grid td,
    table.tds-grid td.td-comment-fullrow,
    table.tds-grid td.tds-tall { grid-column: 1 / -1 !important; grid-row: auto !important; }
    table.tds-grid td.tds-tall { border-bottom: none !important; }
    table.tds-grid td:not(.td-comment-fullrow) { overflow: visible; padding-bottom: 4px; }
    table.tds-grid .tds-actions { justify-content: start; }
    table.tds-grid .tds-write { margin-left: 0; }

    /* A taken task's card, redrawn for the stacked cells: sides on every cell, top on the first,
       bottom on the comment. */
    table.tds-grid tr.tds-taken > td {
        border-top: none !important;
        border-bottom: none !important;
        border-left: 1px solid var(--tds-card) !important;
        border-right: 1px solid var(--tds-card) !important;
        border-radius: 0 !important;
        margin-top: 0;
        margin-bottom: 0;
    }
    table.tds-grid tr.tds-taken > td:first-child {
        border-top: 1px solid var(--tds-card) !important;
        border-radius: 5px 5px 0 0 !important;
        margin-top: 3px;
    }
    table.tds-grid tr.tds-taken > td.td-comment-fullrow {
        border-bottom: 1px solid var(--tds-card) !important;
        border-radius: 0 0 5px 5px !important;
        margin-bottom: 3px;
    }
}

/* Müşteri Geçmişi grid'i (CustomerDetailPage) — Açıklama sütunu multiline: uzun metin satıra sığmazsa
   ALT SATIRA sarar ve TAMAMI görünür (kaydırma çubuğu yok). FluentUI'nin td[multiline=true] kuralı
   overflow:auto verir (kaydırma) — visible'a çeviriyoruz; ayrıca RowSize kaynaklı sabit yüksekliği
   (td'ye height:32px) kaldırıyoruz ki satır içeriğe göre büyüsün. Yalnızca .history-comments'a scope'lu. */
.history-comments td { height: auto !important; }
.history-comments td[multiline=true] { overflow: visible; white-space: pre-wrap; word-break: break-word; align-content: start; }

/* width: a form placed straight in a PageCard (SetInformationPage, not in a full-width FluentCard) sized
   to its content and ended half way across a phone; on a phone it takes the full width. */
@media (max-width: 720px) { .product-form { grid-template-columns: 1fr; width: 100%; } }

/* A list's filter row (a wrapping horizontal FluentStack, Class="mercury-filters", each field in a
   <div class="mf-field">). On a desktop the fields keep their own widths; on a phone each one takes the
   full row, so the boxes line up instead of ending at a different width each (OffersUseList,
   CouponsUseList, VpnUsersPage). A <div class="mf-actions"> keeps the Filtrele / Temizle buttons
   together, side by side, on every screen. The
   controls' shadow :host caps them at 400px and sizes them to content, hence the overrides. */
/* Toplu Versiyon Değişikliği (VersionBulkChangeTab, Class="vbc-form") on a phone: the selects sized to
   their content, each a different width, and the three "1. Müşteriler" options squeezed onto one line
   broke every label in two. The fields take the full width; an option keeps its label on one line and
   the group wraps whole options instead. */
@media (max-width: 720px) {
    .vbc-form fluent-field,
    .vbc-form fluent-dropdown { display: block; width: 100%; max-width: none !important; --inline-size: 100%; box-sizing: border-box; }
    .vbc-form fluent-field.fluent-datepicker { display: grid; grid-template-columns: minmax(0, 1fr); }
    .vbc-form fluent-radio-group { flex-wrap: wrap; row-gap: 4px; }
    .vbc-form fluent-radio { white-space: nowrap; }
}

.mercury-filters > .mf-actions { display: flex; gap: 8px; align-items: flex-end; }
@media (max-width: 720px) {
    .mercury-filters > .mf-field { flex: 1 1 100%; min-width: 0 !important; }
    .mercury-filters > .mf-field fluent-text-input,
    .mercury-filters > .mf-field fluent-dropdown,
    .mercury-filters > .mf-field fluent-field { display: block; width: 100%; max-width: none !important; --inline-size: 100%; box-sizing: border-box; }
    .mercury-filters > .mf-field fluent-field.fluent-datepicker { display: grid; grid-template-columns: minmax(0, 1fr); }
}

/* Sözleşme yayınlama — metin alanı: FluentTextArea Rows'u shadow kontrolde yok sayılıyor ve uzun
   sözleşme 2 satırlık kutuda kalıyordu. Class, Label'lı kontrolde <fluent-field>'e düşer; textarea onun
   içinde. Yüksekliği bileşenin kendi --block-size değişkeni belirler (varsayılan 52px). */
.contract-text-editor fluent-textarea { width: 100%; max-width: none !important; --inline-size: 100%; --block-size: 60vh; --resize: vertical; display: block; box-sizing: border-box; }

/* ── Shell app bar (Components/Layout/ShellAppBar, the right edge) ─────────────────────────────
   FluentAppBar sized down from its 68px items to 34px: icon only, the label kept for screen
   readers but visually hidden (the item name is the hover title). Global: the bar's markup comes
   from the library, so a scoped rule cannot reach it. */
.fluent-appbar.shell-appbar {
    --appbar-item-size: 34px;
    --appbar-item-height-adjustment: 0px;
    width: 34px;
    height: 100%;
    background-color: transparent;
}
.shell-appbar .fluent-appbar-item a .fluent-stack-vertical { padding: 0; justify-content: center; }
.shell-appbar .fluent-appbar-item svg { width: 18px; height: 18px; }
.shell-appbar .fluent-appbar-item div[part=label] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
/* A small count over the icon's top-right corner (Geri Bildirim's open issues). Brand fill, not the
   library counter's danger red: it is a to-do number, not an alarm. The old-version customers count
   is the alarm, so it alone is red (-alert): same size, a circle for one digit, a pill beyond. */
.shell-appbar .fluent-appbar-item a .fluent-stack-vertical { position: relative; }
.shell-appbar .shell-appbar-badge {
    position: absolute;
    top: 3px;
    right: 1px;
    min-width: 14px;
    height: 14px;
    padding: 0 3px;
    box-sizing: border-box;
    border-radius: 7px;
    background-color: var(--colorBrandBackground);
    color: var(--colorNeutralForegroundOnBrand);
    font-size: 9px;
    font-weight: var(--fontWeightSemibold);
    line-height: 14px;
    text-align: center;
    pointer-events: none;
}
.shell-appbar .shell-appbar-badge-alert {
    background-color: var(--colorPaletteRedBackground3);
    color: var(--colorNeutralForegroundOnBrand);
}

/* ── Shell menu button (MainLayout's FluentLayoutHamburger, #1158) ─────────────────────────────
   The library draws it for a brand-coloured header: white icon (an inline color on its button plus
   fill on the wrapper) and a brand-pressed hover. Our header is neutral (MainLayout), so the icon
   would be white on light grey; !important is needed to beat the button's inline color. */
.fluent-layout-item[area="header"] .fluent-layout-hamburger { fill: var(--colorNeutralForeground1); }
.fluent-layout-item[area="header"] .fluent-layout-hamburger fluent-button { color: var(--colorNeutralForeground1) !important; }
.fluent-layout-item[area="header"] .fluent-layout-hamburger { border-radius: var(--borderRadiusMedium); }
/* Hover: the library's brand-pressed (navy) hover still won without !important in a real browser. The
   subtle/hover tokens equal the header colour (#f4f1ea) in this theme, so the pressed step is the first
   one that shows. */
.fluent-layout-item[area="header"] .fluent-layout-hamburger:hover { background-color: var(--colorNeutralBackground3Pressed) !important; }
/* Header items that exist only in mobile mode (≤768px, the layout's `mobile` attribute): Geri Bildirim,
   whose desktop home is the Aside app bar the library drops on mobile. The header links must not wrap
   on a phone ("Çıkış Yap" broke onto two lines at 375px). */
.shell-mobile-only { display: none; }
.fluent-layout[mobile] .shell-mobile-only { display: inline-flex; }
.fluent-layout-item[area="header"] fluent-link { white-space: nowrap; }
/* With nowrap, a long user name would push Çıkış Yap past the right edge on a phone (the header clips,
   it does not scroll): cap the name and end it with an ellipsis; its title attribute carries it whole. */
.fluent-layout[mobile] .shell-user-link {
    display: inline-block;
    max-width: 30vw;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}
.shell-user-avatar { display: inline-flex; }
.fluent-layout[mobile] .shell-user-avatar { display: none; }

/* Photo crop dialog (js/photo-cropper.js builds this DOM, so no scoped CSS reaches it). Above the house
   overlay (.supp-modal-overlay, 1000): the profile page's own dialogs can be under it. */
.pc-overlay { position: fixed; inset: 0; z-index: 1100; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.6); }
.pc-dialog { display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 92vw; max-height: 96vh; overflow: auto; padding: 20px; box-sizing: border-box; background: var(--colorNeutralBackground1); border-radius: var(--borderRadiusXLarge); box-shadow: var(--shadow28); }
.pc-title { margin: 0; align-self: flex-start; font-size: var(--fontSizeBase500); font-weight: var(--fontWeightSemibold); }
.pc-help { margin: 0; max-width: 360px; align-self: flex-start; color: var(--colorNeutralForeground3); font-size: var(--fontSizeBase200); }
/* touch-action: none hands drags and pinches to the script instead of scrolling or zooming the page. */
.pc-frame { position: relative; flex: none; overflow: hidden; border-radius: var(--borderRadiusMedium); background: var(--colorNeutralBackground6); cursor: grab; touch-action: none; user-select: none; }
.pc-frame:active { cursor: grabbing; }
.pc-frame:focus-visible { outline: var(--strokeWidthThick) solid var(--colorStrokeFocus2); outline-offset: 2px; }
.pc-image { position: absolute; max-width: none; pointer-events: none; user-select: none; }
/* The circle that will be the avatar: everything outside it is dimmed by the circle's own shadow. */
.pc-mask { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 9999px rgba(0,0,0,0.55); border: var(--strokeWidthThick) solid rgba(255,255,255,0.9); box-sizing: border-box; pointer-events: none; }
.pc-zoom { display: flex; align-items: center; gap: 12px; width: 100%; font-size: var(--fontSizeBase300); }
.pc-zoom input { flex: 1; accent-color: var(--colorBrandBackground); }
.pc-actions { display: flex; justify-content: flex-end; gap: 8px; width: 100%; }
/* The menu column hidden by that button on desktop (js/sidebar-state.js): the attribute alone loses to
   any display rule on the column, so say it explicitly. */
.fluent-layout-item[area="nav"][hidden] { display: none; }

/* Scrolling pages end with a little extra space (docs/portal/design.md). The spacer sits after
   every page in MainLayout's content area; js/scroll-end-space.js adds .has-scroll only while that
   area overflows, so a page that fits stays without a scrollbar. Height = SPACER in the script. */
.content-end-spacer { display: none; height: 48px; }
.has-scroll .content-end-spacer { display: block; }
/* The content area is focused programmatically so the keyboard scrolls it (scroll-end-space.js); it
   is a scroller, not a control, so it draws no focus ring. */
.shell-content:focus { outline: none; }


/* ---------------------------------------------------------------------------
   Column-menu MercuryDataGrid (ColumnMenu="…", MercuryDataGrid.Columns.cs, diaries 0231 and 0235).
   Hidden columns are not rendered at all; what is left keeps minmax(<column minimum>, 1fr) tracks, so
   when the minimums do not fit the TABLE scrolls sideways inside its own frame (the theme's border and
   radius are on the table; it is display:grid, so overflow applies) and the page never does. The ⋯
   column (td/th.mdg-col-menu) is pinned to the right edge and, in a grid with an action column
   (.mdg-columns-actions, KeepLastColumn), the action column right beside it, so the row buttons stay
   reachable while the rest scrolls. Global, not scoped: the cells are the library's.
--------------------------------------------------------------------------- */
table.data-grid-fullwidth.mdg-columns {
    overflow-x: auto;
    /* Not auto: the library sizes its resize handles from the table's offsetHeight, which includes the
       horizontal scrollbar, so they stick out below the rows by its height and drew a vertical scrollbar
       in browsers with classic scrollbars. The rows themselves always fit. */
    overflow-y: hidden;
    min-width: 0;
    /* The ⋯ column's width, fixed so the action column can be pinned exactly that far from the edge. */
    --mdg-col-menu-width: 40px;
}

/* Until the stored choices are read (one round trip after the first render): no flash of the defaults. */
table.mdg-columns.mdg-columns-loading {
    visibility: hidden;
}

/* The ⋯ column: as narrow as its button, pinned to the right edge while the rest scrolls. */
table.mdg-columns th.mdg-col-menu,
table.mdg-columns td.mdg-col-menu {
    position: sticky;
    inset-inline-end: 0;
    z-index: 2;
    box-sizing: border-box;
    width: var(--mdg-col-menu-width);
    min-width: var(--mdg-col-menu-width);
    padding-inline: 4px;
    box-shadow: -1px 0 0 var(--colorNeutralStroke2);
}

/* The action column (the last declared one, just before ⋯): pinned beside ⋯. The divider moves to its
   left edge, so the two read as one pinned block. Its header keeps the body cells' z-index for the same
   reason as ⋯'s (below), also on hover. */
table.mdg-columns.mdg-columns-actions > thead > tr > th:nth-last-child(2),
table.mdg-columns.mdg-columns-actions > thead > tr > th:nth-last-child(2):hover,
table.mdg-columns.mdg-columns-actions > tbody > tr > td:nth-last-child(2) {
    position: sticky;
    inset-inline-end: var(--mdg-col-menu-width);
    z-index: 2;
    box-shadow: -1px 0 0 var(--colorNeutralStroke2);
    /* Tighter than the library's 18px: the pinned block takes less of a narrow table. */
    padding-inline: 8px;
}
table.mdg-columns.mdg-columns-actions th.mdg-col-menu,
table.mdg-columns.mdg-columns-actions td.mdg-col-menu {
    box-shadow: none;
}

/* An end-aligned column (Align="DataGridCellAlignment.End"; MercuryDataGrid gives it to the action column)
   gets only text-align:end from the library, which a flex row of buttons ignores. FluentStack writes
   justify-content:start inline, hence !important. */
table.fluent-data-grid > tbody > tr > td[col-justify=end] > div {
    justify-content: flex-end !important;
}

/* Opaque, so what scrolls under the pinned cells does not show through. :where() keeps this at (0,1,1):
   the library's row hover (its own opaque colour) and any row tint rule of a page still win. */
:where(table.mdg-columns) th.mdg-col-menu,
:where(table.mdg-columns) td.mdg-col-menu,
:where(table.mdg-columns.mdg-columns-actions > thead > tr) > th:nth-last-child(2),
:where(table.mdg-columns.mdg-columns-actions > tbody > tr) > td:nth-last-child(2) {
    background-color: var(--colorNeutralBackground1);
}

/* The header cell must not rise above the body cells' z-index, not even on hover (the library lifts a
   hovered header to 6): with a higher one the open ⋯ menu was laid out and hit-tested but never painted
   while the grid overflowed (Chromium, diary 0231). Header and body never overlap, so equal is enough. */
table.mdg-columns th.mdg-col-menu,
table.mdg-columns th.mdg-col-menu:hover {
    z-index: 2;
}

/* The library lifts a hovered header cell to z-index 6; scrolled under the pinned cells it then painted
   over them. The column-menu grids' popups (⋯, filter operators) are top-layer menus and need no lift. */
table.mdg-columns th[cell-type=columnheader]:not(.mdg-col-menu):hover {
    z-index: 1;
}

table.mdg-columns th.mdg-col-menu > div {
    padding: 0;
}

/* The empty (and loading) message: the library spans one cell over every track, so in a grid that
   scrolls sideways it was centred on the scroll width, off-screen on a phone (diary 0242). The cell is
   pinned to the frame's left edge at the frame's visible width (100cqi of the table), so the page's
   EmptyContent is centred in what the user sees at any scroll position. The table is a size container
   only while it holds such a row (:has), so a grid with rows keeps its intrinsic width; inline-size
   containment makes no containing block for fixed or absolute descendants (checked in Chromium). */
table.data-grid-fullwidth.mdg-columns:has(> tbody > tr:is([row-state=empty-content], [row-state=loading-content])) {
    container-type: inline-size;
}
table.mdg-columns > tbody > tr:is([row-state=empty-content], [row-state=loading-content]) > td {
    position: sticky;
    inset-inline-start: 0;
    justify-self: start;
    box-sizing: border-box;
    width: 100cqi;
}

/* The last column (⋯) loses its resize handle to the global rule above; the action column before it is
   content-wide too, so neither has one. The library also adds its own [actual-resize-handle]. */
table.mdg-columns th.mdg-col-menu [actual-resize-handle],
table.mdg-columns.mdg-columns-actions th:nth-last-child(2) [resize-handle],
table.mdg-columns.mdg-columns-actions th:nth-last-child(2) [actual-resize-handle] {
    display: none;
}

/* ---------------------------------------------------------------------------
   Header filters — Components/Shared/GridFilters (FilterPropertyColumn / FilterTemplateColumn on a
   MercuryDataGrid with Filters=). The header cell holds the library's own header and, under it, the
   column's filter editor (.mgf > .cf). Global, not scoped: the header cells are the library's.
--------------------------------------------------------------------------- */
/* The library pins header cells to the row height inline and centres them in the row; with an editor
   in one of them every header cell of that grid grows with the row and starts at its top. */
table.data-grid-fullwidth:has(.mgf) th[cell-type=columnheader] {
    height: auto !important;
    align-self: stretch !important;
    align-content: start !important;
}

.mgf {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    text-align: start;
}

/* The editor never widens its column: its inputs count as nothing when the browser works out what the
   column needs, only this minimum does. */
.mgf > .cf-compact {
    contain: inline-size;
    min-width: 110px;
    margin: 0 6px 2px 4px;
}

.mgf > .cf-compact.cf-date {
    min-width: 132px;
}

/* The editor (ColumnFilter). Compact: operator button + value on one line. */
.cf-compact {
    display: flex;
    align-items: center;
    gap: 2px;
    min-width: 0;
    padding: 2px;
    border-radius: var(--borderRadiusMedium);
    font-weight: var(--fontWeightRegular);
}

.cf-compact.cf-on {
    background: var(--colorBrandBackground2);
}

.cf-compact > fluent-menu {
    display: inline-flex;
    flex: 0 0 auto;
}

/* Two values (between, range) stack: a wrap that depends on the column width would change the header
   height while a column is dragged. */
.cf-compact .cf-values {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1 1 0;
    min-width: 0;
}

.cf-compact .cf-values > * {
    min-width: 0;
    width: 100%;
}

.cf-compact .cf-values > fluent-menu {
    display: block;
}

.cf-op {
    min-width: 26px;
    padding: 0 5px;
    font-size: var(--fontSizeBase300);
    font-family: var(--fontFamilyMonospace);
}

.cf-choice {
    width: 100%;
    min-width: 0;
}

.cf-choice-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.cf-caret {
    margin-left: 4px;
}

/* Stacked: the popup form (operator above the value); only the sandbox's comparison page shows it. */
.cf-stacked {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: start;
    font-weight: var(--fontWeightRegular);
}

.cf-stacked .cf-values {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cf-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

/* A column whose text wraps instead of being cut with "…" (TemplateColumn Class="mdg-wrap"): the whole
   customer name or note is read in the list. Pair it with data-grid-autorow on the grid, so the row
   grows to the tallest cell. */
table.data-grid-fullwidth td.mdg-wrap {
    white-space: normal;
    overflow-wrap: anywhere;
    text-overflow: clip;
    line-height: 1.35;
}

/* ---------------------------------------------------------------------------
   Süresi Azalan VPN Lisansları: the row colour is the days left
   (VpnExpiryTone: ≤7 yellow, ≤5 orange, ≤3 red; Pages/Vpn/ExpiringVpnList).
   ---------------------------------------------------------------------------
   Rows are display:contents, so the tint goes on the cells; global app.css
   because the td is library DOM (§9 trap 2), as .coupon-row-editing. */
table.data-grid-fullwidth tr.vpn-expiry-yellow > td {
    background-color: var(--colorPaletteYellowBackground2, #fef7b2);
}

table.data-grid-fullwidth tr.vpn-expiry-orange > td {
    background-color: var(--colorPaletteDarkOrangeBackground2, #f4bfab);
}

table.data-grid-fullwidth tr.vpn-expiry-red > td {
    background-color: var(--colorPaletteRedBackground2, #eeacb2);
}
