/* =====================================================================
   RACSE — каркас кабинета и дизайн-токены.
   Подключается после semantic.min.css и main.css: перекрашивает Semantic UI
   под токены, а не заменяет его (main.js завязан на компоненты Semantic).
   ===================================================================== */

:root
    {
    /* Светлая тема: бирюзовый акцент на холодном серо-голубом фоне */
    --bg:            #F3F6F7;
    --surface:       #FFFFFF;
    --surface-2:     #F7FAFA;
    --surface-3:     #EDF2F3;
    --text:          #13232A;
    --text-2:        #3D525B;
    --muted:         #6B7F88;
    --border:        #E2E9EB;
    --border-strong: #CFDADD;

    --primary:       #0D8A8C;
    --primary-600:   #0A7375;
    --primary-50:    #E4F4F3;
    --primary-100:   #C5E8E6;
    --primary-rgb:   13, 138, 140;
    --grad:          linear-gradient(135deg, #0A5D6B 0%, #0D8A8C 55%, #17B3A3 100%);
    --logo-a:        #0A5D6B;
    --logo-b:        #17B3A3;

    --green:         #2F9E44;
    --green-50:      #EAF6EC;
    --orange:        #E8590C;
    --orange-50:     #FFF1E6;
    --red:           #E03131;
    --red-50:        #FDECEC;
    --blue:          #2F6FED;
    --blue-50:       #EAF1FF;

    --radius:        14px;
    --radius-sm:     10px;
    --shadow:        0 1px 2px rgba(19, 35, 42, .04), 0 2px 8px rgba(19, 35, 42, .05);
    --shadow-lg:     0 10px 30px rgba(var(--primary-rgb), .18);

    --sidebar-w:     252px;
    --topbar-h:      60px;

    --font:          'Inter', -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --mono:          'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    }

html.theme_dark
    {
    --bg:            #0F0E17;
    --surface:       #191823;
    --surface-2:     #1F1E2B;
    --surface-3:     #262434;
    --text:          #ECEBF5;
    --text-2:        #C5C3D6;
    --muted:         #9593AD;
    --border:        #2B2939;
    --primary:       #6D3DF5;
    --primary-600:   #5B2EE5;
    --primary-rgb:   109, 61, 245;
    --grad:          linear-gradient(135deg, #4B22C9 0%, #6D3DF5 55%, #8B5CFF 100%);
    --logo-a:        #4B22C9;
    --logo-b:        #8B5CFF;
    --green:         #16A36A;
    --border-strong: #3A3850;
    --primary-50:    #2A2045;
    --primary-100:   #382A63;
    --green-50:      #12301F;
    --orange-50:     #3A2412;
    --red-50:        #3A1717;
    --blue-50:       #16264A;
    --shadow:        0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
    }


/* ---------------------------------------------------------------------
   База
   --------------------------------------------------------------------- */
html, body,
body.app_body, body.auth_body
    {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    }

body.app_body h1, body.app_body h2, body.app_body h3, body.app_body h4, body.app_body h5,
body.app_body .ui.header,
body.app_body .ui.button,
body.app_body .ui.menu,
body.app_body .ui.input > input,
body.app_body .ui.form input, body.app_body .ui.form select, body.app_body .ui.form textarea,
body.app_body .ui.dropdown, body.app_body .ui.dropdown .menu > .item,
body.app_body .ui.table, body.app_body .ui.message, body.app_body .ui.accordion .title,
body.app_body .ui.card, body.app_body .ui.cards > .card,
body.auth_body .ui.button, body.auth_body .ui.input > input, body.auth_body .ui.header
    {
    font-family: var(--font);
    }

.mono { font-family: var(--mono); }

a { color: var(--primary); }
a:hover { color: var(--primary-600); }

.main_wrap { min-height: 100vh; }


/* ---------------------------------------------------------------------
   Каркас
   --------------------------------------------------------------------- */
.app { min-height: 100vh; }

.app_sidebar
    {
    position: fixed;
    z-index: 900;
    top: 0; bottom: 0; left: 0;
    width: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    transition: transform .2s ease;
    }

.app_main
    {
    margin-left: var(--sidebar-w);
    padding-top: var(--topbar-h);
    min-width: 0;
    transition: margin-left .2s ease;
    }

body.sidebar_collapsed .app_sidebar { transform: translateX(-100%); }
body.sidebar_collapsed .app_main    { margin-left: 0; }
body.sidebar_collapsed .app_topbar  { left: 0; }

.app_sidebar_backdrop { display: none; }

@media (max-width: 1023px)
    {
    .app_sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
    .app_main    { margin-left: 0; }
    .app_topbar  { left: 0; }
    body.sidebar_open .app_sidebar { transform: none; }
    body.sidebar_open .app_sidebar_backdrop
        {
        display: block;
        position: fixed; inset: 0;
        z-index: 899;
        background: rgba(15, 14, 23, .4);
        }
    }


/* Логотип */
.app_logo
    {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 22px 18px;
    color: var(--text) !important;
    text-decoration: none;
    }
.app_logo_mark { display: inline-flex; }
.app_logo_text { font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
.app_logo_text b { color: var(--primary); font-weight: 700; }


/* Навигация */
.app_nav { padding: 4px 12px 16px; flex: 1; }

.side_group_title
    {
    margin: 18px 12px 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    }

.side_item
    {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 1px 0;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-2) !important;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    user-select: none;
    }
.side_item > i.icon { margin: 0; width: 18px; color: var(--muted); font-size: 15px; }
.side_item .side_svg { width: 18px; flex: 0 0 18px; }
.side_item:hover { background: var(--surface-3); color: var(--text) !important; }
.side_item.active { background: var(--primary-50); color: var(--primary) !important; }
.side_item.active > i.icon { color: var(--primary); }
.side_item.disabled { opacity: .45; cursor: default; }
.side_item.disabled:hover { background: none; }

.side_parent::after
    {
    content: '';
    margin-left: auto;
    width: 7px; height: 7px;
    border-right: 1.5px solid var(--muted);
    border-bottom: 1.5px solid var(--muted);
    transform: rotate(45deg);
    transition: transform .15s;
    }
.side_parent.open::after { transform: rotate(-135deg); }

.side_sub { margin: 2px 0 6px 21px; padding-left: 12px; border-left: 1px solid var(--border); }
.side_sub a
    {
    display: block;
    padding: 6px 10px;
    border-radius: 8px;
    color: var(--text-2);
    font-size: 13px;
    }
.side_sub a:hover  { color: var(--text); background: var(--surface-3); }
.side_sub a.active { color: var(--primary); font-weight: 600; box-shadow: -13px 0 0 -11px var(--primary); }


/* Переключатель проекта */
.ui.dropdown.side_project_switch
    {
    display: flex !important;
    align-items: center;
    gap: 10px;
    margin: 0 0 6px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text);
    font-weight: 600;
    }
.side_project_switch > .text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side_project_switch > .dropdown.icon { margin: 0 !important; color: var(--muted); }
.side_project_avatar
    {
    flex: 0 0 26px;
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 8px;
    background: var(--grad);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    }
.ui.dropdown.side_project_switch .menu { width: 100%; min-width: 220px; }
.ui.dropdown.side_project_switch .menu > .search.input { margin: 8px; }
.ui.dropdown.side_project_switch .scrolling.menu { max-height: 320px; }


/* Карточка «Ваш план» */
.side_plan
    {
    margin: 0 14px 16px;
    padding: 14px 14px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    }
.side_plan_head { display: flex; justify-content: space-between; align-items: baseline; }
.side_plan_caption { color: var(--muted); font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; }
.side_plan_name { color: var(--primary); font-weight: 700; font-size: 15px; }
.side_plan_meta { margin: 4px 0 10px; color: var(--muted); font-size: 12px; }
.side_plan_meta.state_grace, .side_plan_meta.state_expired { color: var(--red); }
.side_plan_bar { margin-bottom: 9px; }
.side_plan_bar_row { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-2); margin-bottom: 5px; }
.side_plan_bar_row .mono { color: var(--muted); font-size: 11.5px; }
.side_plan_bar_row .mono b { color: var(--text); }
.side_progress { height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.side_progress > div { height: 100%; border-radius: 4px; background: var(--primary); }
.side_progress > div.danger { background: var(--red); }


/* Топбар */
.app_topbar
    {
    position: fixed;
    z-index: 800;
    top: 0;
    left: var(--sidebar-w);
    right: 0;
    transition: left .2s ease;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 24px;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    }

.app_icon_btn
    {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--muted) !important;
    cursor: pointer;
    text-decoration: none;
    }
.app_icon_btn > i.icon { margin: 0; font-size: 15px; }
.app_icon_btn:hover { background: var(--surface-3); color: var(--text) !important; }
.app_icon_btn.active { background: var(--primary-50); color: var(--primary) !important; }
.app_icon_btn.danger:hover { background: var(--red-50); color: var(--red) !important; }
.app_icon_btn.loading { opacity: .5; pointer-events: none; }

.app_crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--muted); font-size: 13.5px; }
.app_crumbs a { color: var(--muted); }
.app_crumbs a:hover { color: var(--text); }
.app_crumbs .sep { color: var(--border-strong); }
.app_crumbs .current
    {
    padding: 4px 10px;
    border-radius: 8px;
    background: var(--surface-3);
    color: var(--text);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    }

