/* ============================================================
   ТОКЕНЫ ТЕМ – единственное место, где объявляются цвета ЛК
   ============================================================ */

/* --- Общие, не зависят от бренда и темы --- */
:root {
  --radius: 10px;
  --radius-sm: 8px;
  --sidebar-w: 240px;
  --topbar-h: 54px;
  --font: 'Inter', 'Segoe UI', system-ui, sans-serif;

  /* Слои. Держать порядок: контент < сайдбар < топбар < модалка < тост */
  --z-content: 1;
  --z-sidebar: 100;
  --z-topbar: 150;
  --z-dropdown: 300;
  --z-modal: 500;
  --z-toast: 900;
}

/* --- CONVERO / светлая (по умолчанию) --- */
html[data-brand="convero"] {
  color-scheme: light;
  --brand-primary: #2563EB;
  --brand-accent:  #06B6D4;
  --brand-gradient: linear-gradient(135deg, #2563EB, #06B6D4);

  --bg:          #F8FAFC;
  --bg-card:     #FFFFFF;
  --bg-sidebar:  #FFFFFF;
  --bg-input:    #F1F5F9;
  --bg-hover:    rgba(15,23,42,.04);

  --text:        #0F172A;
  --text-muted:  #64748B;
  --text-invert: #FFFFFF;

  --accent:      #2563EB;
  --accent-soft: #EFF6FF;
  --accent-bg:   rgba(37,99,235,.08);

  --border:        rgba(15,23,42,.10);
  --border-strong: rgba(15,23,42,.20);
  --shadow:    0 1px 8px rgba(15,23,42,.06);
  --shadow-lg: 0 8px 32px rgba(15,23,42,.14);

  --success: #059669; --success-bg: rgba(5,150,105,.12);
  --danger:  #DC2626; --danger-bg:  rgba(220,38,38,.12);
  --warning: #D97706; --warning-bg: rgba(217,119,6,.14);
  --info:    #1D4ED8; --info-bg:    rgba(29,78,216,.12);
  --neutral: #64748B; --neutral-bg: rgba(100,116,139,.12);
  --purple:  #6D28D9; --purple-bg:  rgba(109,40,217,.12);
}

/* --- CONVERO / тёмная --- */
html[data-brand="convero"] body.dark {
  --bg:          #0B1E33;
  --bg-card:     #0D2340;
  --bg-sidebar:  #091929;
  --bg-input:    #132B47;
  --bg-hover:    rgba(255,255,255,.05);

  --text:        #FFFFFF;
  --text-muted:  #8B96AA;

  /* акцент светлее основного – иначе не проходит по контрасту на тёмном */
  --accent:      #3B82F6;
  --accent-soft: rgba(59,130,246,.10);
  --accent-bg:   rgba(59,130,246,.16);
  --brand-gradient: linear-gradient(135deg, #3B82F6, #22D3EE);

  --border:        rgba(255,255,255,.10);
  --border-strong: rgba(255,255,255,.20);
  --shadow:    0 2px 12px rgba(0,0,0,.30);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.45);

  --success: #34D399; --success-bg: rgba(52,211,153,.16);
  --danger:  #F87171; --danger-bg:  rgba(248,113,113,.16);
  --warning: #FBBF24; --warning-bg: rgba(251,191,36,.16);
  --info:    #60A5FA; --info-bg:    rgba(96,165,250,.16);
  --neutral: #94A3B8; --neutral-bg: rgba(148,163,184,.16);
  --purple:  #A78BFA; --purple-bg:  rgba(167,139,250,.16);
}

/* --- SOULARK / светлая --- */
html[data-brand="soulark"] {
  color-scheme: light;
  --brand-primary: #FF8C42;
  --brand-accent:  #FFB067;
  --brand-gradient: linear-gradient(135deg, #FF8C42, #FFB067);

  --bg:          #F5F5F5;
  --bg-card:     #FFFFFF;
  --bg-sidebar:  #FFFFFF;
  --bg-input:    #F5F5F5;
  --bg-hover:    rgba(0,0,0,.04);

  --text:        #1A1A1A;
  --text-muted:  #888888;
  --text-invert: #FFFFFF;

  --accent:      #FF8C42;
  --accent-soft: #FFF3E8;
  --accent-bg:   rgba(255,140,66,.10);

  --border:        rgba(0,0,0,.10);
  --border-strong: rgba(0,0,0,.20);
  --shadow:    0 1px 8px rgba(0,0,0,.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.14);

  --success: #2E7D32; --success-bg: rgba(46,125,50,.12);
  --danger:  #C62828; --danger-bg:  rgba(198,40,40,.12);
  --warning: #E65100; --warning-bg: rgba(230,81,0,.12);
  --info:    #1565C0; --info-bg:    rgba(21,101,192,.12);
  --neutral: #666666; --neutral-bg: rgba(102,102,102,.12);
  --purple:  #5E35B1; --purple-bg:  rgba(94,53,177,.12);
}

/* --- SOULARK / тёмная --- */
html[data-brand="soulark"] body.dark {
  --bg:          #141414;
  --bg-card:     #1E1E1E;
  --bg-sidebar:  #101010;
  --bg-input:    #242424;
  --bg-hover:    rgba(255,255,255,.05);

  --text:        #F5F5F5;
  --text-muted:  #9A9A9A;

  --accent:      #FF9E5E;
  --accent-soft: rgba(255,140,66,.10);
  --accent-bg:   rgba(255,140,66,.16);
  --brand-gradient: linear-gradient(135deg, #FF9E5E, #FFC08A);

  --border:        rgba(255,255,255,.10);
  --border-strong: rgba(255,255,255,.20);
  --shadow:    0 2px 12px rgba(0,0,0,.40);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.55);

  --success: #66BB6A; --success-bg: rgba(102,187,106,.16);
  --danger:  #EF5350; --danger-bg:  rgba(239,83,80,.16);
  --warning: #FFA726; --warning-bg: rgba(255,167,38,.16);
  --info:    #42A5F5; --info-bg:    rgba(66,165,245,.16);
  --neutral: #9E9E9E; --neutral-bg: rgba(158,158,158,.16);
  --purple:  #B39DDB; --purple-bg:  rgba(179,157,219,.16);
}

/* Compatibility aliases for existing components; no independent colors. */
:root {
  --green: var(--success);
  --red: var(--danger);
  --yellow: var(--warning);
  --blue: var(--info);
  --icon: var(--text-muted);
  --bg-main: var(--bg);
  --bg-accent: var(--bg-input);
  --card: var(--bg-card);
  --text-primary: var(--text);
  --text-secondary: var(--text-muted);
  --btn-sec-bg: var(--bg-input);
  --btn-sec-border: var(--border);
  --form-bg: var(--bg-input);
  --modal-overlay: rgba(0,0,0,.55);
  --header-bg: var(--bg-sidebar);
  --sidebar-bg: var(--bg-sidebar);
  --table-head-bg: var(--bg-input);
}

/* Base components */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
html.dark { color-scheme: dark; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  transition: background-color .18s ease, color .18s ease;
}
a { color: var(--accent); }
html[data-brand="convero"] body.dark img[data-brand-logo] { filter:brightness(0) invert(1); }
button, input, select, textarea { font: inherit; }
input[type=checkbox], input[type=radio] { accent-color:var(--accent); }
select option, select optgroup { background:var(--bg-card); color:var(--text); }
::selection { background:var(--accent-bg); color:var(--text); }
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
  box-shadow:inset 0 0 0 1000px var(--bg-input);
  -webkit-text-fill-color:var(--text);
  caret-color:var(--text);
}

.header {
  position: sticky; top: 0; z-index: var(--z-topbar);
  height: 56px; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-sidebar); border-bottom: 1px solid var(--border);
}
.header-logo { display:block; width:auto; height:34px; }
.auth-logo { display:block; width:240px; max-width:80%; height:auto; margin:0 auto 28px; }
.header-user { display:flex; align-items:center; gap:16px; color:var(--text-muted); font-size:14px; }
.logout-btn { color:var(--text-muted); cursor:pointer; font-size:13px; }
.logout-btn:hover { color:var(--text); }
.main { max-width:1100px; margin:0 auto; padding:24px 16px; }
.page-title { margin-bottom:24px; color:var(--text); font-size:22px; font-weight:700; }
.back-link, .call-link { color:var(--accent); cursor:pointer; font-size:14px; font-weight:500; }
.back-link { display:inline-block; margin-bottom:16px; }
.back-link:hover, .call-link:hover { text-decoration:underline; }
.stats-row { display:flex; flex-wrap:wrap; gap:16px; margin-bottom:24px; }
.stat-card {
  flex:1; min-width:160px; padding:20px 24px;
  background:var(--bg-card); border:1px solid var(--border);
  border-radius:var(--radius); box-shadow:var(--shadow);
}
.stat-label { margin-bottom:6px; color:var(--text-muted); font-size:13px; }
.stat-value { color:var(--text); font-size:28px; font-weight:700; }
.stat-value.accent { color:var(--accent); }
.section {
  margin-bottom:24px; overflow:hidden;
  background:var(--bg-card); border:1px solid var(--border);
  border-radius:var(--radius); box-shadow:var(--shadow);
}
.section-header {
  display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px;
  padding:16px 20px; border-bottom:1px solid var(--border);
}
.section-title { color:var(--text); font-size:16px; font-weight:600; }
.section-body { padding:20px; }

