/* The customer page (CustomerDetailPage and its Customer* parts): the header card above the tabs and
   the tab bodies. Global rather than scoped: the parts are several components, and the rules reach
   FluentUI elements. Tokens only. design.md "Customer page", diary 0191. */

/* ── cards ── */
.cc-card { box-sizing: border-box; width: 100%; min-width: 0; background: var(--colorNeutralBackground1); border: 1px solid var(--colorNeutralStroke2);
    border-radius: var(--borderRadiusLarge); padding: 12px 14px; }
.cc-card-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; min-height: 28px; }
.cc-card-h > .cc-title { font-weight: var(--fontWeightSemibold); }
.cc-muted { color: var(--colorNeutralForeground3); }
.cc-small { font-size: var(--fontSizeBase200); }
.cc-sep { height: 1px; background: var(--colorNeutralStroke2); margin: 10px 0; }

/* ── header ── */
.cc-header { padding: 14px 16px; }
.cc-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 24px; align-items: start; }
.cc-id { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 18px; }
.cc-name { font-size: var(--fontSizeBase500); font-weight: var(--fontWeightSemibold); }
.cc-pharm { font-size: var(--fontSizeBase400); color: var(--colorNeutralForeground2); }
.cc-facts { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 8px; align-items: center; }
.cc-phones .tds-phones { padding-top: 0; }
.cc-warn-text { color: var(--colorStatusWarningForeground1); font-weight: var(--fontWeightSemibold); }
.cc-facts .fx { flex: 1 1 0; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 26px; }
/* Ana PC: one footprint at rest and while editing, so the neighbouring facts never move */
.fx-edit { display: flex; align-items: center; gap: 2px; width: 236px; height: 32px; }
.fx-edit > .ct { min-width: 0; }
.fx-input { flex: 1; min-width: 0; }
.fx-input fluent-text-input { width: 100%; min-width: 0; }
.cc-head-right { display: flex; align-items: flex-start; gap: 14px; }
.cc-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }
/* Hesap aktarımı on a transferred account: the warning colours (v4's "HESAP AKTARIMINDIR") */
.cc-transferred fluent-button { color: var(--colorStatusWarningForeground2); background-color: var(--colorStatusWarningBackground2); border-color: var(--colorStatusWarningBorderActive); }
/* İlaç Tarif + müşteri ayarları on one line at 1920×1080: fixed-width fields, tight gaps, never squeezed */
.cc-row2 { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; align-items: flex-end; }
.cc-group { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; flex-shrink: 0; }
.cc-vsep { width: 1px; align-self: stretch; background: var(--colorNeutralStroke2); margin: 0 4px; }
.cc-warn { display: flex; gap: 10px; align-items: center; margin-top: 12px; padding: 6px 10px; border-radius: var(--borderRadiusMedium);
    background: var(--colorStatusWarningBackground1); color: var(--colorNeutralForeground1); border: 1px solid var(--colorStatusWarningBorder1); }
.cc-warn > svg { flex: none; color: var(--colorStatusWarningForeground1); fill: currentColor; }
.cc-warn-body { flex: 1; min-width: 0; }
.cc-warn-sign { margin-left: 8px; color: var(--colorNeutralForeground3); white-space: nowrap; }
.cc-demo-command { padding: 10px; border-radius: var(--borderRadiusMedium); background: var(--colorNeutralBackground3); font-family: var(--fontFamilyMonospace); }
.cc-demo-command .ct-button { white-space: normal; word-break: break-all; }

/* ── TD Takip card ── */
.tdc { display: flex; flex-direction: column; gap: 6px; padding: 6px 8px 8px; border: 1px solid var(--colorNeutralStroke2); border-radius: var(--borderRadiusLarge); }
.tdc-cap { font-size: var(--fontSizeBase100); font-weight: var(--fontWeightSemibold); letter-spacing: .02em; color: var(--colorNeutralForeground3); user-select: none; }
.tdc-acts { display: flex; align-items: center; gap: 4px; }
.tdc-slot { width: 32px; height: 32px; }
.tdc-taker { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 3px 8px; border-radius: var(--borderRadiusMedium); white-space: nowrap; user-select: none; }
.tdc-taker b { font-weight: var(--fontWeightBold); }
.tdc-taker span { font-size: var(--fontSizeBase200); font-variant-numeric: tabular-nums; }
.tdc-none { padding: 3px 8px; border-radius: var(--borderRadiusMedium); background: var(--colorNeutralBackground3); color: var(--colorNeutralForeground3); font-size: var(--fontSizeBase200); }

