/*
 * Admin UI refresh — settings and administration: store configs, payment / shipping modules,
 * plugins, users, email templates, cache.
 * Builds on the tokens and the global layer of admin-refresh.css.
 * Not here on purpose: userOverseerTimeSpent, timeConsumers, SalesReadiness and the group
 * rights page (they carry their own designed CSS).
 */

/* ── Page titles ── */

body.admin-new-theme:is(.configGroups-css, .configPlugin-css, .shopModuleSettings-css, .shopModuleList-css, .shopModuleEdit-css, .clearCache-css) #content h1,
body.admin-new-theme:is(.configGroups-css, .configPlugin-css, .shopModuleSettings-css, .shopModuleList-css, .shopModuleEdit-css, .clearCache-css) #content > .container-fluid > h2:first-child
{
    margin: 4px 0 18px;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -.01em;
    color: var(--adm-text);
}

body.admin-new-theme.clearCache-css #content > .container-fluid > h2:first-child,
body.admin-new-theme.configPlugin-css #content h1
{
    margin-top: 20px;
}

body.admin-new-theme.configGroups-css .page-header
{
    margin: 4px 0 18px;
    padding: 0 0 14px;
    border-bottom: 1px solid var(--adm-border);
}

body.admin-new-theme.configGroups-css #content .page-header h1
{
    margin: 0;
}


/* ═════════════════════════════════════════
 *  Config tables: configGroups, shopModuleSettings, configPlugin
 *  (one row per key: label + description | store | value)
 * ═════════════════════════════════════════ */

/* Group picker on configGroups */
body.admin-new-theme.configGroups-css #content form[method="get"] > table
{
    margin: 0 0 20px;
}

body.admin-new-theme.configGroups-css #content form[method="get"] > table td
{
    padding: 0 10px 0 0;
    vertical-align: middle;
}

body.admin-new-theme.configGroups-css #content form[method="get"] label
{
    margin: 0;
    font-weight: 600;
    color: var(--adm-text-soft);
}

body.admin-new-theme.configGroups-css #select-drop
{
    min-width: 280px;
}

body.admin-new-theme.configGroups-css #config-table .title-config-table
{
    margin: 0 0 12px;
    padding: 0;
    background: none;
    font-size: 15px;
    font-weight: 600;
    color: var(--adm-text);
}

/* The config form uses the full width (was 9 of 12 columns) */
body.admin-new-theme.configGroups-css #config-table > .row > [class*="col-"]
{
    width: 100%;
}

/* The table as a card */
body.admin-new-theme:is(.configGroups-css, .configPlugin-css) #content .table-responsive:has(tr.config-row),
body.admin-new-theme.shopModuleSettings-css #content form[name="module_settings_form"] > .table
{
    margin: 0 0 16px;
    background: var(--adm-surface);
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius-lg);
    box-shadow: var(--adm-shadow);
    overflow: hidden;
}

body.admin-new-theme.shopModuleSettings-css #content form[name="module_settings_form"] > .table
{
    border-collapse: separate;
    border-spacing: 0;
}

body.admin-new-theme:is(.configGroups-css, .configPlugin-css, .shopModuleSettings-css) #content .table:has(tr.config-row)
{
    margin: 0;
}