.btn, .btn-primary, .btn-secondary, .btn-danger, .theme-fab, .theme-toggle, .agr-icon-btn {
  border-radius:var(--radius-sm); cursor:pointer;
  transition:filter .15s ease, background-color .15s ease, border-color .15s ease, color .15s ease, transform .08s ease;
}
.btn, .btn-primary, .btn-secondary, .btn-danger {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  white-space:nowrap;
  line-height:1;
}
.btn svg, .btn-primary svg, .btn-secondary svg, .btn-danger svg {
  width:16px;
  height:16px;
  flex:0 0 auto;
}
.theme-toggle {
  padding:6px 12px; border:1px solid var(--border);
  background:var(--bg-input); color:var(--text); font-size:13px;
}
.theme-toggle:hover:not(:disabled) { border-color:var(--accent); color:var(--accent); }
.btn-primary {
  padding:9px 18px; border:0;
  background:var(--brand-gradient); color:var(--text-invert);
  font-size:14px; font-weight:600;
}
.btn-secondary {
  padding:8px 14px; border:1px solid var(--border);
  background:var(--bg-input); color:var(--text); font-size:13px;
}
.btn-danger {
  padding:8px 14px; border:1px solid transparent;
  background:var(--danger-bg); color:var(--danger); font-size:13px;
}
.btn-primary:hover:not(:disabled) { filter:brightness(1.08); }
.btn-secondary:hover:not(:disabled) { border-color:var(--border-strong); background:var(--bg-hover); }
.btn-danger:hover:not(:disabled) { filter:brightness(1.08); }
.btn:active:not(:disabled), .btn-primary:active:not(:disabled), .btn-secondary:active:not(:disabled),
.btn-danger:active:not(:disabled), .theme-fab:active:not(:disabled), .theme-toggle:active:not(:disabled),
.agr-icon-btn:active:not(:disabled) { transform:translateY(1px); }
.btn:focus-visible, .btn-primary:focus-visible, .btn-secondary:focus-visible, .btn-danger:focus-visible,
.theme-fab:focus-visible, .theme-toggle:focus-visible, .agr-icon-btn:focus-visible,
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline:2px solid var(--accent); outline-offset:2px;
}
.btn:disabled, .btn-primary:disabled, .btn-secondary:disabled, .btn-danger:disabled,
.theme-fab:disabled, .theme-toggle:disabled, .agr-icon-btn:disabled {
  opacity:.45; cursor:not-allowed; filter:none; transform:none;
}

