/* Токены Whale52 Cabinet, вариант w52light. Базовые формы и таблицы — проверенная админка deepneon. */
:root{--bg:#f4f8f9;--surface:#fff;--surface2:#eef4f5;--line:#dce6e8;--line2:#e8eff0;--ink:#03111a;--ink2:#1e3a44;--muted:#5b7079;--accent:#0b7a75;--purple:#0b7a75;--accent-bg:#e3f5f4;--danger:#b3341a;--p-neon:#d21fc4;--p-reef:#e2512f;--p-whale:#2f6fd0}
body.admin-shell{background:var(--bg);color:var(--ink)}
.bar{background:var(--surface);border-bottom:1px solid var(--line)}
.bar .shell{min-height:74px;display:flex;align-items:center;justify-content:space-between;gap:18px}
.w52-logo{white-space:nowrap;font:300 25px/1 Unbounded,Arial,sans-serif;letter-spacing:-.06em;color:var(--ink)}
.w52-logo span{color:var(--muted);padding:0 2px}.w52-caption{color:var(--muted);font-size:12px}
.w52-footer{margin:56px auto 24px;text-align:center;color:var(--muted);font-size:12px}
body.admin-shell #app>.wide{max-width:1400px;padding-top:36px}
body.admin-shell .panel{border:1px solid var(--line);box-shadow:none;background:var(--surface)}
body.admin-shell .btn:not(.secondary):not(.tertiary):not(.danger){background:var(--accent);border-color:var(--accent);color:#fff}
body.admin-shell .btn.secondary{border-color:#d3dfe2;background:var(--surface);color:var(--ink)}
body.admin-shell .btn.secondary:hover{background:var(--surface2)}
body.admin-shell .tabs a.on{color:var(--accent);border-color:var(--accent)}
body.admin-shell input,body.admin-shell select,body.admin-shell textarea{border-color:#d3dfe2;accent-color:var(--accent)}
body.admin-shell a.link{color:var(--accent)}
.product-switch a.on{background:var(--accent);color:#fff}.product-switch a:hover{background:var(--accent-bg);color:var(--ink)}
.product-switch a::before{content:'';width:7px;height:7px;border-radius:2px;background:currentColor;margin-right:7px}
.product-switch a[href*="product=deepneon"]::before{background:var(--p-neon)}
.product-switch a[href*="product=deepreef"]::before{background:var(--p-reef)}
.product-switch a[href*="product=deepwhale"]::before{background:var(--p-whale)}
.catalog-intro{color:var(--muted);max-width:800px;line-height:1.6}.catalog-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:18px}
.admin-shell main.shell,.admin-shell #app,.admin-shell .wide,.admin-shell #view,.catalog-grid,.catalog-grid>.panel{min-width:0;max-width:100%}
.admin-shell .table-wrap{min-width:0;max-width:100%;overflow-x:auto}
.catalog-head>div{min-width:0}.catalog-head{flex-wrap:wrap}.catalog-head>.catalog-actions{flex-shrink:0}
.catalog-grid>.panel{margin:0}.catalog-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.catalog-head{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin-bottom:20px}
.catalog-head h2{margin:0 0 8px}.catalog-tag{font:500 10px/1.5 'JetBrains Mono',monospace;text-transform:uppercase;letter-spacing:.08em;color:var(--muted)}
.catalog-status{display:inline-block;padding:4px 8px;border-radius:5px;background:var(--surface2);color:var(--muted);font-size:12px}
.catalog-status.active{background:var(--accent-bg);color:var(--accent)}.catalog-status.scheduled{background:#fdf3dc;color:#8a5a00}
.catalog-empty{padding:32px 8px;color:var(--muted);text-align:center}
.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.form-grid .full-width{grid-column:1/-1}
.form-grid .field{min-width:0}.form-grid .check{display:flex;gap:8px;align-items:center;min-height:38px}
.form-grid input[type=checkbox]{width:17px;height:17px;margin:0}.form-grid textarea{min-height:80px}
.catalog-dialog fieldset{border:1px solid var(--line);border-radius:10px;padding:14px;margin:0;min-width:0}
.catalog-dialog legend{font-weight:600;padding:0 6px}.catalog-dialog .tier-row{display:grid;grid-template-columns:1fr 1fr 1.3fr auto;gap:10px;align-items:end;margin-bottom:10px}
.catalog-dialog .catalog-row{display:grid;grid-template-columns:1fr 1.5fr 1fr auto;gap:8px;align-items:end;margin-bottom:10px}
.catalog-dialog .field{font-size:13px}.catalog-dialog .field input,.catalog-dialog .field select{width:100%}
.dlg:has(.catalog-dialog){width:min(800px,calc(100vw - 28px));max-width:800px;max-height:90vh;overflow:auto}
.billing-dialog-head{position:sticky;top:0;z-index:1;display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:8px 0;background:var(--surface);border-bottom:1px solid var(--line)}
.billing-dialog-head h2{margin:0;min-width:0;overflow-wrap:anywhere;font-size:20px}.billing-dialog-head .btn{flex-shrink:0;align-self:flex-start}
.catalog-subhead{display:flex;gap:16px;align-items:center;justify-content:space-between;margin:22px 0 10px}
.catalog-subhead h2{font:600 16px/1.4 Onest,Arial,sans-serif;letter-spacing:0;margin:0}
.table td .catalog-actions{min-width:180px}.table td .catalog-actions button{white-space:nowrap}
.money-cell{white-space:nowrap;font-variant-numeric:tabular-nums}.catalog-help{font-size:12px;color:var(--muted);line-height:1.6}
:focus-visible{outline:3px solid #3fd0c9;outline-offset:3px}
@media(max-width:760px){.bar .shell{min-height:64px}.w52-caption{display:none}.catalog-head{flex-direction:column}.form-grid{grid-template-columns:1fr}.catalog-dialog .tier-row,.catalog-dialog .catalog-row{grid-template-columns:1fr 1fr}.product-switch-label{display:none}.catalog-actions{gap:6px}.w52-logo{font-size:22px}}

/* Навигация владельца: продукт и разделы на левой панели, рабочая область посвящена одной задаче. */
body.has-admin-navigation>.bar,body.has-admin-navigation>.w52-footer{display:none}
body.has-admin-navigation>main.shell{padding:0;max-width:none;margin:0;width:100%;min-height:100vh}
.w52-layout{display:grid;width:100%;grid-template-columns:264px minmax(0,1fr);min-height:100vh;align-items:start}
.w52-sidebar{position:sticky;top:0;display:flex;flex-direction:column;gap:22px;height:100vh;overflow-y:auto;overscroll-behavior:contain;padding:26px 16px 18px;border-right:1px solid var(--line);background:var(--surface);z-index:20;min-width:0}
.w52-side-brand{padding:4px 12px 0;position:relative}.w52-side-brand>.w52-nav-label{padding:12px 0 0}
.w52-side-brand .w52-logo{font-size:23px}.w52-product-context{padding:12px;border:1px solid var(--line);border-radius:12px;display:grid;gap:7px}
.w52-product-context .field{margin:0;font-size:11px;color:var(--muted)}.w52-product-context select{height:40px;min-height:40px;margin-top:4px;color:var(--ink);font-size:14px;font-weight:600}
.w52-nav-label{font:500 10px/1.4 'JetBrains Mono',monospace;letter-spacing:.1em;text-transform:uppercase;color:var(--muted)}
body #app .tabs.w52-sidebar-nav{display:flex;flex-direction:column;align-items:stretch;gap:16px;margin:0;flex:1}
.w52-nav-group{display:grid;gap:3px}.w52-nav-group>.w52-nav-label{padding:0 12px 6px}
body #app .tabs.w52-sidebar-nav a{justify-content:flex-start;text-align:left;height:38px;min-height:38px;padding:0 12px;border:0;background:transparent;color:var(--ink2);font-size:13px;font-weight:500;border-radius:8px;line-height:1.25}
body #app .tabs.w52-sidebar-nav a:hover{background:var(--surface2)}
body #app .tabs.w52-sidebar-nav a.on{background:var(--accent-bg);color:var(--accent);font-weight:600}
.w52-side-account{display:grid;gap:6px;border-top:1px solid var(--line);padding:16px 12px 0;font-size:13px}
.w52-side-account>span{font-size:11px;color:var(--muted)}.w52-side-account .btn{margin-top:7px;min-height:var(--control-height);height:auto;font-size:14px}
.w52-workspace{width:100%;min-width:0;max-width:100%;padding:38px clamp(22px,3.5vw,52px) 70px}
.w52-page-head{margin-bottom:28px}.w52-page-head .eyebrow{font-size:10px;line-height:1.5}
.w52-page-head h1{font-size:clamp(26px,2.6vw,36px);font-weight:300;line-height:1.22;letter-spacing:-.055em;margin:12px 0 0;outline:none}
.w52-mobile-bar,.w52-close,.w52-overlay{display:none}
body.has-admin-navigation #app .w52-close{display:none}
body.admin-shell .w52-workspace #view .panel{padding:28px;border-radius:var(--radius)}
.w52-workspace .catalog-head h2{font:600 19px/1.4 Onest,Arial,sans-serif;letter-spacing:-.02em}
.w52-workspace .catalog-intro{font-size:13px}.w52-workspace .catalog-head{gap:16px}
.w52-workspace .catalog-head>.catalog-actions{flex-shrink:1}
@media(max-width:1100px){.w52-workspace{padding:30px 24px 60px}.catalog-head{flex-direction:column}.w52-workspace .catalog-head>.catalog-actions{width:100%}.catalog-subhead{gap:12px;flex-wrap:wrap}}
@media(max-width:820px){
  .w52-layout{grid-template-columns:minmax(0,1fr)}.w52-workspace{grid-column:1;width:100%;padding:0 18px 45px}.w52-page-head{margin-top:24px;margin-bottom:22px}.w52-page-head h1{font-size:27px}
  .w52-sidebar{position:fixed;inset:0 auto 0 0;width:min(290px,calc(100vw - 40px));height:100dvh;transform:translateX(-105%);transition:transform .18s ease;box-shadow:var(--menu-sh,0 12px 32px rgba(3,17,26,.14));z-index:40}
  .w52-navigation-open .w52-sidebar{transform:translateX(0)}
  .w52-mobile-bar{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:12px 0;border-bottom:1px solid var(--line)}
  body.has-admin-navigation #app,.w52-workspace #view,.w52-workspace #view>.panel,.w52-workspace #view>.catalog-grid{width:100%;min-width:0}
  .w52-workspace .toolbar,.w52-workspace .catalog-head,.w52-workspace .catalog-head>div{width:100%;min-width:0}
  body.admin-shell .w52-workspace .toolbar .field{min-width:0;max-width:100%}
  .w52-mobile-bar .btn{flex-shrink:0}
  .w52-mobile-bar .w52-logo{font-size:19px}.w52-mobile-bar .btn{height:var(--control-height);min-height:var(--control-height);font-size:14px}
  body.has-admin-navigation #app .w52-close{display:inline-flex;position:absolute;right:0;top:-5px;align-items:center;justify-content:center;font-size:20px;width:30px;height:30px;padding:0}
  .w52-overlay:not([hidden]){display:block;position:fixed;inset:0;background:rgba(3,17,26,.4);border:0;z-index:30}
  body.w52-navigation-open{overflow:hidden}
  body.admin-shell .w52-workspace #view .panel{padding:20px}.w52-workspace .catalog-head{gap:14px}
}
@media(prefers-reduced-motion:reduce){.w52-sidebar{transition:none}}

/* Все таблицы админки: доступная ширина, переносы и карточки для плотных данных. */
body.admin-shell .w52-data-wrap{container-type:inline-size;overflow:visible}
body.admin-shell .table.w52-data-table{width:100%;min-width:0;table-layout:fixed}
body.admin-shell .w52-data-table th,body.admin-shell .w52-data-table td{min-width:0;white-space:normal;overflow-wrap:anywhere;vertical-align:top;padding:12px 10px}
body.admin-shell .w52-data-table th{font-size:10px;line-height:1.4}
body.admin-shell .w52-data-table td{font-size:13px;line-height:1.5}
body.admin-shell .w52-data-table td:first-child{font-weight:600;color:var(--ink)}
body.admin-shell .w52-data-table .catalog-actions{min-width:0;gap:6px;align-items:flex-start}
body.admin-shell .w52-data-table .catalog-actions button{max-width:100%;white-space:normal;height:auto;min-height:var(--control-height);padding:10px 12px}
body.admin-shell .w52-data-table td:last-child{min-width:0}
body.admin-shell .w52-data-table td::before{display:none}
@container (max-width:720px){
  body.admin-shell .w52-data-table.w52-data-dense{display:block;border:0}
  body.admin-shell .w52-data-table.w52-data-dense thead{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
  body.admin-shell .w52-data-table.w52-data-dense tbody{display:grid;gap:12px}
  body.admin-shell .w52-data-table.w52-data-dense tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 16px;padding:16px;border:1px solid var(--line);border-radius:12px;background:var(--surface)}
  body.admin-shell .w52-data-table.w52-data-dense td{display:block;min-width:0;padding:0;border:0;white-space:normal}
  body.admin-shell .w52-data-table.w52-data-dense td:first-child,body.admin-shell .w52-data-table.w52-data-dense td:last-child{grid-column:1/-1}
  body.admin-shell .w52-data-table.w52-data-dense td:first-child{font-size:15px}
  body.admin-shell .w52-data-table.w52-data-dense td::before{content:attr(data-label);display:block;font-size:10px;font-weight:500;line-height:1.4;color:var(--muted);margin-bottom:4px}
  body.admin-shell .w52-data-table.w52-data-dense td:first-child::before{display:none}
  body.admin-shell .w52-data-table.w52-data-dense td[data-label="Действия"]::before{display:none}
  body.admin-shell .w52-data-table.w52-data-dense .catalog-actions{width:100%;padding-top:2px}
}
@container (max-width:480px){
  body.admin-shell .w52-data-table{display:block;border:0}
  body.admin-shell .w52-data-table thead{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
  body.admin-shell .w52-data-table tbody{display:grid;gap:12px}
  body.admin-shell .w52-data-table tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 16px;padding:16px;border:1px solid var(--line);border-radius:12px;background:var(--surface)}
  body.admin-shell .w52-data-table td{display:block;min-width:0;padding:0;border:0;white-space:normal}
  body.admin-shell .w52-data-table td:first-child,body.admin-shell .w52-data-table td:last-child{grid-column:1/-1}
  body.admin-shell .w52-data-table td:first-child{font-size:15px}
  body.admin-shell .w52-data-table td::before{content:attr(data-label);display:block;font-size:10px;font-weight:500;line-height:1.4;color:var(--muted);margin-bottom:4px}
  body.admin-shell .w52-data-table td:first-child::before{display:none}
  body.admin-shell .w52-data-table td[data-label="Действия"]::before{display:none}
  body.admin-shell .w52-data-table .catalog-actions{width:100%;padding-top:2px}
}

body.admin-shell .table{min-width:0;table-layout:fixed}
body.admin-shell .w52-data-table .actions{display:flex;flex-wrap:wrap;justify-content:flex-start;align-items:center;min-width:0;white-space:normal;gap:6px}
body.admin-shell .w52-data-table td:has(>.actions),body.admin-shell .w52-data-table .user-email-cell{min-width:0;max-width:none}
body.admin-shell .w52-data-table .actions .btn{max-width:100%;white-space:normal;height:auto;min-height:var(--control-height);padding:10px 12px}
body.admin-shell .w52-data-table .event-data,body.admin-shell .w52-data-table .event-data pre{max-width:100%;min-width:0}
body.admin-shell .w52-data-table .event-data pre{padding:10px;font-size:11px}
@container (max-width:1000px){
  body.admin-shell .w52-data-table.w52-data-long{display:block;border:0}
  body.admin-shell .w52-data-table.w52-data-long thead{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
  body.admin-shell .w52-data-table.w52-data-long tbody{display:grid;gap:12px}
  body.admin-shell .w52-data-table.w52-data-long tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 16px;padding:16px;border:1px solid var(--line);border-radius:12px;background:var(--surface)}
  body.admin-shell .w52-data-table.w52-data-long td{display:block;min-width:0;padding:0;border:0;white-space:normal}
  body.admin-shell .w52-data-table.w52-data-long td:first-child,body.admin-shell .w52-data-table.w52-data-long td:last-child{grid-column:1/-1}
  body.admin-shell .w52-data-table.w52-data-long td:first-child{font-size:15px}
  body.admin-shell .w52-data-table.w52-data-long td::before{content:attr(data-label);display:block;font-size:10px;font-weight:500;line-height:1.4;color:var(--muted);margin-bottom:4px}
  body.admin-shell .w52-data-table.w52-data-long td:first-child::before{display:none}
  body.admin-shell .w52-data-table.w52-data-long td[data-label="Действия"]::before{display:none}
  body.admin-shell .w52-data-table.w52-data-long .catalog-actions{width:100%;padding-top:2px}
}