body.admin-new-theme:is(.configGroups-css, .configPlugin-css, .shopModuleSettings-css) #content .table:has(tr.config-row) > thead > tr > th,
body.admin-new-theme:is(.configGroups-css, .configPlugin-css, .shopModuleSettings-css) #content .table:has(tr.config-row) > thead > th
{
    padding: 10px 16px;
    background: var(--adm-surface-head);
    border-bottom: 1px solid var(--adm-border);
    color: var(--adm-muted);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

/* Calm rows: white, a hairline between them, a light tint on hover */
body.admin-new-theme:is(.configGroups-css, .configPlugin-css, .shopModuleSettings-css) #content .table > tbody > tr.config-row,
body.admin-new-theme:is(.configGroups-css, .configPlugin-css, .shopModuleSettings-css) #content .table-striped > tbody > tr.config-row:nth-of-type(odd)
{
    background: var(--adm-surface);
}

body.admin-new-theme:is(.configGroups-css, .configPlugin-css, .shopModuleSettings-css) #content .table-hover > tbody > tr.config-row:hover
{
    background: var(--adm-row-hover);
}

body.admin-new-theme:is(.configGroups-css, .configPlugin-css, .shopModuleSettings-css) #content tr.config-row > td
{
    padding: 12px 16px;
    border-top: 1px solid var(--adm-border);
    vertical-align: middle;
    color: var(--adm-text-soft);
    line-height: 1.45;
}

body.admin-new-theme:is(.configGroups-css, .configPlugin-css, .shopModuleSettings-css) #content tbody > tr.config-row:first-child > td
{
    border-top: 0;
}

/* Label column */
body.admin-new-theme:is(.configGroups-css, .configPlugin-css, .shopModuleSettings-css) #content tr.config-row > td:first-child
{
    color: var(--adm-text);
    word-break: break-word;
}

body.admin-new-theme:is(.configGroups-css, .configPlugin-css, .shopModuleSettings-css) #content tr.config-row > td:first-child > b
{
    font-weight: 600;
}

body.admin-new-theme:is(.configGroups-css, .configPlugin-css, .shopModuleSettings-css) #content tr.config-row > td:first-child > i:not(.fa)
{
    color: var(--adm-muted);
    font-size: 12px;
    font-style: normal;
}

/* The description sits on an icon element: give the text the page font, keep the icon */
body.admin-new-theme:is(.configGroups-css, .configPlugin-css, .shopModuleSettings-css) #content tr.config-row #set-label-size
{
    display: inline-block;
    margin-top: 3px;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 12.5px;
    font-style: normal;
    font-weight: 400;
    line-height: 1.45;
    color: var(--adm-muted);
}

body.admin-new-theme:is(.configGroups-css, .configPlugin-css, .shopModuleSettings-css) #content tr.config-row #set-label-size::before
{
    font-family: "Font Awesome 5 Pro", "FontAwesome";
    color: var(--adm-brand);
    margin-right: 2px;
}

/* Store column: a quiet tag */
body.admin-new-theme:is(.configGroups-css, .shopModuleSettings-css) #content tr.config-row > td:nth-child(2)
{
    width: 1%;
    white-space: nowrap;
    color: var(--adm-muted);
    font-size: 12.5px;
}

/* Value column: same width on every row, fields fill it */
body.admin-new-theme:is(.configGroups-css, .configPlugin-css, .shopModuleSettings-css) #content tr.config-row > td:last-child
{
    width: 38%;
    min-width: 260px;
}

body.admin-new-theme:is(.configGroups-css, .configPlugin-css, .shopModuleSettings-css) #content tr.config-row > td:last-child :is(input[type="text"], input[type="number"], input[type="password"], select, textarea)
{
    width: 100%;
    max-width: none;
}

/* Save: always in reach at the bottom of a long form */
body.admin-new-theme.configGroups-css #config-table form > button[type="submit"],
body.admin-new-theme.configPlugin-css #content form.form > button[type="submit"],
body.admin-new-theme.shopModuleSettings-css #content form[name="module_settings_form"] > .form-group:last-child
{
    position: sticky;
    bottom: 16px;
    z-index: 5;
}

body.admin-new-theme.configGroups-css #config-table form > button[type="submit"],
body.admin-new-theme.configPlugin-css #content form.form > button[type="submit"],
body.admin-new-theme.shopModuleSettings-css #content form[name="module_settings_form"] > .form-group:last-child > .btn
{
    min-width: 160px;
    padding: 9px 18px;
    font-weight: 600;
    box-shadow: var(--adm-shadow-pop);
}

body.admin-new-theme.configPlugin-css #content > .container-fluid > hr
{
    margin: 24px 0;
}


/* ═════════════════════════════════════════
 *  Payment / shipping / order total modules (shopModuleList)
 * ═════════════════════════════════════════ */

body.admin-new-theme.shopModuleList-css #content .shop-module-table
{
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 24px;
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius-lg);
    overflow: hidden;
}

body.admin-new-theme.shopModuleList-css #content .shop-module-table > tbody > tr > td
{
    vertical-align: middle;
}

body.admin-new-theme.shopModuleList-css #content .shop-module-table > tbody > tr:nth-of-type(odd)
{
    background: var(--adm-surface);
}

/* The default module: a soft highlight instead of the bright yellow row */
body.admin-new-theme.shopModuleList-css #content .shop-module-table > tbody > tr.default-plugin,
body.admin-new-theme.shopModuleList-css #content .shop-module-table > tbody > tr.default-plugin:hover
{
    background-color: var(--adm-brand-tint) !important;
}

body.admin-new-theme.shopModuleList-css #content .shop-module-table > tbody > tr.default-plugin > td:first-child
{
    box-shadow: inset 3px 0 0 var(--adm-brand);
}