table { width:100%; border-collapse:collapse; }
th {
  padding:10px 16px; border-bottom:1px solid var(--border);
  color:var(--text-muted); text-align:left; font-size:12px; font-weight:600;
  letter-spacing:.5px; text-transform:uppercase;
}
td { padding:14px 16px; border-bottom:1px solid var(--border); color:var(--text); font-size:14px; vertical-align:middle; }
tr:last-child td { border-bottom:0; }
tr:hover td { background:var(--bg-hover); }
.badge, .agr-badge { display:inline-block; padding:3px 10px; border-radius:20px; font-size:12px; font-weight:600; white-space:nowrap; }
.badge-done, .agr-status-active { background:var(--success-bg); color:var(--success); }
.badge-processing, .score-mid, .skill-bar.mid, .badge-orange { background:var(--warning-bg); color:var(--warning); }
.badge-pending, .agr-status-superseded { background:var(--neutral-bg); color:var(--neutral); }
.badge-error, .agr-status-overdue { background:var(--danger-bg); color:var(--danger); }
.score-high { color:var(--success); font-weight:700; }
.score-mid { background:transparent; font-weight:700; }
.score-low { color:var(--danger); font-weight:700; }
.empty { padding:48px; color:var(--text-muted); text-align:center; }
.skills-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:16px; padding:20px; }
.skill-card { padding:16px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--bg-card); }
.skill-name { margin-bottom:8px; color:var(--text-muted); font-size:13px; letter-spacing:.5px; text-transform:uppercase; }
.skill-score { margin-bottom:6px; font-size:26px; font-weight:700; }
.skill-bar-bg { height:6px; margin-bottom:10px; background:var(--neutral-bg); border-radius:4px; }
.skill-bar { height:6px; background:var(--accent); border-radius:4px; }
.skill-bar.high { background:var(--success); }
.skill-bar.low { background:var(--danger); }
.skill-comment { margin-bottom:8px; color:var(--text-muted); font-size:13px; line-height:1.5; }
.skill-rec { padding:8px 10px; color:var(--info); background:var(--info-bg); border-radius:6px; font-size:12px; }
.info-row { display:flex; padding:12px 20px; border-bottom:1px solid var(--border); font-size:14px; }
.info-row:last-child { border-bottom:0; }
.info-label { min-width:200px; color:var(--text-muted); font-weight:500; }
.info-value { flex:1; color:var(--text); }
.processing-block { padding:60px 20px; text-align:center; }
.processing-icon { margin-bottom:16px; font-size:48px; animation:pulse 1.5s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.5} }
.processing-text { margin-bottom:8px; color:var(--text); font-size:18px; font-weight:600; }
.processing-sub { color:var(--text-muted); font-size:14px; }