.app_topbar_right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.app_topbar_divider { width: 1px; height: 24px; background: var(--border); }

.ui.dropdown.app_user_menu { display: flex; align-items: center; gap: 4px; }
.ui.dropdown.app_user_menu > .dropdown.icon { margin: 0 !important; color: var(--muted); }
.ui.dropdown.app_user_menu > .menu { left: auto !important; right: 0; margin-top: 8px !important; min-width: 220px; }
.app_user_menu_head { text-transform: none !important; }
.app_user_menu_name { color: var(--text); font-size: 14px; font-weight: 600; }
.app_user_menu_mail { color: var(--muted); font-size: 12px; font-weight: 400; margin-top: 2px; }

.app_avatar
    {
    width: 34px; height: 34px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF8A3D 0%, #F0437B 100%);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    }


/* Контент */
.app_content { padding: 26px 28px 40px; }
@media (max-width: 767px) { .app_content { padding: 18px 14px 30px; } .app_topbar { padding: 0 12px; } }


/* ---------------------------------------------------------------------
   Компоненты
   --------------------------------------------------------------------- */

/* Заголовок страницы */
.app_page_header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.app_page_header h1
    {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 6px;
    color: var(--text);
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -.03em;
    }
.app_page_header p { margin: 0; color: var(--muted); font-size: 14.5px; }
.app_page_header_actions { display: flex; gap: 10px; }

.app_title_badge
    {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px;
    border-radius: 8px;
    background: var(--primary-50);
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0;
    }
.app_title_badge i.icon { margin: 0; font-size: 12px; }

/* Кнопки */
.app_btn
    {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
    transition: transform .05s, box-shadow .15s, background .15s;
    }
.app_btn i.icon { margin: 0; height: auto; }
.app_btn:active { transform: translateY(1px); }
.app_btn[disabled], .app_btn.loading { opacity: .55; pointer-events: none; }

.app_btn_primary { background: var(--grad); color: #fff !important; box-shadow: 0 6px 16px rgba(var(--primary-rgb), .28); }
.app_btn_primary:hover { box-shadow: 0 8px 22px rgba(var(--primary-rgb), .38); }
.app_btn_light { background: var(--surface); border-color: var(--border-strong); color: var(--text) !important; }
.app_btn_light:hover { background: var(--surface-3); }
.app_btn_ghost { background: transparent; color: var(--text-2) !important; }
.app_btn_ghost:hover { background: var(--surface-3); }

/* Карточки */
.app_card
    {
    margin-bottom: 18px;
    padding: 20px 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    }
.app_card_head { display: flex; gap: 14px; align-items: flex-start; padding-bottom: 16px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.app_card_head h3 { margin: 0 0 3px; color: var(--text); font-size: 16px; font-weight: 700; }
.app_card_head p { margin: 0; color: var(--muted); font-size: 13.5px; }
.app_card_icon
    {
    flex: 0 0 38px;
    width: 38px; height: 38px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px;
    background: var(--primary-50);
    color: var(--primary);
    }
.app_card_icon i.icon { margin: 0; font-size: 16px; }

/* KPI */
.app_kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
@media (max-width: 1199px) { .app_kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575px)  { .app_kpis { grid-template-columns: 1fr; } }

.app_kpi
    {
    position: relative;
    overflow: hidden;
    padding: 20px 20px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    }
.app_kpi_label { color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.app_kpi_value { margin: 10px 0 8px; color: var(--text); font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.app_kpi_note { color: var(--muted); font-size: 12.5px; }
.app_kpi_note.up { color: var(--green); }
.app_kpi_note i.icon { margin: 0 2px 0 0; font-size: 11px; }

.app_kpi_accent { border: 0; background: var(--grad); box-shadow: var(--shadow-lg); }
.app_kpi_accent::after
    {
    content: '';
    position: absolute;
    top: -60px; right: -40px;
    width: 180px; height: 180px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    }
.app_kpi_accent .app_kpi_label,
.app_kpi_accent .app_kpi_note  { color: rgba(255, 255, 255, .85); }
.app_kpi_accent .app_kpi_value { color: #fff; }

/* Вкладки-пилюли */
.app_toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.app_tabs
    {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    }
.app_tab
    {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 7px 14px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text-2);
    font-family: var(--font);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    }
.app_tab:hover { background: var(--surface-3); }
.app_tab.active { background: var(--primary-50); color: var(--primary); font-weight: 600; }
.app_tab_count
    {
    min-width: 20px;
    padding: 1px 6px;
    border-radius: 10px;
    background: var(--surface-3);
    color: var(--muted);
    font-size: 11.5px;
    text-align: center;
    }
.app_tab.active .app_tab_count { background: var(--primary); color: #fff; }

.app_view_switch { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; }
.app_view_switch span { margin-right: 6px; }

/* Поиск */
.app_search_card { padding: 12px; }
.app_search { position: relative; }
.app_search > i.icon { position: absolute; left: 12px; top: 10px; color: var(--muted); }
.app_search input
    {
    width: 100%;
    height: 40px;
    padding: 0 12px 0 36px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    outline: none;
    }
.app_search input:focus { border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 3px var(--primary-50); }

/* Таблица */
.app_table_card { padding: 0; overflow: hidden; }
.app_table_card[data-view="table"] { overflow-x: auto; }
.app_table { width: 100%; border-collapse: collapse; }
.app_table th
    {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .07em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
    }
.app_table th.sortable { cursor: pointer; user-select: none; }
.app_table th.sortable i.icon { margin: 0 0 0 2px; opacity: .35; font-size: 11px; }
.app_table th.sorted { color: var(--text); }
.app_table th.sorted i.icon { opacity: 1; color: var(--primary); }
.app_table th.sorted.asc  i.icon::before { content: '\f0de'; }
.app_table th.sorted.desc i.icon::before { content: '\f0dd'; }
.app_table td { padding: 14px 16px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
.app_table tbody tr:hover td { background: var(--surface-2); }
.app_table tbody tr:last-child td { border-bottom: 0; }
.app_table .num   { text-align: right; }
.app_table .right { text-align: right; }
.app_table .nowrap { white-space: nowrap; }
.cell_main { font-weight: 600; }
.cell_sub  { color: var(--muted); font-size: 11.5px; margin-top: 2px; }

.app_table_footer
    {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 13px;
    }
.app_pager { margin-left: auto; display: flex; gap: 4px; }
.app_page_btn
    {
    min-width: 32px; height: 32px;
    padding: 0 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-2);
    font-family: var(--font);
    cursor: pointer;
    }
.app_page_btn i.icon { margin: 0; }
.app_page_btn:hover:not([disabled]) { background: var(--surface-3); }
.app_page_btn.active { background: var(--primary); color: #fff; font-weight: 600; }
.app_page_btn[disabled] { opacity: .35; cursor: default; }
.app_select
    {
    height: 32px;
    padding: 0 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-family: var(--font);
    }
.app_pager:empty + .app_select { margin-left: auto; }

/* Бейджи и статусы */
.app_badge
    {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    vertical-align: middle;
    }
.app_badge i.icon { margin: 0; font-size: 10px; }
.app_badge_violet { background: var(--primary-50); color: var(--primary); }
.app_badge_green  { background: var(--green-50);   color: var(--green); }
.app_badge_gray   { background: var(--surface-3);  color: var(--muted); }

.app_status
    {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    }
.app_status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.app_status_active   { background: var(--green-50);  color: var(--green); }
.app_status_disabled { background: var(--orange-50); color: var(--orange); }
.app_status_archived { background: var(--surface-3); color: var(--muted); }

.logger_dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; vertical-align: middle; }
.logger_ok    { background: var(--green); box-shadow: 0 0 0 3px var(--green-50); }
.logger_stale { background: var(--orange); }
.logger_none  { background: var(--border-strong); }
.logger_wait  { background: var(--primary); animation: app_pulse 1.2s infinite; }
@keyframes app_pulse { 0% { box-shadow: 0 0 0 0 rgba(var(--primary-rgb), .5); } 100% { box-shadow: 0 0 0 8px rgba(var(--primary-rgb), 0); } }

/* Ячейка проекта */
.project_cell { display: flex; align-items: center; gap: 12px; min-width: 240px; }
.project_avatar
    {
    flex: 0 0 36px;
    width: 36px; height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px;
    color: #fff;
    font-weight: 700;
    }
.project_name { color: var(--text) !important; font-weight: 600; font-size: 14.5px; }
.project_name:hover { color: var(--primary) !important; }
.project_domain { margin-top: 3px; color: var(--muted); font-size: 12px; }
.project_domain i.icon { margin: 0 4px 0 0; font-size: 11px; }
.project_row.is_current td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
.project_actions .app_icon_btn { width: 30px; height: 30px; }

/* Список проектов: вид «карточки» (те же строки таблицы) */
#projects_list[data-view="grid"] { padding: 16px; background: transparent; border: 0; box-shadow: none; }
#projects_list[data-view="grid"] thead { display: none; }
#projects_list[data-view="grid"] .app_table,
#projects_list[data-view="grid"] tbody { display: block; }
#projects_list[data-view="grid"] tbody { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
#projects_list[data-view="grid"] tr.project_row
    {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    }
#projects_list[data-view="grid"] tr.project_row[style*="none"] { display: none !important; }
#projects_list[data-view="grid"] td { display: block; padding: 6px 0; border: 0; background: none !important; text-align: left; }
#projects_list[data-view="grid"] td:first-child,
#projects_list[data-view="grid"] td:last-child { grid-column: 1 / -1; }
#projects_list[data-view="grid"] td:first-child { padding-bottom: 12px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
#projects_list[data-view="grid"] td:last-child  { padding-top: 10px; margin-top: 4px; border-top: 1px solid var(--border); }
#projects_list[data-view="grid"] td:nth-child(n+2):nth-child(-n+7)::before
    {
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-family: var(--font);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .07em;
    text-transform: uppercase;
    }
#projects_list[data-view="grid"] td:nth-child(2)::before { content: 'Клики · 7 дн'; }
#projects_list[data-view="grid"] td:nth-child(3)::before { content: 'Последний клик'; }
#projects_list[data-view="grid"] td:nth-child(4)::before { content: 'Баны IP'; }
#projects_list[data-view="grid"] td:nth-child(5)::before { content: 'Google Ads'; }
#projects_list[data-view="grid"] td:nth-child(6)::before { content: 'Статус'; }
#projects_list[data-view="grid"] td:nth-child(7)::before { content: 'Создан'; }
#projects_list[data-view="grid"] .project_cell { min-width: 0; }
#projects_list[data-view="grid"] .app_table_footer { border: 0; padding: 14px 0 0; }

/* Пустые состояния */
.app_empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.app_empty h3 { margin: 14px 0 6px; color: var(--text); font-size: 18px; }
.app_empty p  { margin: 0 0 18px; }
.app_empty_icon
    {
    width: 64px; height: 64px;
    margin: 0 auto;
    display: flex; align-items: center; justify-content: center;
    border-radius: 18px;
    background: var(--primary-50);
    color: var(--primary);
    font-size: 26px;
    }
.app_empty_icon i.icon { margin: 0; }
.app_empty_inline { padding: 30px; }

/* Формы */
.app_form .app_field { margin-bottom: 18px; }
.app_form label { display: block; margin-bottom: 7px; color: var(--text); font-weight: 600; font-size: 13.5px; }
.app_form .req { color: var(--red); }
.app_optional
    {
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 6px;
    background: var(--surface-3);
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 500;
    }
.app_form input[type="text"],
.app_form input[type="email"],
.app_form input[type="password"],
.app_form input[type="tel"],
.app_form input[type="date"],
.app_form input[type="number"]
    {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--text);
    font-family: var(--font);
    font-size: 14.5px;
    outline: none;
    }
.app_form input[type="email"]:focus, .app_form input[type="password"]:focus, .app_form input[type="tel"]:focus,
.app_form input[type="date"]:focus, .app_form input[type="number"]:focus,
.app_form input[type="text"]:focus { border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 3px var(--primary-50); }
.app_hint { margin-top: 6px; color: var(--muted); font-size: 12.5px; }
.app_hint.error { color: var(--red); }

.app_alert { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 18px; padding: 12px 14px; border-radius: 10px; font-size: 13.5px; }
.app_alert i.icon { margin: 0; }
.app_alert_warning { background: var(--orange-50); color: var(--orange); border: 1px solid color-mix(in srgb, var(--orange) 35%, transparent); }
.app_alert_success { background: var(--green-50);  color: var(--green);  border: 1px solid color-mix(in srgb, var(--green) 35%, transparent); }

/* Мастер */
.wizard { max-width: 760px; }
.wizard_steps { display: flex; align-items: center; margin-bottom: 20px; }
.wizard_step { display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.wizard_step_num
    {
    width: 30px; height: 30px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--surface-3);
    color: var(--muted);
    font-size: 13px;
    }
.wizard_step_num i.icon { margin: 0; font-size: 12px; }
.wizard_step.current { color: var(--text); }
.wizard_step.current .wizard_step_num { background: var(--grad); color: #fff; box-shadow: 0 4px 12px rgba(var(--primary-rgb), .35); }
.wizard_step.done .wizard_step_num { background: var(--green-50); color: var(--green); }
.wizard_step_line { flex: 1; height: 2px; margin: 0 14px; border-radius: 2px; background: var(--border); }
.wizard_step_line.done { background: var(--green); }

.wizard_card { padding: 24px 26px; }
.wizard_footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--border); }

.wizard_list { margin: 0; padding: 0; list-style: none; counter-reset: wl; }
.wizard_list > li { position: relative; padding: 0 0 22px 44px; counter-increment: wl; }
.wizard_list > li::before
    {
    content: counter(wl);
    position: absolute; left: 0; top: -2px;
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--primary-50);
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
    }
.wizard_list_title { margin-bottom: 4px; color: var(--text); font-weight: 600; }
.wizard_list_text  { margin-bottom: 10px; color: var(--muted); font-size: 13.5px; }

.code_box
    {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 10px 10px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-2);
    }
.code_box code { flex: 1; overflow-x: auto; color: var(--text); font-family: var(--mono); font-size: 12.5px; white-space: nowrap; }

.wizard_check { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.wizard_check_status { color: var(--muted); font-size: 13.5px; }
.wizard_check_status.success { color: var(--green); font-weight: 600; }

.wizard_benefits { margin: 0 0 12px; padding: 0; list-style: none; }
.wizard_benefits li { display: flex; gap: 10px; padding: 6px 0; color: var(--text-2); }
.wizard_benefits i.icon { margin: 0; color: var(--green); }

/* Уведомления */
#app_toasts { position: fixed; z-index: 2000; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; }
.app_toast
    {
    display: flex; align-items: center; gap: 10px;
    max-width: 420px;
    padding: 12px 16px;
    border-radius: 12px;
    background: var(--text);
    color: var(--surface);
    box-shadow: var(--shadow-lg);
    font-weight: 500;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .25s, transform .25s;
    }
.app_toast.show { opacity: 1; transform: none; }
.app_toast i.icon { margin: 0; }
.app_toast.success i.icon { color: #3DDC97; }
.app_toast.error   i.icon { color: #FF6B6B; }


/* ---------------------------------------------------------------------
   Страница «Аналитика»: существующие блоки main.css в новом каркасе
   --------------------------------------------------------------------- */
.app_body .filter_form { z-index: 50; margin-bottom: 16px; }
.app_body .filter_form > .ui.menu
    {
    flex-wrap: wrap;
    min-height: 56px;
    margin: 0;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    }
.app_body .filter_form > .ui.menu > .item::before { background: var(--border); }
.app_body .filter_form > .ui.menu > .item { color: var(--text-2); }

.app_body .ui.primary.button,
.app_body .ui.primary.buttons .button { background: var(--primary); }
.app_body .ui.primary.button:hover { background: var(--primary-600); }
.app_body .ui.teal.button { background: var(--primary); }
.app_body .ui.teal.button:hover { background: var(--primary-600); }

.app_body .main_content { margin: 0; }
.app_body .full_page_tab
    {
    margin: 0 !important;
    padding: 22px 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    }
.app_body .full_page_tab > .close.icon { top: 14px; right: 14px; color: var(--muted) !important; font-size: 1.4em !important; }
.app_body .full_page_tab > .close.icon:hover { color: var(--text) !important; }
.app_body .full_page_tab table { box-shadow: none; }

.app_body .ui.table { border-color: var(--border); border-radius: var(--radius-sm); }
.app_body .ui.segment { border-color: var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.app_body .ui.basic.segment { box-shadow: none; }
.app_body .ui.styled.accordion { border-radius: var(--radius); box-shadow: var(--shadow); }


/* ---------------------------------------------------------------------
   Тёмная тема для компонентов Semantic UI
   --------------------------------------------------------------------- */
html.theme_dark .ui.table,
html.theme_dark .ui.segment,
html.theme_dark .ui.menu,
html.theme_dark .ui.card, html.theme_dark .ui.cards > .card,
html.theme_dark .ui.styled.accordion, html.theme_dark .ui.styled.accordion .accordion,
html.theme_dark .ui.modal, html.theme_dark .ui.modal > .content, html.theme_dark .ui.modal > .header, html.theme_dark .ui.modal > .actions,
html.theme_dark .full_page_tab,
html.theme_dark .ui.dropdown .menu,
html.theme_dark .ui.selection.dropdown,
html.theme_dark .ui.popup
    {
    background: var(--surface) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
    }
html.theme_dark .ui.table thead th,
html.theme_dark .ui.table tfoot th { background: var(--surface-2) !important; color: var(--text-2) !important; border-color: var(--border) !important; }
html.theme_dark .ui.table td,
html.theme_dark .ui.table tr td { border-color: var(--border) !important; }
html.theme_dark .ui.striped.table > tr:nth-child(2n),
html.theme_dark .ui.striped.table tbody tr:nth-child(2n) { background: rgba(255, 255, 255, .025) !important; }
html.theme_dark .ui.selectable.table tbody tr:hover,
html.theme_dark .ui.table tbody tr td.selectable:hover { background: var(--surface-3) !important; color: var(--text) !important; }

html.theme_dark .ui.header,
html.theme_dark h1, html.theme_dark h2, html.theme_dark h3, html.theme_dark h4,
html.theme_dark .ui.card > .content > .header, html.theme_dark .ui.cards > .card > .content > .header,
html.theme_dark .ui.form .field > label,
html.theme_dark .ui.styled.accordion .title,
html.theme_dark .ui.menu .item,
html.theme_dark .ui.dropdown .menu > .item,
html.theme_dark .ui.checkbox label, html.theme_dark .ui.checkbox + label { color: var(--text) !important; }
html.theme_dark .ui.header .sub.header,
html.theme_dark .ui.card .meta, html.theme_dark .ui.cards > .card .meta,
html.theme_dark .ui.card > .content > .description { color: var(--muted) !important; }

html.theme_dark .ui.dropdown .menu > .item:hover,
html.theme_dark .ui.dropdown .menu .active.item,
html.theme_dark .ui.dropdown .menu .selected.item,
html.theme_dark .ui.menu .dropdown.item:hover,
html.theme_dark .ui.link.menu .item:hover { background: var(--surface-3) !important; color: var(--text) !important; }
html.theme_dark .ui.dropdown .menu > .header { color: var(--muted) !important; }
html.theme_dark .ui.dropdown .menu > .divider { border-color: var(--border) !important; }

html.theme_dark .ui.input > input,
html.theme_dark .ui.form input:not([type]),
html.theme_dark .ui.form input[type="text"],
html.theme_dark .ui.form input[type="password"],
html.theme_dark .ui.form input[type="email"],
html.theme_dark .ui.form input[type="number"],
html.theme_dark .ui.form select,
html.theme_dark .ui.form textarea,
html.theme_dark textarea, html.theme_dark select,
html.theme_dark .ui.selection.dropdown > .text,
html.theme_dark .ui.search.dropdown > input.search
    {
    background: var(--surface-2) !important;
    color: var(--text) !important;
    border-color: var(--border-strong) !important;
    }
html.theme_dark .ui.input > input::placeholder,
html.theme_dark textarea::placeholder { color: var(--muted) !important; }
html.theme_dark .ui.default.dropdown > .text,
html.theme_dark .ui.dropdown > .default.text { color: var(--muted) !important; }

html.theme_dark .ui.button:not(.primary):not(.teal):not(.red):not(.green):not(.blue):not(.orange):not(.basic)
    {
    background: var(--surface-3);
    color: var(--text);
    }
html.theme_dark .ui.basic.button { background: transparent !important; color: var(--text) !important; box-shadow: 0 0 0 1px var(--border-strong) inset !important; }
html.theme_dark .ui.message { background: var(--surface-2); color: var(--text-2); box-shadow: 0 0 0 1px var(--border) inset; }
html.theme_dark .ui.message .header { color: var(--text); }
html.theme_dark .ui.divider:not(.vertical):not(.horizontal) { border-color: var(--border) !important; }
html.theme_dark .ui.inverted.dimmer { background: rgba(15, 14, 23, .7); }
html.theme_dark .ui.calendar .ui.table tr td,
html.theme_dark .ui.calendar .ui.table tr th { background: var(--surface) !important; color: var(--text) !important; }
html.theme_dark .ui.calendar .ui.table tr .link:hover { background: var(--surface-3) !important; }
html.theme_dark .ui.pagination.menu .item { color: var(--text-2) !important; }
html.theme_dark .ui.label { background: var(--surface-3); color: var(--text-2); }
html.theme_dark .ui.grey.text, html.theme_dark .ui.black.text { color: var(--muted) !important; }
html.theme_dark .ui.black.icon, html.theme_dark i.black.icon { color: var(--text-2) !important; }


/* ---------------------------------------------------------------------
   Экран входа / регистрации
   --------------------------------------------------------------------- */
body.auth_body .main_wrap { display: flex; align-items: center; justify-content: center; padding: 24px; }
body.auth_body .ui.segment { border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
body.auth_body .ui.teal.button { background: var(--grad); }
body.auth_body .ui.teal.header { color: var(--primary); }
.project_cell_text .app_badge { margin-left: 6px; }

/* Меню «⋯» строки проекта (позиционируется app.js) */
.row_menu_pop
    {
    position: fixed;
    z-index: 1500;
    min-width: 230px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    }
.row_menu_item
    {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--text) !important;
    font-family: var(--font);
    font-size: 13.5px;
    text-align: left;
    cursor: pointer;
    text-decoration: none;
    }
.row_menu_item i.icon { margin: 0; width: 16px; color: var(--muted); }
.row_menu_item:hover { background: var(--surface-3); }
.row_menu_item.danger, .row_menu_item.danger i.icon { color: var(--red) !important; }
.row_menu_item.danger:hover { background: var(--red-50); }
.row_menu_divider { height: 1px; margin: 5px 4px; background: var(--border); }
.row_menu_btn.active { background: var(--surface-3); color: var(--text) !important; }
#projects_list[data-view="grid"] .project_row.is_current { border-color: var(--primary); }
#projects_list[data-view="grid"] .project_row.is_current td:first-child { box-shadow: none; }

/* Поля дат: медиазапросы main.css считают ширину окна без сайдбара — даём место под «Ноябрь 2, 2026» */
.app_body #rangestart input,
.app_body #rangeend input { width: 152px; padding-right: 8px !important; font-size: 13px; }

/* Аналитика: широкая таблица логов не помещается рядом с сайдбаром — блок растягивается
   по ширине таблицы, страница прокручивается по горизонтали (Semantic прячет overflow-x у body).
   Прокрутка остаётся у окна: на ней завязаны sticky-шапка таблицы и restore_table_scroll(). */
body.app_body { overflow-x: visible; }
.app_page_analytics .main_content { display: table !important; width: 100%; box-sizing: border-box; }
.app_body .result_table thead { top: var(--topbar-h); }

.app_body .main_content
    {
    margin-top: 0 !important;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    }
.app_body .result_table thead { background: var(--surface); }
.app_body #ip_addr_input { width: 124px; }
.app_body .filter_form .ui.clearable.selection.dropdown { min-width: 9.5em; }
.app_body .filter_form .ui.menu > .item { padding-left: 7px; padding-right: 7px; }


/* ---------- Переключатель языка ---------- */
.lang_switch { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface); }
.lang_switch a { padding: 5px 9px; font-size: 12px; font-weight: 600; letter-spacing: .3px; color: var(--muted); line-height: 1.4; }
.lang_switch a + a { border-left: 1px solid var(--border); }
.lang_switch a:hover { color: var(--text); background: var(--bg); }
.lang_switch a.active { color: #fff; background: var(--primary); }
.lang_switch_auth { margin: 0 auto 18px; }


/* ---------- Выпадающий список «Фильтры» в панели аналитики ---------- */
.app_body .filter_form .ui.selection.dropdown.filter_dropdown { width: auto; min-width: 150px; white-space: nowrap; }
.app_body .filter_form #tz_dropdown { width: 156px; min-width: 156px; }
.app_body .filter_form #tz_dropdown > .text { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app_body .filter_form .ui.calendar input { width: 114px; }
.app_body .filter_form .ui.menu > .item > .icon:first-child { margin-right: 6px; }
.app_body .filter_form .quick_dates > .text { white-space: nowrap; }
.ui.selection.dropdown.filter_dropdown > .menu {
    min-width: 100%; width: max-content !important; max-width: none;
    padding: 6px 0; border-radius: 10px !important; box-shadow: var(--shadow-lg);
}
.ui.selection.dropdown.filter_dropdown > .menu > .item {
    display: flex; align-items: center; gap: 10px;
    white-space: nowrap; padding: 10px 16px !important; border-top: 0 !important; font-size: 14px;
}
.ui.selection.dropdown.filter_dropdown > .menu > .item > .icon { width: 16px; margin: 0 !important; text-align: center; flex: none; }
.ui.selection.dropdown.filter_dropdown > .text > .icon { margin-right: 8px; }
/* Иконки-префиксы перед «Фильтрами» и часовым поясом — подписи в полях и так говорят сами за себя;
   без них панель фильтра помещается в одну строку на ширине 1440 px */
.app_body .filter_form .ui.menu > .item > i.filter.icon,
.app_body .filter_form .ui.menu > .item > i.clock.icon { display: none; }
.app_body .filter_form .quick_dates { width: 180px !important; min-width: 180px !important; padding-left: 8px !important; padding-right: 8px !important; white-space: nowrap; }   /* под самую длинную подпись «Последние 180 дней» */
.app_body .filter_form #show_result { padding-left: 18px; padding-right: 18px; }


/* ---------- Карточка пользователя в профиле ---------- */
.profile_card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin: 8px 14px 10px; }
.profile_cover { height: 96px; background: var(--grad); position: relative; overflow: hidden; }
.profile_cover::after { content: ''; position: absolute; right: -60px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: rgba(255,255,255,.08); }
.profile_main { display: flex; align-items: flex-start; gap: 18px; padding: 0 24px; margin-top: -40px; position: relative; }
.profile_avatar { width: 84px; height: 84px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 32px; font-weight: 700; color: #fff; background: linear-gradient(135deg, #FF8A3D, #E8590C); border: 4px solid var(--surface); box-shadow: var(--shadow); }
.profile_ident { padding-top: 50px; min-width: 0; }
.profile_name { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1.25; word-break: break-all; }
.profile_mail { color: var(--muted); font-size: 14px; margin-top: 2px; }
.profile_badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.profile_badges .app_badge .icon { margin-right: 4px; }
.profile_stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 20px 24px 24px; }
.profile_stat { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; }
.profile_stat_label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.profile_stat_value { font-size: 20px; font-weight: 700; color: var(--text); margin-top: 6px; }
.profile_stat_note { font-size: 13px; color: var(--muted); margin-top: 2px; min-height: 18px; }
.profile_stat_note a { color: var(--primary); }
@media (max-width: 900px) { .profile_stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }


/* ---------- Тёмная тема: таблица аналитики, плитки, чипы стран ---------- */
html.theme_dark .ui.statistics .statistic > .value,
html.theme_dark .ui.statistic > .value { color: var(--text); }
html.theme_dark .ui.statistics .statistic > .label,
html.theme_dark .ui.statistic > .label { color: var(--muted) !important; }
html.theme_dark .ui.statistics .grey.statistic > .value { color: #9A98AE !important; }
html.theme_dark .stat_badge { background: rgba(219, 40, 40, .18); color: #FF8A8A; }

html.theme_dark .country_stat_chip { background: var(--surface-3) !important; color: var(--text); border: 1px solid var(--border); }
html.theme_dark .country_stat_chip:hover { border-color: var(--border-strong); }
html.theme_dark .country_stat_chip.country_chip_on { background: var(--primary) !important; border-color: var(--primary); color: #fff; }
html.theme_dark .country_stat_chip .country_ban_all { color: #6E6C82; }
html.theme_dark .country_more_toggle { background: var(--surface-3) !important; color: var(--muted) !important; }

/* Неактивные иконки в ячейках — приглушённые, активные — цветом статуса */
html.theme_dark .result_table .icon { color: #4A485C; }
html.theme_dark .result_table .dv .icon { color: #5AA9F0; }

/* Подсветка строк: полупрозрачные тона вместо светлых заливок */
html.theme_dark .result_table tr.google_ip td { background-color: rgba(33, 186, 69, .13) !important; }
html.theme_dark .result_table tr.google_ip .icon.check,
html.theme_dark .result_table td:hover .icon.check { color: #3DDC6F; }
html.theme_dark .result_table tr.blacklist_ip td { background-color: rgba(219, 40, 40, .17) !important; }
html.theme_dark .result_table tr.blacklist_ip .icon.ban,
html.theme_dark .result_table td:hover .icon.ban { color: #FF5C5C; }
html.theme_dark .result_table tr.blacklist_client_id td { background-color: rgba(255, 255, 255, .07) !important; }
html.theme_dark .result_table tr.blacklist_client_id .icon.user,
html.theme_dark .result_table td:hover .icon.user { color: var(--text); }
html.theme_dark .result_table tr.google_ip:hover td,
html.theme_dark .result_table tr.blacklist_ip:hover td,
html.theme_dark .result_table tr.blacklist_client_id:hover td { filter: brightness(1.15); }

html.theme_dark .result_table .ip_addr_td,
html.theme_dark .result_table:not(.ip_mask_mode) .google_client_id_td { color: #6CB4F5; }

/* Мини-графики: тёмная подложка вместо белой */
html.theme_dark .google_chart { outline-color: var(--border); background: var(--surface-2); }
html.theme_dark .ui.basic.segment { background: transparent !important; border: none !important; }

/* Тёмная тема: пункты выпадающих списков внутри .ui.menu (быстрые даты и т. п.) —
   у Fomantic там своё правило с !important и большей специфичностью */
html.theme_dark .ui.menu .ui.dropdown .menu > .item { color: var(--text-2) !important; background: transparent !important; }
html.theme_dark .ui.menu .ui.dropdown .menu > .item:hover,
html.theme_dark .ui.menu .ui.dropdown .menu > .selected.item,
html.theme_dark .ui.menu .ui.dropdown .menu > .active.item { color: var(--text) !important; background: var(--surface-3) !important; }

/* Настройки в карточке профиля (язык интерфейса) */
.profile_settings { border-top: 1px solid var(--border); padding: 16px 24px 20px; }
.profile_setting { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.profile_setting_title { font-weight: 600; color: var(--text); font-size: 15px; }
.profile_setting_title .icon { color: var(--primary); margin-right: 6px; }
.profile_setting_note { color: var(--muted); font-size: 13px; margin-top: 2px; }
.lang_switch_profile { border-radius: var(--radius-sm); }
.lang_switch_profile a { padding: 8px 16px; font-size: 14px; letter-spacing: 0; }


/* =====================================================================
   Тарифы и оплата
   ===================================================================== */
.app_badge_orange { background: var(--orange-50); color: var(--orange); }
.app_badge_red    { background: var(--red-50);    color: var(--red); }

a.side_plan { display: block; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
a.side_plan:hover { border-color: var(--primary-100); box-shadow: var(--shadow); }

.billing_caption { font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.billing_warn { color: var(--orange); font-weight: 500; }

/* Текущая подписка */
.billing_current { padding: 0; overflow: hidden; }
.billing_current_main { display: flex; justify-content: space-between; gap: 32px; padding: 22px 24px; flex-wrap: wrap; }
.billing_current_name { display: flex; align-items: center; gap: 10px; margin: 6px 0 4px; font-size: 24px; font-weight: 700; color: var(--text); }
.billing_current_meta { color: var(--text-2); font-size: 14px; }
.billing_usage { flex: 0 1 380px; min-width: 260px; display: flex; flex-direction: column; gap: 14px; justify-content: center; }
.billing_usage .side_progress { height: 6px; }
.billing_current_foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px 24px; border-top: 1px solid var(--border); background: var(--surface-2); }
.billing_scheduled { color: var(--text-2); font-size: 13.5px; }
.billing_scheduled .icon { color: var(--primary); }
.billing_scheduled a { margin-left: 8px; color: var(--primary); }

/* Переключатель-тумблер */
.billing_switch { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.billing_switch input { position: absolute; opacity: 0; pointer-events: none; }
.billing_switch_ui { flex: none; position: relative; width: 40px; height: 22px; border-radius: 22px; background: var(--border-strong); transition: background .15s; }
.billing_switch_ui::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: left .15s; }
.billing_switch input:checked + .billing_switch_ui { background: var(--primary); }
.billing_switch input:checked + .billing_switch_ui::after { left: 21px; }
.billing_switch b { display: block; color: var(--text); font-size: 14px; }
.billing_switch small { display: block; color: var(--muted); font-size: 12.5px; }

/* Период */
.billing_period_bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 26px 0 16px; }
.billing_save { margin-left: 4px; padding: 1px 6px; border-radius: 6px; background: var(--green-50); color: var(--green); font-size: 11.5px; font-weight: 700; }
.billing_fx { color: var(--muted); font-size: 13px; }

/* Карточки тарифов */
.billing_plans { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
@media (max-width: 1279px) { .billing_plans { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px)  { .billing_plans { grid-template-columns: 1fr; } }
.billing_show_month .billing_per_year,
.billing_show_year  .billing_per_month { display: none; }

.billing_plan { position: relative; display: flex; flex-direction: column; padding: 22px 20px 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.billing_plan.popular { border: 2px solid var(--primary); box-shadow: var(--shadow-lg); padding: 21px 19px 19px; }
.billing_plan.is_current { background: linear-gradient(180deg, var(--primary-50), var(--surface) 140px); }
.billing_plan_ribbon { position: absolute; top: -11px; right: 18px; padding: 3px 10px; border-radius: 20px; background: var(--grad); color: #fff; font-size: 11.5px; font-weight: 700; letter-spacing: .03em; }
.billing_plan_name { font-size: 18px; font-weight: 700; color: var(--text); }
.billing_plan_desc { min-height: 38px; margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.billing_plan_price { margin: 14px 0 14px; }
.billing_plan_price b { font-size: 34px; font-weight: 700; letter-spacing: -.02em; color: var(--text); }
.billing_plan_price span { margin-left: 4px; color: var(--muted); font-size: 14px; }
.billing_plan_sub { min-height: 18px; color: var(--muted); font-size: 12.5px; }
.billing_btn { width: 100%; }
.billing_plan_feats { list-style: none; margin: 18px 0 0; padding: 16px 0 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 9px; font-size: 13.5px; color: var(--text-2); }
.billing_plan_feats li { display: flex; gap: 8px; align-items: flex-start; line-height: 1.4; }
.billing_plan_feats li .icon { flex: none; margin: 1px 0 0; color: var(--green); font-size: 12px; }
.billing_plan_feats li b { color: var(--text); }
.billing_plan_feats li.off { color: var(--muted); }
.billing_plan_feats li.off .icon { color: var(--border-strong); }

/* Сравнение */
.billing_compare { padding: 0; overflow-x: auto; }
.billing_compare th, .billing_compare td { text-align: center; }
.billing_compare th:first-child, .billing_compare td:first-child { text-align: left; color: var(--text-2); }
.billing_compare th.popular { color: var(--primary); }
.billing_yes { color: var(--green); margin: 0 !important; }
.billing_no { color: var(--muted); }

/* FAQ и безопасность */
.billing_bottom { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1023px) { .billing_bottom { grid-template-columns: 1fr; } }
.billing_faq h3, .billing_safe h3 { margin: 0 0 12px; font-size: 16px; color: var(--text); }
.billing_faq details { border-top: 1px solid var(--border); }
.billing_faq summary { padding: 13px 0; cursor: pointer; font-weight: 600; color: var(--text); list-style: none; display: flex; justify-content: space-between; }
.billing_faq summary::-webkit-details-marker { display: none; }
.billing_faq summary::after { content: '+'; color: var(--muted); font-weight: 400; font-size: 18px; line-height: 1; }
.billing_faq details[open] summary::after { content: '\2212'; }
.billing_faq details p { margin: 0 0 14px; color: var(--text-2); font-size: 13.5px; line-height: 1.6; }
.billing_safe .app_card_icon { margin-bottom: 12px; }
.billing_safe ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; color: var(--text-2); }
.billing_safe li { display: flex; gap: 8px; }
.billing_safe li .icon { flex: none; color: var(--green); margin: 1px 0 0; font-size: 12px; }

/* Оформление */
.checkout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1023px) { .checkout { grid-template-columns: 1fr; } }
.checkout_plan { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin: 8px 0 18px; }
.checkout_plan_name { font-size: 20px; font-weight: 700; color: var(--text); }
.checkout_plan_desc { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.checkout_lines { width: 100%; border-collapse: collapse; }
.checkout_lines td { padding: 13px 0; border-top: 1px solid var(--border); color: var(--text); vertical-align: top; }
.checkout_lines td.mono { text-align: right; white-space: nowrap; font-weight: 600; }
.checkout_note { margin-top: 3px; color: var(--muted); font-size: 12.5px; }
.checkout_credit { color: var(--green) !important; }
.checkout_total td { font-size: 16px; font-weight: 700; }
.checkout_uah td { border-top: 0; padding-top: 0; }
.checkout_uah td.mono { font-size: 22px; color: var(--primary); }
.checkout_check { display: flex; gap: 12px; align-items: flex-start; padding: 14px; margin-bottom: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); cursor: pointer; font-size: 13.5px; line-height: 1.55; color: var(--text-2); }
.checkout_check:hover { border-color: var(--border-strong); }
.checkout_check input { flex: none; width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--primary); }
.checkout_check b { color: var(--text); }
.checkout_check a, .checkout_legal a { color: var(--primary); }
.checkout_btn { width: 100%; height: 48px; margin-top: 6px; font-size: 15px; }
.checkout_btn[disabled] { box-shadow: none; }
.checkout_legal { margin-top: 12px; color: var(--muted); font-size: 12.5px; line-height: 1.5; text-align: center; }

/* Платежи */
.billing_payments td.right, .billing_payments th.right { text-align: right; }

/* Результат оплаты */
.payment_result { max-width: 560px; margin: 40px auto; padding: 40px 32px; text-align: center; }
.payment_result h2 { margin: 16px 0 8px; font-size: 22px; color: var(--text); }
.payment_result p { color: var(--text-2); margin: 0 0 6px; }
.payment_result_note { color: var(--muted) !important; font-size: 13.5px; }
.payment_result_icon { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 50%; background: var(--surface-3); color: var(--muted); font-size: 26px; }
.payment_result_icon .icon { margin: 0; height: auto; }
.payment_result_paid .payment_result_icon    { background: var(--green-50); color: var(--green); }
.payment_result_failed .payment_result_icon,
.payment_result_expired .payment_result_icon { background: var(--red-50); color: var(--red); }
.payment_result_pending .payment_result_icon { background: var(--primary-50); color: var(--primary); }
.payment_result_actions { display: flex; justify-content: center; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.checkout_uah td.mono, .checkout_total td.mono { font-family: var(--font); letter-spacing: -.01em; }
.billing_btn { white-space: normal; text-align: center; line-height: 1.2; }
.billing_amount { font-weight: 600; white-space: nowrap; }
.profile_sub { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 6px 0; }
.profile_sub_actions { display: flex; gap: 10px; flex-wrap: wrap; }
.checkout_lines td.mono { font-family: var(--font); }
.app_body .filter_form .quick_dates { display: inline-flex !important; align-items: center; justify-content: center; text-align: center; }
.app_body .filter_form .quick_dates > .menu { text-align: left; }


/* =====================================================================
   Юридические страницы (/terms, /refund-policy, /privacy, /cookies)
   ===================================================================== */
.legal_body { margin: 0; background: var(--bg); color: var(--text); font-family: 'Inter', system-ui, sans-serif; font-size: 15px; line-height: 1.65; }
.legal_body a { color: var(--primary); text-decoration: none; }
.legal_body a:hover { text-decoration: underline; }
.legal_wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.legal_header { background: var(--surface); border-bottom: 1px solid var(--border); }
.legal_header_in { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.legal_header .app_logo { display: inline-flex; align-items: center; gap: 8px; color: var(--text); padding: 0; }
.legal_header .app_logo:hover { text-decoration: none; }
.legal_header .lang_switch a:hover { text-decoration: none; }
.legal_main { display: grid; grid-template-columns: 240px 1fr; gap: 32px; padding-top: 32px; padding-bottom: 48px; align-items: start; }
.legal_nav { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 2px; }
.legal_nav a { padding: 9px 12px; border-radius: 8px; color: var(--text-2); font-weight: 500; font-size: 14px; line-height: 1.35; }
.legal_nav a:hover { background: var(--surface); text-decoration: none; }
.legal_nav a.active { background: rgba(var(--primary-rgb), .1); color: var(--primary); font-weight: 600; }
.legal_doc { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 40px 48px; min-width: 0; }
.legal_doc h1 { font-size: 30px; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 6px; font-weight: 800; }
.legal_updated { color: var(--muted); font-size: 13px; margin-bottom: 28px; }
.legal_doc h2 { display: flex; align-items: center; gap: 12px; font-size: 19px; line-height: 1.3; margin: 36px 0 12px; font-weight: 700; }
.legal_doc h2 span { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px;
                     background: rgba(var(--primary-rgb), .1); color: var(--primary); font-size: 14px; font-weight: 700; }
.legal_doc p { margin: 0 0 12px; color: var(--text-2); }
.legal_doc p.legal_lead { color: var(--text); }
.legal_doc ul { margin: 0 0 14px; padding-left: 22px; color: var(--text-2); }
.legal_doc li { margin-bottom: 6px; }
.legal_doc b { color: var(--text); font-weight: 600; }
.legal_doc code { font-size: 13px; background: var(--surface-3); padding: 1px 6px; border-radius: 5px; }
.legal_table { width: 100%; border-collapse: collapse; margin: 6px 0 18px; font-size: 14px; }
.legal_table th, .legal_table td { border: 1px solid var(--border); padding: 9px 12px; text-align: left; vertical-align: top; }
.legal_table th { background: var(--surface-2); font-weight: 600; color: var(--text); }
.legal_table td { color: var(--text-2); }
.legal_footer { border-top: 1px solid var(--border); background: var(--surface); padding: 20px 0; font-size: 13px; color: var(--muted); }
.legal_footer .legal_wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: space-between; }
.legal_links { color: var(--muted); font-size: 13px; }
.legal_links a { color: var(--muted); }
.legal_links a:hover { color: var(--primary); }
@media (max-width: 860px)
    {
    .legal_main { grid-template-columns: 1fr; gap: 16px; padding-top: 16px; }
    .legal_nav { position: static; flex-direction: row; flex-wrap: wrap; }
    .legal_doc { padding: 24px 20px; }
    .legal_doc h1 { font-size: 24px; }
    .legal_table { display: block; overflow-x: auto; }
    }
.reg_legal_note { margin-top: 12px; font-size: 12px; line-height: 1.5; color: var(--muted); text-align: center; }
.reg_legal_note a { color: var(--primary); }
/* Строка шире колонки формы (350px) — центрируем её относительно колонки, свисая поровну с обеих сторон */
.legal_links_auth { margin: 4px 0 10px; font-size: 12px; white-space: nowrap; width: max-content; position: relative; left: 50%; transform: translateX(-50%); }
@media (max-width: 420px) { .legal_links_auth { white-space: normal; width: auto; left: 0; transform: none; } }


/* ---------- Вход / регистрация через Google (оформление по правилам Google: белая кнопка, цветной «G») ---------- */
.google_login_wrap { margin: 14px 0 16px; }
.google_login_or { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; color: var(--muted); font-size: 12px; text-transform: lowercase; }
.google_login_or::before, .google_login_or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.google_login_btn
    {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    height: 46px; padding: 0 16px; border-radius: var(--radius-sm);
    background: #fff; border: 1px solid #747775; color: #1F1F1F;
    font-size: 15px; font-weight: 500; line-height: 1;
    transition: background-color .15s, box-shadow .15s;
    }
.google_login_btn:hover { color: #1F1F1F; background: #F8FAFF; box-shadow: 0 1px 3px rgba(60, 64, 67, .2); text-decoration: none; }
.google_login_btn .g_logo { flex: none; }
html.theme_dark .google_login_btn { background: #131314; border-color: #8E918F; color: #E3E3E3; }
html.theme_dark .google_login_btn:hover { background: #1E1F20; color: #E3E3E3; }


/* ---------- Профиль (этап 5): вкладки, правая колонка с тарифом ---------- */
.profile_page { padding: 4px 0 24px; }
.profile_page > .app_alert { margin: 0 0 16px; }
.profile_page .profile_card { margin: 0 0 16px; }
.profile_name_row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.profile_name_row .app_badge .icon { margin-right: 4px; }
.profile_stat_of { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.profile_tabs { margin-bottom: 16px; flex-wrap: wrap; }
.profile_tabs .app_tab .icon { margin: 0; }

.profile_layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.profile_body > .profile_tab > .app_card + .app_card { margin-top: 16px; }
.profile_tab[hidden] { display: none !important; }
@media (max-width: 1199px) { .profile_layout { grid-template-columns: minmax(0, 1fr); } .profile_aside { order: -1; } }

.app_form_row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
@media (max-width: 700px) { .app_form_row { grid-template-columns: minmax(0, 1fr); } }
.profile_form_footer { display: flex; align-items: center; justify-content: flex-end; gap: 14px; flex-wrap: wrap; }
.profile_form_footer .app_hint { margin: 0 auto 0 0; }
.profile_kv { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.profile_kv_value { font-size: 15px; font-weight: 600; color: var(--text); }
.profile_setting_actions { display: inline-flex; align-items: center; gap: 10px; }

.profile_card_head_pad { padding: 20px 22px 16px; margin-bottom: 0; align-items: center; }
.profile_card_head_pad > div { flex: 1; }
.profile_head_btn { flex: none; }
.profile_log_icon { color: var(--primary); margin-right: 8px !important; }
.app_table .cell_main .icon { color: var(--muted); margin-right: 6px; }

.profile_plan_card
    {
    position: relative; overflow: hidden;
    padding: 22px; border-radius: var(--radius);
    background: var(--grad); color: #fff; box-shadow: var(--shadow-lg);
    }
.profile_plan_card::after { content: ''; position: absolute; right: -50px; top: -60px; width: 170px; height: 170px; border-radius: 50%; background: rgba(255,255,255,.1); }
.profile_plan_name { position: relative; font-size: 22px; font-weight: 700; }
.profile_plan_state { position: relative; margin: 4px 0 16px; font-size: 13px; opacity: .9; }
.profile_plan_bar { position: relative; margin-bottom: 12px; font-size: 12.5px; }
.profile_plan_bar_head { display: flex; justify-content: space-between; margin-bottom: 5px; opacity: .95; }
.profile_plan_track { height: 5px; border-radius: 3px; background: rgba(255,255,255,.25); overflow: hidden; }
.profile_plan_track span { display: block; height: 100%; background: #fff; border-radius: 3px; }
.profile_plan_btn
    {
    position: relative; display: block; margin-top: 16px; padding: 11px 14px;
    border-radius: 10px; background: #fff; color: var(--primary) !important;
    text-align: center; font-weight: 700; font-size: 14px;
    }
.profile_plan_btn:hover { text-decoration: none; box-shadow: 0 4px 14px rgba(0,0,0,.15); }
.profile_order_card { margin-top: 16px; }
.profile_order_card h4 { margin: 0 0 12px; color: var(--text); }


/* ---------- Поддержка (этап 6) ---------- */
.side_badge { margin-left: auto; min-width: 20px; padding: 1px 7px; border-radius: 10px; background: var(--primary); color: #fff; font-size: 11.5px; font-weight: 700; text-align: center; line-height: 18px; }
.support_table .support_row { cursor: pointer; }
.support_subject { color: var(--text); font-weight: 600; }
.support_subject:hover { color: var(--primary); text-decoration: none; }
.support_row.unread .support_subject { color: var(--primary); }
.support_dot { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--primary); vertical-align: middle; }

.app_form textarea, .app_form select.app_select
    {
    width: 100%; padding: 11px 14px;
    border: 1px solid var(--border-strong); border-radius: 10px;
    background: var(--surface-2); color: var(--text);
    font-family: var(--font); font-size: 14.5px; line-height: 1.5; outline: none;
    }
.app_form select.app_select { height: 44px; padding: 0 12px; }
.app_form textarea { resize: vertical; min-height: 110px; }
.app_form textarea:focus, .app_form select.app_select:focus { border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 3px var(--primary-50); }
.support_new_card { max-width: 860px; }

.support_files_field { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.support_files_field .app_hint { margin: 0; }
.support_attach_btn
    {
    display: inline-flex !important; align-items: center; gap: 6px; margin: 0 !important;
    padding: 8px 14px; border: 1px dashed var(--border-strong); border-radius: 10px;
    color: var(--text-2) !important; font-weight: 500 !important; cursor: pointer;
    }
.support_attach_btn:hover { border-color: var(--primary); color: var(--primary) !important; }
.support_attach_btn .icon { margin: 0; }
.support_previews { display: flex; flex-wrap: wrap; gap: 10px; width: 100%; }
.support_previews:empty { display: none; }
.support_preview { position: relative; width: 120px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface-2); font-size: 11.5px; }
.support_preview img { display: block; width: 100%; height: 80px; object-fit: cover; }
.support_preview span { display: block; padding: 4px 8px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.support_preview_remove { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border: 0; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; cursor: pointer; line-height: 20px; font-size: 15px; }

.support_status_badge { font-size: 13px; padding: 6px 12px; }
.support_thread { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
.support_msg { display: flex; gap: 12px; align-items: flex-start; max-width: 860px; }
.support_msg.mine { flex-direction: row-reverse; margin-left: auto; }
.support_msg_avatar
    {
    flex: none; width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface-3); color: var(--text-2); font-weight: 700;
    }
.support_msg.staff .support_msg_avatar { background: var(--grad); color: #fff; }
.support_msg.staff .support_msg_avatar .icon { margin: 0; }
.support_msg_bubble { min-width: 0; flex: 1; padding: 12px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.support_msg.staff .support_msg_bubble { background: var(--primary-50); border-color: color-mix(in srgb, var(--primary) 25%, transparent); }
.support_msg_head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.support_msg_head b { color: var(--text); }
.support_msg_body { color: var(--text); font-size: 14.5px; line-height: 1.6; word-wrap: break-word; }
.support_files { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.support_file { width: 160px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.support_file img { display: block; width: 100%; height: 100px; object-fit: cover; }
.support_file span { display: block; padding: 5px 8px; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.support_file:hover { border-color: var(--primary); text-decoration: none; }
.support_reply_card { max-width: 860px; margin-left: 48px; }
.support_close_check { display: inline-flex !important; align-items: center; gap: 6px; margin: 0 auto 0 0 !important; font-weight: 500 !important; color: var(--text-2) !important; cursor: pointer; }
@media (max-width: 700px) { .support_reply_card { margin-left: 0; } .support_msg { max-width: 100%; } }


/* ---------- Админка (этап 9) ---------- */
.admin_grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; align-items: start; }
.admin_grid_even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.admin_grid > .app_card { margin-bottom: 0; }
.admin_side_cards { display: flex; flex-direction: column; gap: 12px; }
.admin_link_card { display: flex; align-items: center; gap: 14px; margin: 0 !important; padding: 16px 18px; color: var(--text) !important; }
.admin_link_card:hover { border-color: var(--primary); text-decoration: none; }
.admin_link_card > div { flex: 1; min-width: 0; }
.admin_link_card p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.admin_link_card > i.icon { color: var(--muted); }
.admin_link_num { font-size: 24px; font-weight: 700; color: var(--muted); }
.admin_link_num.warn { color: var(--orange, #e8590c); }
.app_table td.right, .app_table th.right { text-align: right; }
.admin_total td { color: var(--muted); }
.admin_current td { background: var(--primary-50); }
.admin_over { color: var(--red) !important; font-weight: 700; }
.admin_flag { color: var(--primary); font-weight: 600; }
.admin_flag.warn { color: var(--red); }
.admin_err { color: var(--red) !important; max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin_users_toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.admin_users_search { flex: 1; min-width: 220px; max-width: 360px; margin-left: auto; }
.admin_user_row { cursor: pointer; }
.admin_user_stats { margin-bottom: 16px; }
.admin_days { display: flex; gap: 8px; flex-wrap: wrap; }
.admin_days input { width: 110px !important; flex: none; }
.admin_days .app_btn { padding: 0 12px; }
.admin_plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(520px, 1fr)); gap: 16px; }
.admin_plans .app_card { margin: 0; }
.admin_plan_card.off { opacity: .7; }
.admin_plan_nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 12px; }
.admin_plan_flags { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 4px 0 6px; }
.admin_check { display: inline-flex !important; align-items: center; gap: 6px; margin: 0 !important; font-weight: 500 !important; color: var(--text-2) !important; cursor: pointer; }
.app_form input[type="date"], .app_form input[type="number"] { font-family: var(--font); }
.admin_imp_bar
    {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 10px 24px; background: #fff4e5; color: #8a4b00; border-bottom: 1px solid #ffd8a8; font-size: 14px;
    }
.admin_imp_bar > i.icon { margin: 0; }
.admin_imp_bar span { flex: 1; }
.admin_imp_bar .app_btn { height: 32px; padding: 0 12px; }
.theme_dark .app_form input[type="date"] { color-scheme: dark; }
.theme_dark .admin_imp_bar { background: #3a2a10; color: #ffd8a8; border-color: #5c3d10; }
@media (max-width: 1199px) { .admin_grid, .admin_grid_even { grid-template-columns: minmax(0, 1fr); } .admin_plans { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) { .admin_plan_nums { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px)
    {
    #admin_users_card, #admin_payments_card, .admin_page_scroll .app_table_card { overflow-x: auto; }
    .admin_filter_tabs { max-width: 100%; overflow-x: auto; flex-wrap: nowrap; }
    .admin_filter_tabs .app_tab { white-space: nowrap; }
    .admin_users_search { max-width: none; margin-left: 0; }
    }


/* ---------- Команда (этап 8) ---------- */
.team_invite_row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.team_invite_row .app_field { margin-bottom: 0; }
.team_invite_row .app_btn { height: 44px; }
.team_roles_hint { margin: 10px 0 18px; line-height: 1.6; }
.team_table select.app_select { height: 36px; padding: 0 10px; min-width: 160px; }
.team_table td .app_btn { height: 34px; padding: 0 12px; }
.team_table td .app_btn .icon { margin: 0; }
.team_table td .app_btn .icon + * { margin-left: 6px; }
.team_pending_card { border-color: var(--primary); }
.team_row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.team_row:first-of-type { border-top: 0; }
.team_row_main { flex: 1; min-width: 0; }
.team_avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--grad); color: #fff; font-weight: 700; }
.side_account_avatar .icon { margin: 0; font-size: 13px; }
.side_account_role { margin-left: 6px; color: var(--muted); font-size: 11.5px; }
.side_account_note { margin: -2px 12px 8px; color: var(--muted); font-size: 12px; }
@media (max-width: 700px) { .team_invite_row { grid-template-columns: minmax(0, 1fr); } }