body.admin-new-theme.shopModuleList-css #content .shop-module-table .img-logo-courier
{
    max-height: 32px;
    width: auto;
}

body.admin-new-theme.shopModuleList-css #content .shop-module-table td.ui-state-error
{
    background: var(--adm-danger-bg);
    border-color: var(--adm-border);
    color: var(--adm-danger);
    font-weight: 600;
}


/* ═════════════════════════════════════════
 *  Shop module edit (names / descriptions per language)
 * ═════════════════════════════════════════ */

body.admin-new-theme.shopModuleEdit-css #content form
{
    max-width: 960px;
    margin: 0 0 20px;
    padding: 18px 20px;
    background: var(--adm-surface);
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius-lg);
    box-shadow: var(--adm-shadow);
}

body.admin-new-theme.shopModuleEdit-css #content form label
{
    font-weight: 600;
    color: var(--adm-text-soft);
}


/* ═════════════════════════════════════════
 *  Danger / install buttons in the settings lists: readable contrast
 *  (the theme's light red and light purple carry white text below 4.5:1)
 * ═════════════════════════════════════════ */

body.admin-new-theme:is(.shopModuleList-css, .shopPluginsList-css, .templateList-css, .AutomatedProcess-css) #content .btn-danger
{
    background: var(--adm-danger-bg);
    border-color: #fecdca;
    color: var(--adm-danger);
}

body.admin-new-theme:is(.shopModuleList-css, .shopPluginsList-css, .templateList-css, .AutomatedProcess-css) #content .btn-danger:hover,
body.admin-new-theme:is(.shopModuleList-css, .shopPluginsList-css, .templateList-css, .AutomatedProcess-css) #content .btn-danger:focus
{
    background: var(--adm-danger);
    border-color: var(--adm-danger);
    color: #ffffff;
}

body.admin-new-theme.shopPluginsList-css #content .btn-primary-second
{
    background: var(--adm-brand);
    border-color: var(--adm-brand);
    color: #ffffff;
}

body.admin-new-theme.shopPluginsList-css #content .btn-primary-second:hover,
body.admin-new-theme.shopPluginsList-css #content .btn-primary-second:focus
{
    background: var(--adm-brand-strong);
    border-color: var(--adm-brand-strong);
    color: #ffffff;
}


/* ═════════════════════════════════════════
 *  Plugins (shopPluginsList)
 * ═════════════════════════════════════════ */

body.admin-new-theme.shopPluginsList-css #content > .container-fluid > br:first-child
{
    display: none;
}

body.admin-new-theme.shopPluginsList-css #content .form-group.row:has(#plugin-management-search)
{
    display: flex;
    align-items: center;
    margin: 20px 0 16px;
}

body.admin-new-theme.shopPluginsList-css #content .form-group.row:has(#plugin-management-search) > label
{
    width: auto;
    padding: 0 12px 0 0;
    font-weight: 600;
    color: var(--adm-text-soft);
}

body.admin-new-theme.shopPluginsList-css #content .form-group.row:has(#plugin-management-search) > div
{
    width: 360px;
    max-width: 100%;
    padding: 0;
}

body.admin-new-theme.shopPluginsList-css #plugin-management-table
{
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius-lg);
    overflow: hidden;
}

body.admin-new-theme.shopPluginsList-css #plugin-management-table > tbody > tr:nth-of-type(odd)
{
    background: var(--adm-surface);
}

body.admin-new-theme.shopPluginsList-css #plugin-management-table > tbody > tr > td
{
    vertical-align: middle;
}

body.admin-new-theme.shopPluginsList-css #plugin-management-table summary
{
    cursor: pointer;
    font-weight: 500;
    color: var(--adm-text);
}

body.admin-new-theme.shopPluginsList-css #plugin-management-table summary::marker
{
    color: var(--adm-muted);
}

body.admin-new-theme.shopPluginsList-css #plugin-management-table details[open]
{
    color: var(--adm-text-soft);
    line-height: 1.5;
}

body.admin-new-theme.shopPluginsList-css #plugin-management-table details[open] > summary
{
    margin-bottom: 6px;
    color: var(--adm-brand);
}

body.admin-new-theme.shopPluginsList-css #plugin-management-table td > .btn + .btn
{
    margin-left: 4px;
}


/* ═════════════════════════════════════════
 *  Users (UserManagement): section tabs + users list
 * ═════════════════════════════════════════ */

body.admin-new-theme.UserManagement-css #meniu-suplimentar .nav.nav-tabs
{
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--adm-border);
}