.modal-bg, .modal-overlay {
  position:fixed; inset:0; z-index:var(--z-modal);
  align-items:center; justify-content:center;
  background:rgba(0,0,0,.55);
}
.modal-bg { display:none; }
.modal-bg.open { display:flex; }
.modal {
  width:100%; max-width:520px; max-height:90vh; overflow-y:auto; padding:32px;
  background:var(--bg-card); color:var(--text);
  border:1px solid var(--border); border-radius:12px; box-shadow:var(--shadow-lg);
}
.modal-title { margin-bottom:20px; font-size:18px; font-weight:700; }
.form-group { margin-bottom:16px; }
label { display:block; margin-bottom:6px; color:var(--text-muted); font-size:13px; font-weight:500; }
input[type=text], input[type=email], input[type=password], input[type=number], textarea, select {
  width:100%; padding:10px 12px; border:1.5px solid var(--border-strong);
  border-radius:var(--radius-sm); outline:0; background:var(--bg-input); color:var(--text);
  font-family:inherit; font-size:14px;
}
input:focus, textarea:focus, select:focus { border-color:var(--accent); }
input::placeholder, textarea::placeholder { color:var(--text-muted); opacity:.8; }
textarea { min-height:120px; resize:vertical; }
.utabs { display:flex; margin-bottom:16px; border-bottom:2px solid var(--border); }
.utab { padding:8px 16px; color:var(--text-muted); cursor:pointer; font-size:14px; font-weight:500; }
.utab.active { margin-bottom:-2px; color:var(--accent); border-bottom:2px solid var(--accent); }
.upanel { display:none; }
.upanel.active { display:block; }
.modal-footer { display:flex; justify-content:flex-end; gap:12px; margin-top:20px; }
.err { display:none; margin-top:8px; color:var(--danger); font-size:13px; }
.file-label {
  position:relative; display:block; padding:24px 12px; border:1.5px dashed var(--border-strong);
  border-radius:var(--radius-sm); color:var(--text-muted); cursor:pointer; text-align:center; font-size:14px;
}
.file-label:hover { border-color:var(--accent); }
.file-label input[type=file] { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; }