/* ── dialogs on the header ── */
.cc-password { width: min(420px, 94vw); }
.cc-dialog-title { font-size: var(--fontSizeBase400); font-weight: var(--fontWeightSemibold); margin-bottom: 2px; }
.cc-dialog-sub { font-size: var(--fontSizeBase200); color: var(--colorNeutralForeground3); margin-bottom: 12px; }
.cc-fields { display: flex; flex-direction: column; gap: 10px; }
.cc-fields fluent-text-input { width: 100%; }
.cc-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* ── tab bodies ── */
.cc-tab { margin-top: 14px; }
.cc-grid { display: grid; gap: 14px; align-items: start; }
.cc-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.cc-pad { padding: 16px 4px; }
.cc-pad-x { padding: 0 4px; }
.cc-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 5px 14px; align-items: center; }
.cc-kv > .k { font-size: var(--fontSizeBase200); color: var(--colorNeutralForeground3); user-select: none; }
.cc-money { font-weight: var(--fontWeightSemibold); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cc-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: var(--fontSizeBase200); font-weight: var(--fontWeightSemibold); white-space: nowrap; }
.cc-badge-ok { background: var(--colorStatusSuccessBackground2); color: var(--colorStatusSuccessForeground2); }
.cc-badge-warn { background: var(--colorStatusWarningBackground2); color: var(--colorStatusWarningForeground2); }
.cc-badge-info { background: var(--colorBrandBackground2); color: var(--colorBrandForeground2); }
.cc-badge-bad { background: var(--colorStatusDangerBackground2); color: var(--colorStatusDangerForeground2); }
.cc-badge-neutral { background: var(--colorNeutralBackground3); color: var(--colorNeutralForeground2); }

/* ── Profil ── */
.cc-profile { grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr); }
.cc-composer { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.cc-composer-row { display: flex; gap: 8px; align-items: flex-start; }
.cc-composer-box { flex: 1; min-width: 0; }
/* FluentTextArea renders inside an inline-grid <fluent-field>: stretch that, the host and its control part */
.cc-composer-box fluent-field { display: block; width: 100%; }
.cc-composer-box fluent-textarea { display: block; width: 100%; max-width: none !important; --inline-size: 100%; box-sizing: border-box; }
.cc-composer-box fluent-textarea::part(control) { width: 100%; box-sizing: border-box; resize: vertical; min-height: 56px; }
.cc-composer-acts { display: flex; gap: 4px; align-items: center; }
.cc-composer > div:last-child { margin: 0 !important; }
.cc-comments { list-style: none; margin: 4px 0 8px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cc-order-line { display: grid; grid-template-columns: auto 1fr auto auto; justify-items: start; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--colorNeutralStroke2); }
.cc-order-line > .cc-money { justify-self: end; }

/* ── tables ── */
.cc-table { width: 100%; border-collapse: collapse; font-size: var(--fontSizeBase200); }
.cc-table th { text-align: left; font-weight: var(--fontWeightSemibold); color: var(--colorNeutralForeground3); padding: 4px 8px; white-space: nowrap; }
.cc-table td { padding: 6px 8px; border-top: 1px solid var(--colorNeutralStroke2); vertical-align: middle; }
.cc-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cc-table .nw { white-space: nowrap; }
.cc-table tfoot td { border-top: 1px solid var(--colorNeutralStroke2); }
.cc-table tfoot tr.tot td { font-weight: var(--fontWeightSemibold); font-size: var(--fontSizeBase300); }
.cc-table tr.ended td { color: var(--colorNeutralForeground3); }
.cc-table .sub { display: block; font-size: var(--fontSizeBase100); color: var(--colorNeutralForeground3); }
.cc-big { font-size: var(--fontSizeBase500); font-weight: var(--fontWeightSemibold); line-height: 1; }
.cc-bad-text { color: var(--colorStatusDangerForeground1); }

/* ── Siparişler ── */
.cc-orders { grid-template-columns: minmax(0, 1.7fr) minmax(380px, 1fr); }
.cc-ord-sum { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: var(--fontSizeBase200); color: var(--colorNeutralForeground3); }
.cc-ord-sum b { color: var(--colorNeutralForeground1); font-weight: var(--fontWeightSemibold); }
.cc-ord-table tbody tr { cursor: pointer; }
.cc-ord-table tbody tr:hover td { background: var(--colorNeutralBackground1Hover); }
.cc-ord-table tbody tr:focus-visible { outline: 2px solid var(--colorStrokeFocus2); outline-offset: -2px; }
.cc-ord-table tbody tr.sel td { background: var(--colorBrandBackground2); }
.cc-ord-table tbody tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--colorBrandStroke1); }
.cc-ord-id { display: inline-flex; align-items: center; gap: 4px; font-weight: var(--fontWeightSemibold); }
.cc-ord-note { display: inline-flex; color: var(--colorStatusDangerForeground1); }
.cc-ord-note svg { width: 14px; height: 14px; fill: currentColor; }
.cc-od-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cc-od-links { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 8px; }
.cc-od-links .nav-link { font-weight: var(--fontWeightSemibold); }
.cc-od-note { margin: 10px 0; padding: 6px 10px; border-radius: var(--borderRadiusMedium); background: var(--colorStatusDangerBackground1);
    border: 1px solid var(--colorStatusDangerBorder1); color: var(--colorNeutralForeground1); }
