/* Mobile clinic navigation uses the existing neutral Create Dental palette. */
.clinic-mobile-order-controls,.clinic-mobile-sections,.clinic-mobile-back,.clinic-mobile-title { display:none; }
.clinic-mobile-sheet:not([open]) { display:none; }
@media ((max-width: 900px) or (((pointer: coarse) and (hover: none) and (orientation: landscape) and (max-height: 560px)) and (max-height: 900px))) {
  .clinic-mobile-order-controls { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:stretch; gap:10px; margin:0 0 14px; }
  .clinic-mobile-order-controls>button { display:flex; align-items:center; justify-content:space-between; gap:9px; min-width:0; min-height:48px; padding:11px 13px; border:1px solid var(--cd-night-edge,#e3e3e3); border-radius:10px; background:var(--cd-night-paper,#fff); color:var(--cd-night-ink,#333); font:inherit; font-size:14px; font-weight:650; line-height:1.35; text-align:left; }
  .clinic-mobile-order-controls>button>span { min-width:0; overflow-wrap:anywhere; }
  .clinic-mobile-order-controls>button>svg { flex:none; }
  .clinic-mobile-order-controls>.clinic-mobile-filter-trigger { justify-content:center; color:var(--cd-night-secondary,#555); font-weight:600; }
  .clinic-mobile-order-controls>.clinic-mobile-filter-trigger.active { border-color:#888; background:var(--cd-night-hover,#f5f5f5); color:var(--cd-night-ink,#333); }
  .clinic-orders-panel>.clinic-status-segment,.clinic-dashboard-status-tabs,.clinic-page-segment { display:none; }
  .clinic-orders-panel>.toolbar { display:block; margin:0 0 14px; }
  .clinic-orders-panel>.toolbar>.clinic-filter-wrap { display:none; }
  .clinic-orders-panel>.toolbar>.search { display:flex; width:100%; min-width:0; min-height:46px; }
  .clinic-orders-panel>.toolbar>.search input { font-size:16px; }
  .clinic-orders-panel .orders-table td:nth-child(6) .badge { min-width:0; max-width:100%; white-space:normal; overflow-wrap:anywhere; line-height:1.3; }
  .clinic-mobile-sections { display:grid; gap:0; margin:0 0 16px; border-block:1px solid #e9e9e9; }
  .clinic-mobile-sections>button { display:flex; align-items:center; justify-content:space-between; gap:16px; min-height:78px; width:100%; padding:15px 2px; border:0; border-bottom:1px solid var(--cd-night-edge,#e9e9e9); background:transparent; color:var(--cd-night-ink,#333); text-align:left; }
  .clinic-mobile-sections>button:last-child { border-bottom:0; }
  .clinic-mobile-sections>button>span { display:grid; min-width:0; gap:5px; }
  .clinic-mobile-sections strong { font-size:16px; font-weight:650; }
  .clinic-mobile-sections small { color:var(--cd-night-secondary,#707070); font-size:12px; line-height:1.4; }
  .clinic-mobile-sections>button>svg { flex:none; color:var(--cd-night-secondary,#777); }
  .clinic-mobile-sections.section-open,.clinic-settings-content:not(.section-open),.clinic-desktop-title { display:none; }
  .clinic-mobile-title { display:inline; }
  .clinic-mobile-back { display:flex; align-items:center; align-self:flex-start; gap:6px; min-height:44px; margin:0; padding:0; border:0; background:transparent; color:var(--cd-night-secondary,#666); font-size:14px; font-weight:600; }
  .clinic-settings-content[data-section]:not([data-section="Основная информация"])>.clinic-photo { display:none!important; }
  .clinic-settings-content { margin-top:0; }
  .clinic-page-heading h1 { overflow-wrap:anywhere; }

  .clinic-mobile-sheet {
    --sheet-ink:#333; --sheet-muted:#707070; --sheet-line:#e5e5e5; --sheet-paper:#fff; --sheet-action:#707070;
    position:fixed; inset:auto 0 0; width:100%; max-width:560px; max-height:min(88dvh,720px);
    margin:0 auto; padding:0; border:0; border-radius:18px 18px 0 0; box-sizing:border-box;
    background:var(--sheet-paper); color:var(--sheet-ink); font:inherit; overflow:hidden; overscroll-behavior:contain;
  }
  .clinic-mobile-sheet[open] { display:grid; grid-template-rows:auto minmax(0,1fr) auto; }
  .clinic-mobile-sheet::backdrop { background:rgb(0 0 0 / 32%); }
  .clinic-sheet-header { display:flex; align-items:center; gap:8px; padding:12px 16px; border-bottom:1px solid var(--sheet-line); }
  .clinic-sheet-header h2 { flex:1; min-width:0; margin:0; color:var(--sheet-ink); font-size:19px; font-weight:700; line-height:1.35; }
  .clinic-sheet-icon { display:grid; place-items:center; flex:none; width:44px; height:44px; padding:0; border:0; border-radius:9px; background:transparent; color:var(--sheet-ink); }
  .clinic-sheet-scroll { min-height:0; overflow-y:auto; overflow-x:hidden; overscroll-behavior-y:contain; -webkit-overflow-scrolling:touch; }
  .clinic-sheet-options { display:grid; padding:8px 16px max(16px,env(safe-area-inset-bottom)); }
  .clinic-sheet-option { display:flex; align-items:center; gap:12px; width:100%; min-height:54px; margin:0; padding:13px 10px; border:0; border-bottom:1px solid var(--cd-night-edge,#f0f0f0); border-radius:0; background:var(--sheet-paper); color:var(--sheet-ink); text-align:left; font:inherit; font-size:15px; line-height:1.4; }
  .clinic-sheet-option:last-child { border-bottom:0; }
  .clinic-sheet-option.selected { border-radius:10px; background:var(--cd-night-hover,#f3f3f3); font-weight:650; }
  .clinic-sheet-option-text { flex:1; min-width:0; overflow-wrap:anywhere; }
  .clinic-sheet-count { flex:none; color:var(--sheet-muted); font-size:13px; font-variant-numeric:tabular-nums; }
  .clinic-sheet-check { display:grid; place-items:center; flex:none; width:22px; height:22px; color:var(--cd-night-secondary,#555); }
  .clinic-sheet-unchecked { display:block; width:19px; height:19px; border:1px solid var(--cd-night-edge,#c8c8c8); border-radius:50%; }
  .clinic-sheet-fields { display:grid; gap:0; padding:8px 20px 20px; }
  .clinic-sheet-field { display:flex; align-items:center; justify-content:space-between; gap:16px; min-height:84px; width:100%; padding:16px 0; border:0; border-bottom:1px solid var(--sheet-line); background:var(--sheet-paper); color:var(--sheet-ink); text-align:left; }
  .clinic-sheet-field>span { display:grid; gap:7px; min-width:0; }
  .clinic-sheet-field small { font-size:12px; color:var(--sheet-muted); }
  .clinic-sheet-field strong { font-size:16px; line-height:1.4; overflow-wrap:anywhere; font-weight:600; }
  .clinic-sheet-field>svg { flex:none; color:var(--sheet-muted); }
  .clinic-sheet-footer { display:grid; grid-template-columns:minmax(0,.8fr) minmax(0,1.3fr); gap:10px; padding:14px 20px calc(16px + env(safe-area-inset-bottom)); border-top:1px solid var(--sheet-line); background:var(--sheet-paper); }
  .clinic-sheet-action { display:flex; align-items:center; justify-content:center; min-height:48px; min-width:0; margin:0; padding:10px 12px; border:1px solid var(--sheet-line); border-radius:10px; background:var(--sheet-paper); color:var(--cd-night-secondary,#555); font:inherit; font-size:14px; line-height:1.3; font-weight:650; text-align:center; -webkit-text-fill-color:currentColor; }
  .clinic-sheet-action.primary { border-color:var(--sheet-action); background:var(--sheet-action); color:#fff; -webkit-text-fill-color:#fff; }
  .clinic-sheet-option:focus-visible,.clinic-sheet-field:focus-visible,.clinic-sheet-action:focus-visible,.clinic-sheet-icon:focus-visible { outline:2px solid #666; outline-offset:-3px; }
}
@media (max-width:900px) and (max-height:560px) and (orientation:landscape) and (not ((pointer: coarse) and (hover: none))) {
  .clinic-mobile-sheet { max-height:calc(100dvh - 8px); }
  .clinic-sheet-header { padding:6px 16px; }
  .clinic-sheet-option { min-height:48px; padding-block:10px; }
  .clinic-sheet-field { min-height:66px; padding-block:10px; }
  .clinic-sheet-footer { padding-block:8px calc(8px + env(safe-area-inset-bottom)); }
}

/* Clinic order lists share plain statuses and one consistent column rhythm. */
.shell table.clinic-order-list-table td:nth-child(6) .badge{
  display:inline-block;min-width:0;max-width:100%;min-height:0;padding:0;border:0;border-radius:0;
  background:transparent;color:var(--cd-night-secondary,#555);font-size:12px;font-weight:500;line-height:1.4;
  white-space:normal!important;overflow:visible!important;text-overflow:clip!important;overflow-wrap:normal;word-break:normal;
}
.shell table.clinic-order-list-table td:nth-child(6) .badge::before{content:none!important;display:none!important}
@media(min-width:901px){
  .shell .table-wrap>table.orders-table.clinic-order-list-table{width:100%!important;min-width:880px!important;table-layout:fixed!important}
  .shell .table-wrap>table.orders-table.clinic-order-list-table :is(th,td):nth-child(n){
    box-sizing:border-box;width:13.5%!important;min-width:0!important;max-width:none!important;
    padding:16px 12px!important;text-align:left!important;vertical-align:middle!important;
    white-space:normal!important;overflow:visible!important;text-overflow:clip!important;overflow-wrap:anywhere!important;line-height:1.4;
  }
  .shell .table-wrap>table.orders-table.clinic-order-list-table td:nth-child(n){height:64px}
  .shell .table-wrap>table.orders-table.clinic-order-list-table :is(th,td):nth-child(2){width:19%!important}
  .shell .table-wrap>table.orders-table.clinic-order-list-table :is(th,td):nth-child(4),
  .shell .table-wrap>table.orders-table.clinic-order-list-table :is(th,td):nth-child(5),
  .shell .table-wrap>table.orders-table.clinic-order-list-table :is(th,td):nth-child(7){white-space:nowrap!important;font-variant-numeric:tabular-nums}
  .shell .table-wrap>table.orders-table.clinic-order-list-table td>strong{white-space:inherit;overflow:visible;text-overflow:clip}
  .shell .table-wrap>table.orders-table.clinic-order-list-table th .order-sort{justify-content:flex-start!important;text-align:left!important;width:100%}
}

/* Only the clinic home preview uses this five-column layout. */
.shell table.clinic-dashboard-order-table .badge{
  display:inline-block;min-width:0;max-width:100%;padding:0;border:0;border-radius:0;
  background:transparent;color:var(--cd-night-secondary,#555);font-size:12px;font-weight:500;line-height:1.4;
  white-space:normal!important;overflow:visible!important;overflow-wrap:anywhere;
}
.shell table.clinic-dashboard-order-table .badge::before{content:none!important;display:none!important}
.clinic-dashboard-patient{display:grid;gap:4px;min-width:0}
.clinic-dashboard-patient small{color:var(--cd-night-secondary,#808080);font-size:11px;font-weight:400;line-height:1.4}
@media(min-width:901px){
  .shell .dashboard-main .table-wrap>table.orders-table.clinic-dashboard-order-table{width:100%!important;min-width:0!important;max-width:100%;table-layout:fixed!important}
  .shell .dashboard-main table.clinic-dashboard-order-table :is(th,td):nth-child(n){
    width:19%!important;min-width:0!important;max-width:none!important;padding:16px 12px!important;
    text-align:left!important;vertical-align:middle;line-height:1.4;
    white-space:normal!important;overflow:visible!important;text-overflow:clip!important;overflow-wrap:anywhere!important;
  }
  .shell .dashboard-main table.clinic-dashboard-order-table :is(th,td):nth-child(2){width:24%!important}
  .shell .dashboard-main table.clinic-dashboard-order-table :is(th,td):nth-child(3),
  .shell .dashboard-main table.clinic-dashboard-order-table :is(th,td):nth-child(5){white-space:nowrap!important;font-variant-numeric:tabular-nums}
  .shell .dashboard-main table.clinic-dashboard-order-table th .order-sort{justify-content:flex-start;width:100%}
  .shell .dashboard-main table.clinic-dashboard-order-table td>strong{white-space:inherit;overflow:visible;text-overflow:clip}
}
@media(max-width:900px){
  .shell table.clinic-dashboard-order-table td:nth-child(3)::before{content:'Срок'}
  .shell table.clinic-dashboard-order-table td:nth-child(4)::before{content:'Статус'}
  .shell table.clinic-dashboard-order-table td:nth-child(5)::before{content:'Сумма'}
  .shell table.clinic-dashboard-order-table td:nth-child(3){grid-column:1 / -1}
  .shell table.clinic-dashboard-order-table td:nth-child(4){grid-column:1}
  .shell table.clinic-dashboard-order-table td:nth-child(5){grid-column:2}
}