/* Agreements: same shell dimensions and interaction model as the main dashboard */
body.agreements-page { display:flex; min-height:100vh; background:var(--bg); color:var(--text); font-family:var(--font); }
.agr-topbar {
  position:fixed; inset:0 0 auto; z-index:var(--z-topbar); height:var(--topbar-h); padding:0 20px;
  display:flex; align-items:center; justify-content:space-between;
  background:var(--bg-sidebar); border-bottom:1px solid var(--border);
}
.agr-topbar-logo { width:auto; height:30px; max-width:150px; object-fit:contain; }
.agr-topbar-actions { display:flex; align-items:center; gap:8px; }
.agr-topbar-actions .btn-primary { padding-top:10px; padding-bottom:10px; }
.agr-icon-btn {
  width:36px; height:36px; padding:0; border:0;
  display:grid; place-items:center; background:transparent; color:var(--text-muted);
}
.agr-icon-btn:hover:not(:disabled) { background:var(--accent-bg); color:var(--accent); }
.agr-icon-btn svg { width:18px; height:18px; }
.agr-sidebar {
  position:fixed; top:var(--topbar-h); bottom:0; left:0; z-index:var(--z-sidebar);
  width:var(--sidebar-w); display:flex; flex-direction:column;
  background:var(--bg-sidebar); border-right:1px solid var(--border);
}
.agr-nav { flex:1; padding:20px 0; }
.agr-nav-item {
  display:flex; align-items:center; gap:10px; padding:10px 16px;
  border-left:3px solid transparent; color:var(--text-muted);
  cursor:pointer; font-size:13.5px; font-weight:500;
}
.agr-nav-item:hover, .agr-nav-item.active { background:var(--accent-bg); color:var(--accent); }
.agr-nav-item.active { border-left-color:var(--accent); font-weight:600; }
.agr-nav-item svg { width:18px; height:18px; }
.agr-user-menu {
  position:absolute; right:12px; bottom:70px; left:12px; z-index:var(--z-dropdown);
  display:none; overflow:hidden; padding:6px;
  background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius-sm); box-shadow:var(--shadow-lg);
}
.agr-user-menu.open { display:block; }
.agr-user-menu-item { display:flex; align-items:center; gap:9px; padding:9px 10px; border-radius:6px; color:var(--text); cursor:pointer; font-size:13px; }
.agr-user-menu-item:hover { background:var(--bg-hover); color:var(--accent); }
.agr-user-menu-item.danger { color:var(--danger); }
.agr-user-menu-item svg { width:16px; height:16px; }
.agr-user {
  display:flex; align-items:center; gap:10px; padding:14px 16px;
  border-top:1px solid var(--border); cursor:pointer;
}
.agr-user:hover { background:var(--bg-hover); }
.agr-avatar {
  width:34px; height:34px; flex:0 0 34px; display:grid; place-items:center;
  background:var(--brand-gradient); color:var(--text-invert); border-radius:50%; font-size:12px; font-weight:700;
}
.agr-user-copy { min-width:0; flex:1; }
.agr-user-name { overflow:hidden; color:var(--text); font-size:13px; font-weight:700; text-overflow:ellipsis; white-space:nowrap; }
.agr-user-role { color:var(--text-muted); font-size:11px; }
.agr-user-chevron { width:16px; color:var(--text-muted); }
.agr-content { width:calc(100% - var(--sidebar-w)); margin-left:var(--sidebar-w); padding:calc(var(--topbar-h) + 28px) 32px 40px; }
.agr-page-title { margin-bottom:24px; color:var(--text); font-size:24px; font-weight:800; }
.agr-stats { display:grid; grid-template-columns:repeat(4,minmax(150px,1fr)); gap:16px; margin-bottom:24px; }
.agr-stat { padding:20px 24px; background:var(--bg-card); border:1px solid var(--border); border-radius:12px; box-shadow:var(--shadow); }
.agr-stat-label { margin-bottom:7px; color:var(--text-muted); font-size:13px; }
.agr-stat-value { color:var(--text); font-size:29px; font-weight:800; }
.agr-stat-value.primary { color:var(--accent); }
.agr-stat-value.danger { color:var(--danger); }
.agr-section { overflow:hidden; background:var(--bg-card); border:1px solid var(--border); border-radius:12px; box-shadow:var(--shadow); }
.agr-section-head { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; padding:16px 20px; border-bottom:1px solid var(--border); }
.agr-section-title { color:var(--text); font-size:17px; font-weight:800; }
.agr-filters { display:flex; flex-wrap:wrap; align-items:center; gap:9px; }
.agr-filter { width:auto !important; min-width:150px; padding:8px 10px; }
.agr-filter.search { min-width:230px; }
.agr-check { display:flex; align-items:center; gap:6px; margin:0; color:var(--text-muted); font-size:13px; white-space:nowrap; }
.agr-check input { width:auto; }
.agr-table-wrap { overflow-x:auto; }
.agr-table { min-width:920px; }
.agr-table th { font-size:11px; font-weight:700; }
.agr-table td { font-size:13px; }
.agr-client-row td { background:var(--bg-hover); font-weight:700; cursor:pointer; }
.agr-client-sub { margin-left:8px; color:var(--text-muted); font-size:11px; font-weight:400; }
.agr-chev { display:inline-block; width:18px; color:var(--text-muted); transition:transform .15s; }
.agr-client-row.open .agr-chev { transform:rotate(90deg); }
.agr-history td { color:var(--text-muted); opacity:.78; }
.agr-call-link { color:var(--accent); font-weight:600; text-decoration:none; }
.agr-call-link:hover { text-decoration:underline; }
.agr-type-meeting { background:var(--info-bg); color:var(--info); }
.agr-type-call { background:var(--warning-bg); color:var(--warning); }
.agr-type-send { background:var(--purple-bg); color:var(--purple); }
.agr-type-other { background:var(--neutral-bg); color:var(--neutral); }
.agr-due-today { color:var(--warning); font-weight:700; }
.agr-empty, .agr-loading { padding:52px 20px !important; color:var(--text-muted) !important; text-align:center; }
.agr-call-summary { margin-bottom:18px; overflow:hidden; background:var(--bg-card); border:1px solid var(--border); border-radius:12px; box-shadow:var(--shadow); }
.agr-call-title { display:flex; align-items:center; gap:8px; padding:16px 20px; border-bottom:1px solid var(--border); font-size:16px; font-weight:800; }
.agr-call-title svg { width:17px; height:17px; color:var(--accent); }
.agr-call-summary-text { padding:18px 20px; font-size:14px; line-height:1.7; }
.agr-call-subtitle { padding:0 20px 10px; color:var(--text-muted); font-size:12px; font-weight:700; letter-spacing:.45px; text-transform:uppercase; }
.agr-call-list { border-top:1px solid var(--border); }
.agr-call-item { display:grid; grid-template-columns:100px minmax(180px,1fr) 130px 105px; gap:12px; align-items:center; padding:13px 20px; border-bottom:1px solid var(--border); font-size:13px; }
.agr-call-item:last-child { border-bottom:0; }
.agr-call-description { font-weight:500; }
.agr-call-due, .agr-call-note { color:var(--text-muted); }
.agr-call-note { display:block; margin-top:4px; font-size:11px; font-weight:400; }
.agr-call-note a { color:var(--accent); text-decoration:none; }
.agr-call-note a:hover { text-decoration:underline; }