.cc-od-kv { margin: 10px 0; }
.cc-od-addr { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.cc-od-addr > div { border: 1px solid var(--colorNeutralStroke2); border-radius: var(--borderRadiusMedium); padding: 8px 10px; font-size: var(--fontSizeBase200); line-height: 1.45; }
.cc-od-addr .k { display: block; font-size: var(--fontSizeBase100); font-weight: var(--fontWeightSemibold); color: var(--colorNeutralForeground3); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
.cc-od-addr .who { font-weight: var(--fontWeightSemibold); }
.cc-more { margin-left: 4px; }

/* ── Sipariş oluştur ── */
.cc-new { grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) minmax(320px, .8fr); }
.cc-np-search fluent-field, .cc-np-search fluent-text-input { display: block; width: 100%; }
.cc-np-list { margin-top: 6px; max-height: 620px; overflow-y: auto; }
.cc-np-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 5px 0; border-top: 1px solid var(--colorNeutralStroke2); }
.cc-np-row:first-child { border-top: none; }
.cc-np-price { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cc-np-price s { display: block; font-size: var(--fontSizeBase100); color: var(--colorNeutralForeground3); }
.cc-np-in { margin-left: 4px; font-size: var(--fontSizeBase100); color: var(--colorBrandForeground2); }
.cc-qty { display: inline-flex; align-items: center; gap: 2px; }
.cc-qty > span { min-width: 22px; text-align: center; font-variant-numeric: tabular-nums; font-weight: var(--fontWeightSemibold); }
.cc-np-empty { padding: 18px; text-align: center; color: var(--colorNeutralForeground3); border: 1px dashed var(--colorNeutralStroke1); border-radius: var(--borderRadiusMedium); }
.cc-np-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cc-np-two fluent-field, .cc-np-one fluent-field { display: block; width: 100%; }
.cc-np-two fluent-select, .cc-np-one fluent-select, .cc-np-two fluent-dropdown, .cc-np-one fluent-dropdown { width: 100%; min-width: 0; }
.cc-np-one { margin-top: 10px; }
.cc-np-one fluent-textarea { display: block; width: 100%; max-width: none !important; --inline-size: 100%; box-sizing: border-box; }
.cc-np-one fluent-textarea::part(control) { width: 100%; box-sizing: border-box; resize: vertical; }
.cc-np-warn { padding: 8px 10px; border-radius: var(--borderRadiusMedium); background: var(--colorStatusWarningBackground1); border: 1px solid var(--colorStatusWarningBorder1); }
.cc-np-hint { margin-top: 4px; }
.cc-sum-line { display: flex; justify-content: space-between; padding: 4px 0; font-variant-numeric: tabular-nums; }
.cc-new .cc-sum-line:first-of-type { margin-top: 10px; }
.cc-sum-line.tot { border-top: 1px solid var(--colorNeutralStroke1); margin-top: 4px; padding-top: 8px; font-size: var(--fontSizeBase500); font-weight: var(--fontWeightSemibold); }
.cc-sum-go { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.cc-pay-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--colorBrandBackground2); color: var(--colorBrandForeground2); font-size: var(--fontSizeBase200); }
.cc-np-blocked { margin-top: 6px; text-align: right; }

