main {
  padding: 0 0 112px;
}

/* Compact cabinet redesign */
.cabinet-page {
  --bg-main: #0b0c0e;
  --bg-surface: #111318;
  --bg-surface-hover: #151820;
  --text-primary: #f2f3f5;
  --text-secondary: #9a9da5;
  --border-subtle: rgba(240, 242, 246, .11);
  --border-active: rgba(201, 193, 220, .48);
  --text-muted: #8f929a;
  --muted: #8f929a;
  --radius-inner: 8px;
  --surface-soft: #14161b;
  --border: rgba(240, 242, 246, .11);
  --good: #c9c1dc;
  --bad: #f2a0a0;
  --accent: #c9c1dc;
  min-height: 100vh;
  background: #0b0c0e;
  color: #f2f3f5;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
.cabinet-page main { margin-left: 220px; padding: 80px 0 64px; }
.cabinet-page .wrap { width: min(1200px, calc(100% - 48px)); }
.cabinet-header { position: fixed; top: 0; left: 0; z-index: 40; width: 100%; padding: 18px 24px 0; border: 0; background: transparent; }
.cabinet-nav { display: flex; width: min(1120px, 100%); min-height: 62px; margin: 0 auto; align-items: center; gap: 24px; padding: 0 12px 0 10px; border: 1px solid rgba(255,255,255,.18); border-radius: 16px; background: rgba(10,11,14,.84); box-shadow: 0 14px 40px rgba(0,0,0,.28); backdrop-filter: blur(14px) saturate(130%); }
.cabinet-brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-size: 11px; font-weight: 700; letter-spacing: .13em; }
.cabinet-brand img { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; }
.cabinet-brand i { padding-left: 10px; border-left: 1px solid var(--border-subtle); color: #777a82; font-style: normal; font-weight: 500; letter-spacing: 0; }
.cabinet-nav nav { display: flex; margin-left: auto; align-items: center; gap: 34px; }
.cabinet-nav nav a, .cabinet-nav nav button { border: 0; background: transparent; color: #9a9da5; font: inherit; font-size: 13px; cursor: pointer; text-decoration: none; }
.cabinet-nav nav a:hover, .cabinet-nav nav button:hover { color: #fff; }
.cabinet-nav .cabinet-logout { min-height: 42px; padding: 10px 18px; border: 1px solid rgba(255,255,255,.2); border-radius: 9px; color: #f2f3f5; font-weight: 600; }
.cabinet-sidebar { position: fixed; inset: 80px auto 0 0; z-index: 30; display: flex; width: 220px; flex-direction: column; padding: 28px 18px 22px; border-right: 1px solid var(--border-subtle); background: #090a0c; }
.cabinet-sidebar > p { margin: 0 10px 18px; color: #666972; font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.cabinet-sidebar nav { display: grid; gap: 4px; }
.cabinet-sidebar nav a { display: flex; min-height: 46px; align-items: center; gap: 11px; padding: 0 11px; border-radius: 8px; color: #9a9da5; font-size: 14px; font-weight: 500; text-decoration: none; }
.cabinet-sidebar nav a span { color: #545760; font-size: 9px; font-variant-numeric: tabular-nums; }
.cabinet-sidebar nav a:hover { background: #111318; color: #fff; }
.cabinet-sidebar nav a.is-active { background: #17161e; color: #f2eef9; }
.cabinet-sidebar nav a.is-active span { color: #aaa2bb; }
.cabinet-sidebar nav a[hidden] { display: none; }
.cabinet-sidebar-help { display: grid; gap: 7px; margin-top: auto; padding: 14px 12px; border: 1px solid var(--border-subtle); border-radius: 9px; background: #101216; }
.cabinet-sidebar-help strong { font-size: 11px; }
.cabinet-sidebar-help a { color: #9c96aa; font-size: 10px; text-decoration: none; }
.cabinet-page .loading { padding: 80px 0; color: var(--text-secondary); }

.cabinet-page .cabinet-hero { display: grid; min-height: 0; grid-template-columns: 1fr auto; align-items: end; gap: 32px; padding: 52px 0 30px; border-bottom: 1px solid var(--border-subtle); }
.cabinet-eyebrow { margin-bottom: 12px; color: #a9a2ba; font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.cabinet-page .cabinet-hero h1 { max-width: 820px; margin: 0; font-size: clamp(38px, 3.6vw, 48px); font-weight: 620; line-height: 1.08; letter-spacing: -.04em; }
.cabinet-page .cabinet-hero h1 span { color: #c9c1dc; }
.cabinet-page .cabinet-hero .lead { margin: 10px 0 0; color: var(--text-secondary); font-size: 14px; line-height: 1.55; }
.cabinet-hero-actions { display: flex; align-items: center; gap: 12px; }
.cabinet-state { display: inline-flex; align-items: center; gap: 7px; color: #9699a1; font-size: 11px; }
.cabinet-state i { width: 6px; height: 6px; border-radius: 50%; background: #c9c1dc; box-shadow: 0 0 10px rgba(201,193,220,.45); }
.cabinet-page .btn { min-height: 40px; padding: 0 15px; border: 1px solid var(--border-subtle); border-radius: 8px; background: #eceef2; color: #101115; box-shadow: none; font-family: inherit; font-size: 12px; font-weight: 650; transition: transform .12s ease, border-color .16s ease, background .16s ease; }
.cabinet-page .btn:hover { transform: none; filter: none; }
.cabinet-page .btn:active { transform: scale(.98); }
.cabinet-page .btn.ghost { background: transparent; color: #c9cbd1; }

.cabinet-page #cabinet > .grid { display: grid; grid-template-columns: 1.08fr .92fr; align-items: start; gap: 12px; margin-top: 18px; }
.cabinet-page #cabinet > .grid + .grid { grid-template-columns: 1.08fr .92fr; margin-top: 12px; }
.cabinet-page .card { padding: 22px; border: 1px solid var(--border-subtle); border-radius: 12px; background: #111318; box-shadow: none; }
.cabinet-page .card h2, .cabinet-page .pricing-head h2 { margin: 0; font-size: 22px; font-weight: 620; line-height: 1.25; letter-spacing: -.025em; }
.cabinet-page .profile-grid { margin-top: 18px; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; }
.cabinet-page .info, .cabinet-page .user-detail-item { padding: 13px; border: 1px solid rgba(255,255,255,.08); border-radius: 8px; background: #0e1014; box-shadow: none; }
.cabinet-page .info.wide { grid-column: span 2; }
.cabinet-page #account .card:first-child .profile-grid > .info:nth-child(3) { grid-column: span 2; }
.cabinet-page .info small, .cabinet-page .user-detail-item small { margin-bottom: 6px; color: #858891; font-size: 10px; letter-spacing: .08em; }
.cabinet-page .info strong, .cabinet-page .user-detail-item strong { color: #e9eaed; font-size: 14px; font-weight: 580; }
.cabinet-page .info:has(#subscriptionUntil) { grid-column: span 2; border-color: rgba(201,193,220,.28); background: #17161e; }
.cabinet-page .info:has(#subscriptionUntil) small { color: #a9a2ba; }
.cabinet-page .info #subscriptionUntil { color: #f5f2fb; font-size: clamp(22px, 2.3vw, 30px); font-weight: 650; line-height: 1.15; letter-spacing: -.035em; }
.cabinet-page .actions { gap: 8px; margin-top: 16px; }
.cabinet-page form { gap: 12px; }
.cabinet-page form label { color: #9a9da5; font-size: 12px; }
.cabinet-page input, .cabinet-page select, .cabinet-page textarea { min-height: 44px; margin-top: 7px; border: 1px solid rgba(255,255,255,.1); border-radius: 8px; background: #0d0f12; color: #f1f2f4; font-family: inherit; font-size: 14px; }
.cabinet-page input[type="file"] { display: block; min-height: 44px; padding: 4px; cursor: pointer; }
.cabinet-page input[type="file"]::file-selector-button { min-height: 34px; margin-right: 10px; padding: 0 12px; border: 1px solid rgba(255,255,255,.14); border-radius: 6px; background: #202229; color: #f1f2f4; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.cabinet-page input[type="file"]::file-selector-button:hover { background: #2b2e37; }
.cabinet-page input:focus, .cabinet-page select:focus, .cabinet-page textarea:focus { border-color: var(--border-active); outline: none; box-shadow: none; }
.cabinet-page .update-file-field { display: grid; gap: 7px; }
.cabinet-page .form-label { color: #9a9da5; font-size: 12px; }
.cabinet-page .update-dropzone { position: relative; display: flex; align-items: center; gap: 14px; min-height: 88px; margin: 0; padding: 16px 18px; border: 1px dashed rgba(201,193,220,.34); border-radius: 10px; background: linear-gradient(135deg, rgba(201,193,220,.08), rgba(255,255,255,.025)); color: #f1f2f4; cursor: pointer; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.cabinet-page .update-dropzone:hover, .cabinet-page .update-dropzone:focus-visible, .cabinet-page .update-dropzone.is-dragging { border-color: rgba(201,193,220,.9); background: linear-gradient(135deg, rgba(201,193,220,.16), rgba(255,255,255,.05)); outline: none; }
.cabinet-page .update-dropzone.is-dragging { transform: translateY(-1px); }
.cabinet-page .update-dropzone.has-file { border-style: solid; border-color: rgba(166,208,192,.55); background: rgba(166,208,192,.08); }
.cabinet-page .update-dropzone.is-invalid { border-color: rgba(232,140,140,.8); }
.cabinet-page .update-dropzone-icon { display: grid; flex: 0 0 34px; place-items: center; width: 34px; height: 34px; border: 1px solid rgba(201,193,220,.32); border-radius: 9px; color: #d9d0f0; font-size: 22px; line-height: 1; }
.cabinet-page .update-dropzone-copy { display: grid; min-width: 0; gap: 4px; }
.cabinet-page .update-dropzone-copy strong { overflow: hidden; color: #f3f0f8; font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.cabinet-page .update-dropzone-copy small { color: #8b8e97; font-size: 12px; line-height: 1.45; }
.cabinet-page .update-dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.cabinet-page .section-spacer { height: 18px; }
.cabinet-page .file-hint, .cabinet-page .detail-muted { color: #8b8e97; font-size: 12px; line-height: 1.6; }

.cabinet-page .table-wrap { margin-top: 14px; overflow: auto; border: 1px solid rgba(255,255,255,.08); border-radius: 9px; background: #0e1014; }
.cabinet-page table { width: 100%; border-collapse: collapse; font-size: 12px; }
.cabinet-page th { padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,.08); background: #13151a; color: #777a82; font-size: 9px; letter-spacing: .07em; text-align: left; text-transform: uppercase; }
.cabinet-page td { padding: 11px 12px; border-bottom: 1px solid rgba(255,255,255,.06); color: #b8bbc2; }
.cabinet-page tr:last-child td { border-bottom: 0; }

.cabinet-page .pricing-section { margin-top: 12px; padding: 24px; border: 1px solid var(--border-subtle); border-radius: 12px; background: #0f1115; }
.cabinet-page .pricing-head { display: grid; grid-template-columns: 1fr 1fr; align-items: end; gap: 24px; }
.cabinet-page .pricing-head p { max-width: 440px; margin: 0; justify-self: end; color: var(--text-secondary); font-size: 13px; }
.cabinet-page .pricing-grid { grid-template-columns: repeat(4,1fr); gap: 8px; margin-top: 20px; }
.cabinet-page .pricing-card { position: relative; min-height: 220px; padding: 19px; border: 1px solid rgba(255,255,255,.09); border-radius: 9px; background: #121419; }
.cabinet-page .pricing-card.featured { border-color: rgba(201,193,220,.34); background: #17161e; }
.cabinet-page .pricing-card strong { font-size: 18px; font-weight: 620; }
.cabinet-page .pricing-card b { margin-top: auto; font-size: 40px; font-weight: 600; letter-spacing: -.045em; }
.cabinet-page .pricing-card span { margin: 5px 0 18px; color: #9a9da5; font-size: 13px; }
.cabinet-page .best-label { position: absolute; top: 12px; right: 12px; padding: 4px 7px; border-radius: 5px; background: #c9c1dc; color: #121116; font-size: 9px; }
.cabinet-page .pricing-section > .actions { display: none; }

.cabinet-page .media-panel, .cabinet-page .admin-panel { margin-top: 12px; }
.cabinet-page .admin-panel { scroll-margin-top: 82px; padding-top: 14px; }
.cabinet-page .admin-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 16px; padding: 4px 2px 0; }
.cabinet-page .admin-heading p { margin: 0 0 7px; color: #a9a2ba; font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.cabinet-page .admin-heading h2 { margin: 0; font-size: 34px; font-weight: 650; letter-spacing: -.04em; }
.cabinet-page .admin-heading > span { color: #777a82; font-size: 10px; }
.cabinet-page .media-panel > .card { padding: 24px; }
.cabinet-page .admin-shell { padding: 0; }
.cabinet-page .admin-tabs-nav { background: #0e1014; }
.cabinet-page .tab-btn { min-height: 48px; padding: 12px 17px; font-size: 12px; }
.cabinet-page .tab-btn.active { border-color: #c9c1dc; background: #161820; }
.cabinet-page .admin-tabs-content { padding: 20px; }
.cabinet-page .admin-divider { margin: 20px 0; background: rgba(255,255,255,.08); }

.cabinet-page .support-panel { margin-top: 28px; scroll-margin-top: 88px; }
.cabinet-page .support-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 16px; padding: 0 2px; }
.cabinet-page .support-heading p { margin: 0 0 7px; color: #a9a2ba; font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.cabinet-page .support-heading h2 { margin: 0; font-size: 34px; font-weight: 650; letter-spacing: -.04em; }
.cabinet-page .support-heading-actions { display: flex; align-items: center; gap: 12px; }
.cabinet-page .support-live-state { color: #858891; font-size: 11px; }
.cabinet-page .support-layout { display: grid; grid-template-columns: minmax(260px, 330px) minmax(0, 1fr); min-height: 620px; padding: 0; overflow: hidden; }
.cabinet-page .support-inbox { display: flex; min-width: 0; flex-direction: column; border-right: 1px solid rgba(255,255,255,.08); background: #0e1014; }
.cabinet-page .support-inbox-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.cabinet-page .support-inbox-head > div { display: grid; gap: 3px; min-width: 0; }
.cabinet-page .support-inbox-head strong { color: #f0f1f3; font-size: 14px; }
.cabinet-page .support-inbox-head span { color: #777a82; font-size: 11px; }
.cabinet-page .support-filters { display: grid; gap: 7px; padding: 12px; border-bottom: 1px solid rgba(255,255,255,.07); }
.cabinet-page .support-filters input, .cabinet-page .support-filters select { width: 100%; min-height: 38px; margin: 0; padding: 0 10px; font-size: 12px; }
.cabinet-page .support-ticket-list { display: grid; align-content: start; overflow: auto; }
.cabinet-page .support-ticket-item { display: grid; gap: 10px; width: 100%; padding: 15px 16px; border: 0; border-bottom: 1px solid rgba(255,255,255,.06); background: transparent; color: inherit; text-align: left; cursor: pointer; }
.cabinet-page .support-ticket-item:hover { background: #151820; }
.cabinet-page .support-ticket-item.is-selected { background: #191822; box-shadow: inset 2px 0 0 #c9c1dc; }
.cabinet-page .support-ticket-item-top, .cabinet-page .support-ticket-item-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.cabinet-page .support-ticket-item-top strong { min-width: 0; overflow: hidden; color: #e4e5e8; font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.cabinet-page .support-ticket-item-bottom { color: #777a82; font-size: 10px; }
.cabinet-page .support-ticket-item-bottom span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cabinet-page .support-status { flex: 0 0 auto; padding: 3px 6px; border-radius: 999px; color: #aaa2bb; font-size: 9px; font-style: normal; font-weight: 700; }
.cabinet-page .support-status-open { background: rgba(201,193,220,.14); }
.cabinet-page .support-status-in_progress { background: rgba(137,180,164,.14); color: #a6d0c0; }
.cabinet-page .support-status-closed { background: rgba(255,255,255,.08); color: #858891; }
.cabinet-page .support-chat { display: flex; min-width: 0; flex-direction: column; background: #111318; }
.cabinet-page .support-chat-empty { display: grid; min-height: 620px; align-content: center; justify-items: center; gap: 9px; padding: 30px; color: #858891; text-align: center; }
.cabinet-page .support-chat-empty strong { color: #e7e8eb; font-size: 17px; }
.cabinet-page .support-chat-empty span { max-width: 280px; font-size: 12px; }
.cabinet-page .support-empty-icon { display: grid; width: 42px; height: 42px; margin-bottom: 4px; place-items: center; border: 1px solid rgba(201,193,220,.3); border-radius: 50%; color: #c9c1dc; }
.cabinet-page .support-empty { display: grid; align-content: center; justify-items: center; min-height: 100px; padding: 25px; color: #777a82; font-size: 12px; text-align: center; }
.cabinet-page .support-chat-content { display: flex; min-height: 620px; flex: 1; flex-direction: column; }
.cabinet-page .support-chat-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 19px 22px; border-bottom: 1px solid rgba(255,255,255,.08); }
.cabinet-page .support-chat-head > div:first-child { min-width: 0; }
.cabinet-page .support-chat-kicker { display: block; margin-bottom: 5px; color: #a9a2ba; font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.cabinet-page .support-chat-head h3 { overflow: hidden; margin: 0; color: #f0f1f3; font-size: 18px; font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }
.cabinet-page .support-chat-meta { display: block; margin-top: 5px; color: #777a82; font-size: 11px; }
.cabinet-page .support-chat-actions { display: flex; flex: 0 0 auto; gap: 7px; }
.cabinet-page .support-messages { display: grid; align-content: start; gap: 12px; min-height: 0; flex: 1; padding: 22px; overflow: auto; background: radial-gradient(circle at 80% 0%, rgba(201,193,220,.04), transparent 35%); }
.cabinet-page .support-message { width: min(76%, 620px); padding: 12px 14px; border: 1px solid rgba(255,255,255,.08); border-radius: 12px 12px 12px 4px; background: #0d0f12; }
.cabinet-page .support-message.is-mine { justify-self: end; border-color: rgba(201,193,220,.22); border-radius: 12px 12px 4px 12px; background: #191822; }
.cabinet-page .support-message.is-admin:not(.is-mine) { border-color: rgba(166,208,192,.16); }
.cabinet-page .support-message-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.cabinet-page .support-message-head strong { color: #c9c1dc; font-size: 10px; font-weight: 700; }
.cabinet-page .support-message.is-admin:not(.is-mine) .support-message-head strong { color: #a6d0c0; }
.cabinet-page .support-message-head time { color: #6f727a; font-size: 9px; white-space: nowrap; }
.cabinet-page .support-message p { margin: 0; color: #d1d2d6; font-size: 13px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.cabinet-page .support-message-attachments { display: grid; gap: 7px; margin-top: 10px; }
.cabinet-page .support-attachment { color: #d9d6e4; font-size: 11px; text-decoration: none; }
.cabinet-page .support-attachment-image { display: grid; gap: 5px; }
.cabinet-page .support-attachment-image img { display: block; width: min(100%, 280px); max-height: 220px; border-radius: 7px; object-fit: cover; }
.cabinet-page .support-attachment-video { display: grid; gap: 5px; }
.cabinet-page .support-attachment-video video { display: block; width: min(100%, 320px); max-height: 220px; border-radius: 7px; background: #090a0c; }
.cabinet-page .support-attachment-file { display: flex; align-items: center; gap: 9px; padding: 9px; border: 1px solid rgba(255,255,255,.08); border-radius: 7px; background: rgba(255,255,255,.03); }
.cabinet-page .support-attachment-file > span:last-child { display: grid; gap: 2px; min-width: 0; }
.cabinet-page .support-attachment-file strong { overflow: hidden; color: #ddd9e9; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.cabinet-page .support-attachment-file small { color: #777a82; font-size: 10px; }
.cabinet-page .support-file-icon { display: grid; width: 24px; height: 24px; flex: 0 0 auto; place-items: center; border-radius: 6px; background: rgba(201,193,220,.15); color: #c9c1dc; font-size: 14px; }
.cabinet-page .support-composer { padding: 14px 18px 17px; border-top: 1px solid rgba(255,255,255,.08); background: #0e1014; }
.cabinet-page .support-subject-input { display: block; width: 100%; margin: 0 0 8px; }
.cabinet-page .support-composer-row { display: flex; align-items: end; gap: 9px; }
.cabinet-page .support-composer textarea { width: 100%; min-height: 44px; max-height: 140px; margin: 0; padding: 12px; resize: vertical; }
.cabinet-page .support-composer-row .btn { flex: 0 0 auto; }
.cabinet-page .support-attachments-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 9px; color: #777a82; font-size: 10px; }
.cabinet-page .support-attach-btn { margin: 0; padding: 6px 9px; border: 1px solid rgba(255,255,255,.1); border-radius: 6px; color: #c9c1dc; font-size: 10px; cursor: pointer; }
.cabinet-page .support-attach-btn:hover { background: #191822; }
.cabinet-page #supportFileInput { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.cabinet-page #supportFileList { color: #aaa2bb; overflow-wrap: anywhere; }
.cabinet-page #supportMessageStatus { margin: 8px 0 0; }

@media (max-width: 900px) {
  .cabinet-page .support-layout { grid-template-columns: minmax(230px, 38%) minmax(0, 1fr); }
  .cabinet-page .support-message { width: 88%; }
}

@media (max-width: 620px) {
  .cabinet-page .support-heading { align-items: start; flex-direction: column; }
  .cabinet-page .support-heading-actions { width: 100%; justify-content: space-between; }
  .cabinet-page .support-layout { display: flex; min-height: 0; flex-direction: column; }
  .cabinet-page .support-inbox { min-height: 220px; max-height: 300px; border-right: 0; border-bottom: 1px solid rgba(255,255,255,.08); }
  .cabinet-page .support-chat-content, .cabinet-page .support-chat-empty { min-height: 540px; }
  .cabinet-page .support-chat-head { align-items: start; flex-direction: column; }
  .cabinet-page .support-chat-actions { width: 100%; }
  .cabinet-page .support-chat-actions .btn { flex: 1; }
  .cabinet-page .support-message { width: 94%; }
  .cabinet-page .support-composer-row { align-items: stretch; flex-direction: column; }
  .cabinet-page .support-composer-row .btn { width: 100%; }
}

/* Modal behavior was missing in the original cabinet stylesheet. */
.cabinet-page.modal-open { overflow: hidden; }
.cabinet-page .overlay-modal { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; padding: 24px; background: rgba(3,4,6,.76); backdrop-filter: blur(10px); }
.cabinet-page .overlay-modal[aria-hidden="true"] { display: none !important; }
.cabinet-page .overlay-modal.is-open, .cabinet-page .overlay-modal[aria-hidden="false"] { display: flex; }
.cabinet-page .overlay-modal-panel { position: relative; width: min(900px, 100%); max-height: min(820px, calc(100vh - 48px)); padding: 26px; overflow: auto; border: 1px solid rgba(255,255,255,.12); border-radius: 14px; background: #111318; box-shadow: 0 32px 100px rgba(0,0,0,.56); }
.cabinet-page .overlay-modal-panel.small { width: min(480px, 100%); }
.cabinet-page .overlay-modal-close { position: sticky; top: 0; z-index: 2; display: grid; width: 32px; height: 32px; margin: 0 0 -32px auto; place-items: center; border: 1px solid rgba(255,255,255,.12); border-radius: 8px; background: #191b21; color: #e8e9ec; font: 20px/1 Inter, sans-serif; cursor: pointer; }
.cabinet-page .overlay-modal-panel .badge { display: inline-flex; margin: 0 42px 14px 0; color: #a9a2ba; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.cabinet-page .overlay-modal-panel h2 { margin: 0 42px 8px 0; font-size: 26px; font-weight: 650; letter-spacing: -.035em; }
.cabinet-page .overlay-modal-lead { margin: 0 42px 20px 0; color: #9598a0; font-size: 13px; line-height: 1.55; }
.cabinet-page .social-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cabinet-page .social-buttons .btn { width: 100%; }
.cabinet-page .social-modal-actions { display: grid; gap: 10px; }
.cabinet-page .social-modal-actions .btn { display: flex; width: 100%; margin: 0; }
.cabinet-page .payment-summary { padding: 18px; border: 1px solid rgba(201,193,220,.24); border-radius: 10px; background: #17161e; }
.cabinet-page .payment-summary strong { font-size: 28px; }

@media (max-width: 900px) {
  .cabinet-page main { margin-left: 0; padding-top: 80px; padding-bottom: 90px; }
  .cabinet-sidebar { inset: auto 0 0; width: auto; height: 68px; flex-direction: row; align-items: center; padding: 8px 12px; border: 1px solid var(--border-subtle); border-width: 1px 0 0; }
  .cabinet-sidebar > p, .cabinet-sidebar-help { display: none; }
  .cabinet-sidebar nav { display: flex; width: 100%; justify-content: space-around; gap: 2px; }
  .cabinet-sidebar nav a { min-height: 48px; flex-direction: column; justify-content: center; gap: 2px; padding: 0 8px; font-size: 9px; }
  .cabinet-nav nav a:not(:nth-child(2)):not(:nth-child(3)), .cabinet-nav nav #openCabinetSocials { display: none; }
  .cabinet-page .cabinet-hero { grid-template-columns: 1fr; padding-top: 36px; }
  .cabinet-page #cabinet > .grid, .cabinet-page #cabinet > .grid + .grid { grid-template-columns: 1fr; }
  .cabinet-page .pricing-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 620px) {
  .cabinet-header { padding: 10px 10px 0; }
  .cabinet-page .wrap, .cabinet-nav { width: 100%; }
  .cabinet-brand i, .cabinet-nav nav a { display: none !important; }
  .cabinet-nav nav { gap: 8px; }
  .cabinet-page .profile-grid { grid-template-columns: repeat(2,1fr); }
  .cabinet-page .pricing-head { grid-template-columns: 1fr; }
  .cabinet-page .pricing-head p { justify-self: start; }
  .cabinet-page .pricing-grid { grid-template-columns: 1fr; }
  .cabinet-page .overlay-modal { padding: 12px; }
  .cabinet-page .overlay-modal-panel { max-height: calc(100vh - 24px); padding: 20px; }
  .cabinet-page .social-buttons { grid-template-columns: 1fr; }
}

/* Не растягивать соседние карточки до высоты самой длинной формы. */
.cabinet-page #account,
.cabinet-page #activity { align-items: start; }
.cabinet-page #account > .card,
.cabinet-page #activity > .card { align-self: start; }

.loading {
  padding: 110px 0;
  color: var(--text-muted);
  text-align: center;
}

.cabinet-hero {
  display: grid;
  min-height: 410px;
  align-items: end;
  padding: 88px 0 64px;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 48px;
}

.cabinet-hero h1 {
  margin-bottom: 17px;
  font-size: clamp(3rem, 7vw, 5.75rem);
}

.cabinet-hero .lead {
  margin-bottom: 0;
}

#cabinet > .grid + .grid {
  margin-top: 16px;
}

.profile-grid {
  display: grid;
  margin-top: 21px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.info,
.user-detail-item {
  min-width: 0;
  max-width: 100%;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.095);
  border-radius: var(--radius-inner);
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.075), transparent 45%),
    rgba(255, 255, 255, 0.032);
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.14),
    0 1px 0 rgba(255, 255, 255, 0.055) inset;
}

.info.wide {
  grid-column: 1 / -1;
}

.info small,
.info strong,
.user-detail-item small,
.user-detail-item strong {
  display: block;
}

.info small,
.user-detail-item small {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.info strong,
.user-detail-item strong {
  min-width: 0;
  overflow: hidden;
  color: #f1edf7;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-overflow: ellipsis;
}

.card,
.grid > *,
.admin-section,
.table-wrap {
  min-width: 0;
  max-width: 100%;
}

.file-hint,
.detail-muted {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.65;
}

.section-note {
  margin-top: 12px;
}

.section-copy {
  margin-bottom: 14px;
}

.section-spacer {
  height: 22px;
}

.admin-panel,
.media-panel {
  display: none;
  margin-top: 78px;
}

.media-panel > .card {
  padding: 34px;
}

.media-promo-box {
  margin: 18px 0 21px;
  padding: 18px;
  border: 1px solid rgba(121, 231, 181, 0.2);
  border-radius: var(--radius-inner);
  background: linear-gradient(135deg, rgba(121, 231, 181, 0.08), rgba(255, 255, 255, 0.035));
}

.media-promo-box p {
  margin: 0;
}

.media-promo-box .promo-code {
  color: var(--good);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 18px;
  font-weight: 800;
}

.media-promo-box .file-hint {
  margin-top: 6px;
}

.finance-grid {
  display: grid;
  margin-bottom: 20px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.finance-card,
.payout-box {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.105);
  border-radius: var(--radius-inner);
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.085), transparent 44%),
    var(--surface-soft);
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.18),
    0 1px 0 rgba(255, 255, 255, 0.06) inset;
}

.finance-card small {
  display: block;
  color: var(--text-muted);
}

.finance-card strong {
  display: block;
  margin-top: 5px;
  color: var(--accent);
  font-size: 25px;
}

.finance-card.accent-cool strong {
  color: #72cfff;
}

.payout-box {
  margin-bottom: 25px;
  padding: 22px;
}

.payout-box h3,
.table-title {
  margin-bottom: 12px;
}

.form-grid {
  display: grid;
  margin-bottom: 14px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.remember-payment {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 18px;
  user-select: none;
}

.remember-payment label {
  display: block;
  margin: 0;
  color: var(--text-muted);
  cursor: pointer;
}

.table-section {
  margin-bottom: 25px;
}

.revenue-value {
  color: var(--accent);
}

.admin-quick-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  padding: 15px 18px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: var(--radius-inner);
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 255, 255, 0.09), transparent 45%),
    rgba(255, 255, 255, 0.04);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.055) inset;
  color: var(--text-muted);
  font-size: 12px;
}

.admin-shell {
  padding: 0;
}

.admin-tabs-nav {
  display: flex;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.018));
  scrollbar-width: thin;
}

.tab-btn {
  min-height: 56px;
  flex: 0 0 auto;
  padding: 15px 21px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  transition: color 0.22s ease, background 0.22s ease, border-color 0.22s ease;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.035);
  color: #fff;
}

.tab-btn.active {
  border-bottom-color: var(--accent);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.12), transparent 70%),
    rgba(255, 255, 255, 0.045);
  color: #fff;
}

.admin-tabs-content {
  padding: 27px;
}

.admin-section > h2,
.admin-section > h3 {
  margin-top: 0;
}

.admin-divider {
  height: 1px;
  margin: 28px 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.11), transparent);
}

.collapsible-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.collapsible-head h2 {
  margin: 0;
}

.collapsible-body {
  padding-top: 21px;
}

.collapsible-body[hidden] {
  display: none;
}

.search-form,
.form-section {
  margin-bottom: 24px;
}

.search-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.search-row label {
  flex: 1;
}

.two-column-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.button-offset {
  margin-top: 12px;
}

.button-bottom-offset {
  margin-bottom: 24px;
}

.generated-key {
  display: none;
  min-height: 86px;
  margin-top: 12px;
  resize: vertical;
}

.check-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 255, 255, 0.075), transparent 46%),
    var(--surface-soft);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset;
}

.check-row input {
  flex: 0 0 auto;
}

.table-wrap {
  position: relative;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.095);
  border-radius: var(--radius-inner);
  background:
    radial-gradient(circle at 15% 0%, rgba(255, 255, 255, 0.055), transparent 42%),
    rgba(3, 5, 7, 0.38);
  box-shadow:
    0 22px 54px rgba(0, 0, 0, 0.22),
    0 1px 0 rgba(255, 255, 255, 0.04) inset;
  scrollbar-width: thin;
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 12px;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
  text-align: left;
  vertical-align: top;
}

th {
  background: rgba(255, 255, 255, 0.035);
  color: #c3bdca;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

td {
  color: #a9a3b2;
}

tr:last-child td {
  border-bottom: 0;
}

tbody tr {
  transition: background 0.2s ease;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

td small {
  color: var(--muted);
}

.actions-cell,
.table-actions {
  min-width: 190px;
}

.actions-cell .btn,
.table-actions .btn {
  display: inline-flex;
  width: auto;
  margin: 3px 4px 3px 0;
  vertical-align: top;
}

/* Premium interaction and overflow pass */
.cabinet-page :is(.btn, .tab-btn, .cabinet-sidebar nav a, .pricing-card, .check-row) {
  transition: color .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .22s ease, transform .14s ease;
}
.cabinet-page .btn { cursor: pointer; }
.cabinet-page .btn:hover { border-color: rgba(201,193,220,.48); background: #fff; color: #111217; box-shadow: 0 8px 22px rgba(0,0,0,.22), 0 0 0 1px rgba(201,193,220,.08) inset; transform: translateY(-1px); }
.cabinet-page .btn.ghost:hover { border-color: rgba(201,193,220,.42); background: #1c1922; color: #f7f4fb; }
.cabinet-page .btn:active { transform: scale(.97); transition-duration: .08s; }
.cabinet-page .pricing-card:hover { border-color: rgba(201,193,220,.38); background: #171920; transform: translateY(-3px); box-shadow: 0 18px 34px rgba(0,0,0,.22); }
.cabinet-page .pricing-card.featured:hover { background: #1b1922; }
.cabinet-page :is(.admin-panel, .admin-shell, .admin-tabs-content, .admin-section, .collapsible-head, .collapsible-body, .search-row, .form-grid, .two-column-form) > * { min-width: 0; }
.cabinet-page :is(td, th, label, strong, small, p, pre, code, .message, .file-hint, .detail-muted) { max-width: 100%; overflow-wrap: anywhere; word-break: break-word; }
.cabinet-page .admin-tabs-nav { gap: 5px; padding: 6px; border: 0; border-radius: 11px; background: #111318; }
.cabinet-page .tab-btn { min-height: 40px; padding: 0 14px; border: 1px solid transparent; border-radius: 8px; }
.cabinet-page .tab-btn:hover { border-color: rgba(255,255,255,.09); background: #171920; }
.cabinet-page .tab-btn.active { border: 1px solid rgba(201,193,220,.24); background: #201d27; box-shadow: 0 5px 14px rgba(0,0,0,.2); }
.cabinet-page .admin-tabs-content { overflow: hidden; }
.cabinet-page .admin-quick-note { background: #111318; box-shadow: none; }
.cabinet-page .collapsible-head { padding: 4px 0; }
.cabinet-page .collapsible-body:not([hidden]) { animation: cabinetPanelIn .28s cubic-bezier(.2,.8,.2,1); }
@keyframes cabinetPanelIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .cabinet-page *, .cabinet-page *::before, .cabinet-page *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.danger-text,
.status-rejected {
  color: var(--bad);
}

.ok-text,
.status-paid {
  color: var(--good);
}

.status-used,
.detail-muted,
.status-pending {
  color: var(--text-muted);
}

.amount-positive {
  color: var(--good);
}

.amount-negative {
  color: var(--bad);
}

.amount-cell {
  font-weight: 750;
}

.danger-action {
  color: var(--bad);
}

.realtime-dot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-muted);
}

.realtime-dot::before,
.online-dot::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 11px rgba(121, 231, 181, 0.65);
  content: "";
}

.overlay-modal-lead {
  margin-bottom: 22px;
}

.user-detail-controls,
.user-detail-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
}

.user-detail-controls {
  margin: 24px 0;
}

.user-detail-control {
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
  background: var(--surface-soft);
}

.user-detail-control h3 {
  margin-bottom: 8px;
}

.user-detail-control p {
  color: var(--text-muted);
  font-size: 12px;
}

.user-detail-summary {
  margin-bottom: 18px;
}

.user-detail-section {
  margin-top: 24px;
}

.user-detail-section > h3 {
  margin-bottom: 12px;
}

.detail-list {
  display: grid;
  gap: 8px;
}

.detail-row {
  display: grid;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 14px;
}

.detail-sublist {
  display: grid;
  gap: 6px;
}

.user-detail-json {
  max-height: 220px;
  margin: 8px 0 0;
  padding: 11px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.25);
  color: #c8c1d1;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  white-space: pre-wrap;
}

.password-reset-chip,
.event-type-pill,
.beta-chip {
  display: inline-flex;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: #dce2ea;
  font-size: 10px;
  font-weight: 700;
}

.event-message,
.event-actor,
.event-target {
  display: block;
  margin-top: 3px;
}

.event-message {
  color: #ddd7e4;
}

.event-actor,
.event-target {
  color: var(--muted);
  font-size: 11px;
}

.social-modal-actions .btn {
  width: 100%;
}

@media (max-width: 900px) {
  .cabinet-hero {
    min-height: 350px;
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .cabinet-hero .btn {
    justify-self: start;
  }

  #cabinet > .grid {
    grid-template-columns: 1fr;
  }

  .user-detail-controls {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  main {
    padding-bottom: 80px;
  }

  .cabinet-hero {
    min-height: 0;
    padding: 64px 0 48px;
  }

  .cabinet-hero .btn {
    width: 100%;
  }

  .profile-grid,
  .user-detail-summary,
  .two-column-form {
    grid-template-columns: 1fr;
  }

  .info.wide {
    grid-column: auto;
  }

  .media-panel > .card {
    padding: 22px;
  }

  .admin-quick-note {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-tabs-content {
    padding: 20px;
  }

  .collapsible-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .collapsible-head .btn {
    width: auto;
  }

  .search-row {
    align-items: stretch;
    flex-direction: column;
  }

  .search-row .btn {
    width: 100%;
  }

  .detail-row {
    grid-template-columns: 1fr;
    gap: 5px;
  }
}