@media(max-width:1050px) {
  .agr-stats { grid-template-columns:repeat(2,1fr); }
  .agr-section-head { align-items:flex-start; flex-direction:column; }
}
@media(max-width:480px) {
  .agr-topbar { padding:0 12px; }
  .agr-topbar-logo { height:26px; max-width:100px; }
  .agr-topbar-actions { gap:6px; }
  .agr-topbar-actions .btn-primary { padding-right:10px; padding-left:10px; }
  .agr-topbar-actions .btn-primary .btn-label { display:none; }
}
@media(max-width:760px) {
  .agr-sidebar { display:none; }
  .agr-content { width:100%; margin-left:0; padding:calc(var(--topbar-h) + 20px) 16px 28px; }
  .agr-stats { grid-template-columns:1fr 1fr; gap:10px; }
  .agr-stat { padding:16px; }
  .agr-filter, .agr-filter.search { min-width:100%; flex:1; }
  .agr-call-item { grid-template-columns:1fr; gap:8px; }
  .main { padding:18px 12px; }
}
.telegram-binding-qr {
  display:block;
  width:220px;
  height:220px;
  max-width:100%;
  margin:0 auto 18px;
  padding:8px;
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
}
.modal-header {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:16px;
}
.modal-header .modal-title { margin-bottom:0; }
.modal-close {
  flex:0 0 auto;
  width:32px;
  height:32px;
  border:0;
  border-radius:8px;
  background:transparent;
  color:var(--text-muted);
  font-size:24px;
  line-height:1;
  cursor:pointer;
}
.modal-close:hover { background:var(--surface-2); color:var(--text); }