/* ── EczaneVPN ── */
.cc-vpn1 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) minmax(0, 1fr); }
.cc-vpn-failed { display: flex; align-items: center; gap: 10px; }
.cc-card-h-tight { margin-bottom: 4px; min-height: 0; align-items: flex-start; }
.cc-acts { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cc-acts-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cc-push { margin-left: auto; }
.cc-step-row { display: flex; align-items: center; gap: 10px; }
.cc-hist { display: grid; grid-template-columns: max-content max-content minmax(0, 1fr); gap: 3px 10px; font-size: var(--fontSizeBase200); }
.cc-health { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.cc-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; background: var(--colorNeutralForeground4); }
.cc-dot-ok { background: var(--colorStatusSuccessForeground1); }
.cc-dot-bad { background: var(--colorStatusDangerForeground1); }
.cc-ok-text { color: var(--colorStatusSuccessForeground1); }
.cc-limit { display: inline-flex; align-items: center; gap: 4px; }
.cc-limit fluent-text-input, .cc-limit fluent-number-input { width: 112px; min-width: 0; }
.cc-history-dialog { width: min(760px, 94vw); }

/* admin-only zone: near-black frame and tag, one section per full-width row */
.cc-adm { position: relative; margin-top: 22px; padding: 18px 12px 12px; border: 2px solid var(--colorNeutralForeground1); border-radius: var(--borderRadiusLarge); background: var(--colorNeutralBackground1); }
.cc-adm-tag { position: absolute; top: -11px; left: 12px; padding: 2px 8px; border-radius: var(--borderRadiusSmall); background: var(--colorNeutralForeground1); color: var(--colorNeutralBackground1);
    font-size: var(--fontSizeBase100); font-weight: var(--fontWeightSemibold); letter-spacing: .04em; }
.cc-adm-row { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px; padding: 10px 2px; border-top: 1px solid var(--colorNeutralStroke2); align-items: start; }
.cc-adm-row:first-of-type { border-top: none; padding-top: 2px; }
.cc-adm-rt { display: flex; flex-direction: column; gap: 2px; padding-top: 4px; font-weight: var(--fontWeightSemibold); }
.cc-adm-rt small { font-weight: normal; font-size: var(--fontSizeBase200); color: var(--colorNeutralForeground3); }
.cc-adm-rc { min-width: 0; }
.cc-adm-console { display: grid; grid-template-columns: minmax(320px, .8fr) minmax(0, 1.2fr); gap: 14px; align-items: start; }
.cc-adm-cmd { display: flex; align-items: flex-start; gap: 8px; }
.cc-adm-cmd fluent-field { flex: 1; min-width: 0; display: block; }
.cc-adm-cmd fluent-textarea { display: block; width: 100%; max-width: none !important; --inline-size: 100%; }
.cc-mono, .cc-mono::part(control) { font-family: var(--fontFamilyMonospace); }
.cc-adm-results { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cc-adm-result { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-size: var(--fontSizeBase200); }
.cc-adm-result .cc-pre { flex-basis: 100%; }
.cc-adm-fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 28px; }
.cc-adm-f { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cc-adm-f > .k { font-size: var(--fontSizeBase100); color: var(--colorNeutralForeground3); user-select: none; }
.cc-adm-wide { max-width: 480px; }
.cc-adm-vsep { width: 1px; align-self: stretch; background: var(--colorNeutralStroke2); }
.cc-adm-gap { margin-top: 10px; }
.cc-adm-hint { align-self: center; max-width: 520px; }
.cc-adm-seats { display: flex; flex-wrap: wrap; gap: 8px; }
.cc-adm-seat { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px; border: 1px solid var(--colorNeutralStroke2); border-radius: var(--borderRadiusMedium); font-size: var(--fontSizeBase200); }
.cc-adm-scroll { max-height: 280px; overflow-y: auto; }
.cc-pre { margin: 0; padding: 8px 10px; max-height: 300px; overflow: auto; border-radius: var(--borderRadiusMedium); background: var(--colorNeutralForeground1); color: var(--colorNeutralBackground3);
    font: 12px/1.45 var(--fontFamilyMonospace); white-space: pre-wrap; }
.cc-pre-log { max-height: 220px; white-space: pre; }
.cc-ellipsis { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Güncelle ── */
.cc-upd-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cc-upd { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 12px; }
.cc-upd fluent-text-input, .cc-upd fluent-field { display: block; width: 100%; }
.cc-switch { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cc-switch > span { white-space: nowrap; }

/* ── narrow screens (tablet, phone) ──
   Everything above is the desktop layout and stays as it is; below 900px the side-by-side layouts
   stack. Without this the header's auto-width right side (actions + TD Takip card) squeezed the
   customer's name and facts into a sliver, the settings row ran off the screen, and the Profil tab's
   320px side column left the history column a few pixels wide (comments one letter per line). */
@media (max-width: 900px) {
    /* header: identity on top, the actions and the TD Takip card under it */
    .cc-head { grid-template-columns: minmax(0, 1fr); }
    .cc-head-right { flex-wrap: wrap; }
    .cc-actions { justify-content: flex-start; }

    /* İlaç Tarif + customer settings: the groups may shrink and wrap their fields */
    .cc-group { flex-shrink: 1; min-width: 0; }
    .cc-vsep { display: none; }

    /* tab bodies: one column, the side cards under the main one */
    .cc-profile, .cc-orders, .cc-new, .cc-vpn1, .cc-upd, .cc-adm-console { grid-template-columns: minmax(0, 1fr); }
    .cc-adm-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }

    /* a table wider than the phone scrolls inside its card instead of widening the page */
    .cc-card:has(.cc-table) { overflow-x: auto; }
}

@media (max-width: 600px) {
    /* the comment box takes the full width; Ekle / Bas Konuş / Oku go under it */
    .cc-composer-row { flex-wrap: wrap; }
    .cc-composer-box { flex-basis: 100%; }
    .cc-header { padding: 12px; }
}