body.admin-new-theme.UserManagement-css #meniu-suplimentar .nav-tabs > li
{
    float: none;
    margin-bottom: -1px;
}

body.admin-new-theme.UserManagement-css #meniu-suplimentar .nav-tabs > li > a
{
    margin: 0;
    padding: 9px 14px;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: transparent;
    color: var(--adm-muted);
    font-weight: 500;
    transition: color var(--adm-transition), border-color var(--adm-transition);
}

body.admin-new-theme.UserManagement-css #meniu-suplimentar .nav-tabs > li > a:hover,
body.admin-new-theme.UserManagement-css #meniu-suplimentar .nav-tabs > li > a:focus
{
    background: transparent;
    color: var(--adm-text);
    border-bottom-color: var(--adm-border);
}

body.admin-new-theme.UserManagement-css #meniu-suplimentar .nav-tabs > li.active > a,
body.admin-new-theme.UserManagement-css #meniu-suplimentar .nav-tabs > li > a.selected,
body.admin-new-theme.UserManagement-css #meniu-suplimentar .nav-tabs > li.active > a:hover
{
    border: 0;
    border-bottom: 2px solid var(--adm-brand);
    background: transparent;
    color: var(--adm-brand);
    font-weight: 600;
}

body.admin-new-theme.usersList-css #content .users-list
{
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius-lg);
}

body.admin-new-theme.usersList-css #content .users-list > tbody > tr:nth-of-type(odd)
{
    background: var(--adm-surface);
}

/* Disabled users: still readable (was 50% opacity on grey, under 3:1) */
body.admin-new-theme.usersList-css #content .users-list tbody .user-is-disabled
{
    background: var(--adm-surface-head);
}

body.admin-new-theme.usersList-css #content .users-list tbody .user-is-disabled td:not(.user-status, :last-of-type, :nth-last-of-type(2))
{
    opacity: 1;
    color: var(--adm-muted);
}

body.admin-new-theme.usersList-css #content .users-list .user-status .text-danger
{
    color: var(--adm-danger);
}

body.admin-new-theme.usersList-css #content .users-list .user-status .text-success
{
    color: var(--adm-success);
}

body.admin-new-theme.usersList-css #content .users-list .user-buttons-wrapper .user-buttons-modal
{
    border-color: var(--adm-border);
    border-radius: var(--adm-radius);
    box-shadow: var(--adm-shadow-pop);
}


/* ═════════════════════════════════════════
 *  Email templates (EmailManagement)
 * ═════════════════════════════════════════ */

/* The jQuery UI header painted the column names dark on dark */
body.admin-new-theme.EmailManagement-css #content .table > thead > tr.ui-widget-header
{
    background: var(--adm-surface-head);
    border: 0;
    color: var(--adm-muted);
    font-weight: 600;
}

body.admin-new-theme.EmailManagement-css #content .table > thead > tr.ui-widget-header > th
{
    color: var(--adm-muted);
}

body.admin-new-theme.templateList-css #content .table
{
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius-lg);
    overflow: hidden;
}

body.admin-new-theme.templateList-css #content .table > tbody > tr:nth-of-type(odd)
{
    background: var(--adm-surface);
}

body.admin-new-theme.templateList-css #content .table > tbody > tr > td
{
    vertical-align: middle;
}

body.admin-new-theme.templateList-css #content .table label
{
    margin: 0 8px 0 0;
    font-weight: 500;
    color: var(--adm-text-soft);
}


/* ═════════════════════════════════════════
 *  Clear cache (ShopMisc:clearCache): two actions as cards
 * ═════════════════════════════════════════ */

body.admin-new-theme.clearCache-css #content .container-fluid > div:has(> a.btn-lg)
{
    max-width: 760px;
    margin: 0 0 16px !important;
    padding: 18px 20px;
    background: var(--adm-surface);
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius-lg);
    box-shadow: var(--adm-shadow);
}

body.admin-new-theme.clearCache-css #content .container-fluid > div:has(> a.btn-lg) > .btn-lg
{
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
}

body.admin-new-theme.clearCache-css #content .container-fluid > div:has(> a.btn-lg) > p
{
    margin: 12px 0 0 !important;
    color: var(--adm-text-soft);
    line-height: 1.55;
}


/* ═════════════════════════════════════════
 *  Task automation (AutomatedProcess)
 * ═════════════════════════════════════════ */

/* The theme's light blue hint text sits under 3:1 on the panel footer */
body.admin-new-theme.AutomatedProcess-css #content .text-info
{
    color: var(--adm-info);
}
