/*
 * WebRobot UI layer.
 *
 * Loaded after the Adminto theme CSS in templates/base.html and only ever
 * overrides it -- delete the <link> and the site falls back to the stock theme.
 * Colours are tokens on :root; the dark set applies when the theme's dark
 * stylesheet is switched on (static/js/webrobot-ui.js mirrors that onto
 * <html data-bs-theme="dark">).
 */

:root {
    --wr-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --wr-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

    --wr-bg: #f4f6fa;
    --wr-surface: #ffffff;
    --wr-surface-2: #f8fafc;
    --wr-border: #e3e8ef;
    --wr-border-strong: #cdd5df;
    --wr-text: #1f2937;
    --wr-text-muted: #64748b;
    --wr-text-subtle: #94a3b8;

    --wr-primary: #2563eb;
    --wr-primary-hover: #1d4ed8;
    --wr-primary-soft: #e8efff;
    --wr-primary-ring: rgba(37, 99, 235, .22);

    --wr-success: #15803d;
    --wr-success-soft: #e7f6ec;
    --wr-warning: #b45309;
    --wr-warning-soft: #fdf3e2;
    --wr-danger: #dc2626;
    --wr-danger-soft: #fdecec;
    --wr-info: #0e7490;
    --wr-info-soft: #e3f5f9;

    --wr-radius: 12px;
    --wr-radius-sm: 8px;
    --wr-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
    --wr-shadow-lg: 0 8px 24px rgba(16, 24, 40, .08);
}

:root[data-bs-theme="dark"] {
    --wr-bg: #0f1420;
    --wr-surface: #171d2b;
    --wr-surface-2: #1c2333;
    --wr-border: #273044;
    --wr-border-strong: #34405a;
    --wr-text: #e5e9f0;
    --wr-text-muted: #9aa6ba;
    --wr-text-subtle: #6b778c;

    --wr-primary: #5b8cff;
    --wr-primary-hover: #7aa2ff;
    --wr-primary-soft: rgba(91, 140, 255, .14);
    --wr-primary-ring: rgba(91, 140, 255, .3);

    --wr-success: #4ade80;
    --wr-success-soft: rgba(74, 222, 128, .12);
    --wr-warning: #fbbf24;
    --wr-warning-soft: rgba(251, 191, 36, .12);
    --wr-danger: #f87171;
    --wr-danger-soft: rgba(248, 113, 113, .12);
    --wr-info: #22d3ee;
    --wr-info-soft: rgba(34, 211, 238, .12);

    --wr-shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --wr-shadow-lg: 0 8px 24px rgba(0, 0, 0, .35);
}

/* ───────────────────────── Base ───────────────────────── */

body {
    font-family: var(--wr-font);
    font-size: .875rem;
    color: var(--wr-text);
    background: var(--wr-bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--wr-font);
    color: var(--wr-text);
    letter-spacing: -.01em;
}

.text-muted { color: var(--wr-text-muted) !important; }

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

/* ICCIDs, PUKs and phone numbers are read digit by digit -- give them a mono face. */
.wr-mono, .results-list-item, code, kbd, pre {
    font-family: var(--wr-mono);
    font-variant-numeric: tabular-nums;
}

.wr-num { font-variant-numeric: tabular-nums; }

.content-page { background: var(--wr-bg); }
.content-page > .content > .container-fluid { padding-top: 1.25rem; }

/* ───────────────────────── Topbar ───────────────────────── */

.navbar-custom {
    background: var(--wr-surface) !important;
    border-bottom: 1px solid var(--wr-border);
    box-shadow: none;
}

.navbar-custom .page-title,
.navbar-custom h4 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--wr-text);
}

/* ───────────────────────── Sidebar ───────────────────────── */

.logo-box {
    background: var(--wr-surface) !important;
    border-right: 1px solid var(--wr-border);
}

.left-side-menu {
    background: var(--wr-surface) !important;
    border-right: 1px solid var(--wr-border);
    box-shadow: none;
}

#sidebar-menu > ul > li > a {
    margin: 2px 12px;
    padding: 9px 12px;
    border-radius: var(--wr-radius-sm);
    color: var(--wr-text-muted);
    font-weight: 500;
    transition: background-color .15s, color .15s;
}

#sidebar-menu > ul > li > a:hover,
#sidebar-menu > ul > li > a:focus-visible {
    background: var(--wr-surface-2);
    color: var(--wr-text);
}

#sidebar-menu > ul > li > a.active,
#sidebar-menu > ul > li.menuitem-active > a {
    background: var(--wr-primary-soft);
    color: var(--wr-primary) !important;
}

#sidebar-menu .nav-second-level li a {
    padding: 7px 12px 7px 50px;
    color: var(--wr-text-muted);
    border-radius: var(--wr-radius-sm);
}

#sidebar-menu .nav-second-level li a:hover { color: var(--wr-text); }

#sidebar-menu .nav-second-level li.menuitem-active > a,
#sidebar-menu .nav-second-level li a.active {
    color: var(--wr-primary) !important;
    font-weight: 600;
}

#sidebar-menu .menu-title {
    color: var(--wr-text-subtle);
    font-size: .7rem;
    letter-spacing: .08em;
    padding-left: 24px;
}

/* ───────────────────────── Cards ───────────────────────── */

.card {
    background: var(--wr-surface);
    border: 1px solid var(--wr-border);
    border-radius: var(--wr-radius);
    box-shadow: var(--wr-shadow);
    margin-bottom: 1.25rem;
}

.card-body { padding: 1.25rem 1.5rem; }

.header-title,
.card .header-title {
    font-size: .95rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    color: var(--wr-text);
}

/* ───────────────────────── Forms ───────────────────────── */

.form-label, .control-label, label {
    font-weight: 500;
    color: var(--wr-text);
}

.form-control, .form-select,
.dataTables_wrapper input,
.dataTables_wrapper select {
    background-color: var(--wr-surface);
    border: 1px solid var(--wr-border-strong);
    border-radius: var(--wr-radius-sm);
    color: var(--wr-text);
    transition: border-color .15s, box-shadow .15s;
}

.form-control:focus, .form-select:focus,
.dataTables_wrapper input:focus,
.dataTables_wrapper select:focus {
    border-color: var(--wr-primary);
    box-shadow: 0 0 0 3px var(--wr-primary-ring);
    outline: none;
}

.form-control::placeholder { color: var(--wr-text-subtle); }

textarea.form-control {
    font-family: var(--wr-mono);
    font-size: .8125rem;
    line-height: 1.6;
    min-height: 8rem;
}

.help-block, .form-text { color: var(--wr-text-muted); font-size: .8rem; }

.form-check-input:checked {
    background-color: var(--wr-primary);
    border-color: var(--wr-primary);
}

/* ───────────────────────── Buttons ───────────────────────── */

.btn {
    border-radius: var(--wr-radius-sm);
    font-weight: 500;
    padding: .5rem 1rem;
}

.btn-primary {
    background: var(--wr-primary);
    border-color: var(--wr-primary);
    color: #fff;
}

.btn-primary:hover, .btn-primary:focus {
    background: var(--wr-primary-hover);
    border-color: var(--wr-primary-hover);
    color: #fff;
}

.btn:focus-visible { box-shadow: 0 0 0 3px var(--wr-primary-ring); }

/* ───────────────────────── Tabs ───────────────────────── */

.nav-tabs { border-bottom: 1px solid var(--wr-border); }

.nav-tabs .nav-link {
    border: 0;
    border-bottom: 2px solid transparent;
    color: var(--wr-text-muted);
    font-weight: 500;
}

.nav-tabs .nav-link.active {
    color: var(--wr-primary);
    background: transparent;
    border-bottom-color: var(--wr-primary);
}

/* ───────────────────────── Tables / DataTables ───────────────────────── */

.table {
    color: var(--wr-text);
    border-color: var(--wr-border);
    margin-bottom: 0;
}

.table > :not(caption) > * > * { padding: .65rem .75rem; }

.table thead th {
    background: var(--wr-surface-2);
    color: var(--wr-text-muted);
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    border-bottom: 1px solid var(--wr-border) !important;
    white-space: nowrap;
}

.table-bordered > :not(caption) > * > * { border-width: 0 0 1px 0; }
.table-bordered > :not(caption) > * { border-width: 0; }

/* Zebra striping fought the hover state and greyed out every other row's text. */
.table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-accent-bg: transparent;
    background: transparent;
    color: var(--wr-text);
}

.table tbody tr { transition: background-color .1s; }
.table tbody tr:hover > * { background: var(--wr-surface-2); }

/* Per-column filter row that ajax_datatable puts under the header. */
.table thead tr:nth-child(2) th,
.table thead tr.datatable-column-filter-row th {
    background: var(--wr-surface);
    text-transform: none;
    padding-top: .4rem;
    padding-bottom: .4rem;
}

.table thead tr:nth-child(2) input,
.table thead tr:nth-child(2) select {
    width: 100%;
    min-height: 32px;
    padding: .25rem .5rem;
    font-size: .8rem;
}

/*
 * ajax_datatable renders its toolbar as `<"toolbar">lrftip`: date range,
 * page length and search each float separately and wrap into a staircase.
 * Lay them out as one flex row that wraps cleanly on narrow screens.
 */
.dataTables_wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem 1rem;
}

.dataTables_wrapper > .table,
.dataTables_wrapper > table,
.dataTables_wrapper > .dataTables_processing,
.dataTables_wrapper > .dataTables_scroll,
.dataTables_wrapper > .row,
.dataTables_wrapper > .dataTables_extraFooter {
    flex: 1 0 100%;
}

.dataTables_wrapper .toolbar,
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/*
 * The card templates put an empty <p> between the title and the table, and the
 * rules above strip the toolbar's own margins, so "My Cards" ended up sitting
 * directly on the filters. Space the toolbar from the title instead.
 */
.card-body > .header-title + p:empty { margin: 0; }

.card-body > .header-title + .dataTables_wrapper,
.card-body > .header-title + p:empty + .dataTables_wrapper,
.card-body > .header-title + p:empty + .table + .dataTables_wrapper {
    margin-top: 1rem;
}

.dataTables_wrapper .toolbar { order: 0; }
.dataTables_wrapper .dataTables_length { order: 1; }
.dataTables_wrapper .dataTables_filter { order: 2; margin-left: auto !important; }
.dataTables_wrapper > table { order: 3; }
.dataTables_wrapper .dataTables_processing { order: 3; }
.dataTables_wrapper .dataTables_info { order: 4; }
.dataTables_wrapper .dataTables_paginate { order: 5; margin-left: auto !important; }
.dataTables_wrapper .dataTables_extraFooter { order: 6; }

.dataTables_wrapper .daterange {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem .75rem;
    float: none !important;
    margin: 0 !important;
}

.dataTables_wrapper .daterange > span {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: var(--wr-text-muted);
}

.dataTables_wrapper .daterange label { margin: 0; font-weight: 500; color: var(--wr-text-muted); }

.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin: 0;
    white-space: nowrap;
    font-weight: 500;
    color: var(--wr-text-muted);
}

.dataTables_wrapper input[type="date"],
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    height: 34px;
    padding: .25rem .6rem;
    margin: 0 !important;
    font-size: .85rem;
}

.dataTables_wrapper .dataTables_filter input { width: 220px; }
.dataTables_wrapper .dataTables_length select { width: auto; padding-right: 1.75rem; }

.dataTables_wrapper .dataTables_info {
    color: var(--wr-text-muted);
    font-size: .8rem;
}

.dataTables_wrapper .dataTables_processing {
    background: var(--wr-surface);
    border: 1px solid var(--wr-border);
    border-radius: var(--wr-radius-sm);
    box-shadow: var(--wr-shadow-lg);
    color: var(--wr-text);
}

.dataTables_empty {
    padding: 2.5rem 1rem !important;
    color: var(--wr-text-muted);
    text-align: center;
}

.pagination { gap: 4px; margin: 0; }

.page-item .page-link {
    border: 1px solid var(--wr-border);
    border-radius: var(--wr-radius-sm) !important;
    color: var(--wr-text);
    background: var(--wr-surface);
    min-width: 34px;
    text-align: center;
}

.page-item.active .page-link {
    background: var(--wr-primary);
    border-color: var(--wr-primary);
    color: #fff;
}

.page-item.disabled .page-link { color: var(--wr-text-subtle); background: var(--wr-surface); }

/* ───────────────────────── Badges / status pills ───────────────────────── */

.badge {
    border-radius: 999px;
    font-weight: 600;
    padding: .3em .7em;
    letter-spacing: .01em;
}

.badge.bg-success, .badge-success, .badge.bg-soft-success { background: var(--wr-success-soft) !important; color: var(--wr-success) !important; }
.badge.bg-danger, .badge-danger, .badge.bg-soft-danger { background: var(--wr-danger-soft) !important; color: var(--wr-danger) !important; }
.badge.bg-warning, .badge-warning, .badge.bg-soft-warning { background: var(--wr-warning-soft) !important; color: var(--wr-warning) !important; }
.badge.bg-info, .badge-info, .badge.bg-soft-info { background: var(--wr-info-soft) !important; color: var(--wr-info) !important; }
.badge.bg-primary, .badge-primary, .badge.bg-soft-primary { background: var(--wr-primary-soft) !important; color: var(--wr-primary) !important; }
.badge.bg-secondary, .badge-secondary { background: var(--wr-surface-2) !important; color: var(--wr-text-muted) !important; }

/* Results block shown after submitting a batch of ICCIDs. */
.results-summary .stat { border-radius: 999px; font-weight: 600; }
.stat-created { background: var(--wr-success-soft) !important; color: var(--wr-success) !important; }
.stat-failed { background: var(--wr-danger-soft) !important; color: var(--wr-danger) !important; }
.stat-total { background: var(--wr-primary-soft) !important; color: var(--wr-primary) !important; }
.results-list { background: var(--wr-surface-2) !important; border-color: var(--wr-border) !important; }
.results-list-item { border-bottom-color: var(--wr-border) !important; }
.results-list-item.created { color: var(--wr-success) !important; }
.results-list-item.failed { color: var(--wr-danger) !important; }

/* ───────────────────────── Page header ───────────────────────── */

.wr-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: .75rem;
    margin: .25rem 0 1.25rem;
}

.wr-page-header h1 {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
}

.wr-page-header p {
    margin: .25rem 0 0;
    color: var(--wr-text-muted);
}

/* ───────────────────────── Dashboard ───────────────────────── */

.wr-kpi {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    height: 100%;
    padding: 1.1rem 1.25rem;
    background: var(--wr-surface);
    border: 1px solid var(--wr-border);
    border-radius: var(--wr-radius);
    box-shadow: var(--wr-shadow);
}

.wr-kpi__label {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: var(--wr-text-muted);
    font-size: .8rem;
    font-weight: 500;
}

.wr-kpi__icon {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--wr-primary-soft);
    color: var(--wr-primary);
    font-size: 1rem;
}

.wr-kpi__value {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
    color: var(--wr-text);
    line-height: 1.2;
}

.wr-kpi__value small {
    font-size: .95rem;
    font-weight: 600;
    color: var(--wr-text-muted);
    margin-left: .15rem;
}

.wr-kpi--danger .wr-kpi__icon { background: var(--wr-danger-soft); color: var(--wr-danger); }
.wr-kpi--danger .wr-kpi__value { color: var(--wr-danger); }
.wr-kpi--success .wr-kpi__icon { background: var(--wr-success-soft); color: var(--wr-success); }
.wr-kpi--success .wr-kpi__value { color: var(--wr-success); }

.wr-share + .wr-share { margin-top: 1rem; }

.wr-share__row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .4rem;
    font-weight: 500;
}

.wr-share__row span:last-child { color: var(--wr-text-muted); font-variant-numeric: tabular-nums; }

.wr-share .progress {
    height: 8px;
    border-radius: 999px;
    background: var(--wr-surface-2);
}

.wr-share .progress-bar { background: var(--wr-primary); border-radius: 999px; }

.wr-chart { position: relative; height: 280px; }

.wr-empty {
    display: grid;
    place-items: center;
    gap: .25rem;
    min-height: 200px;
    color: var(--wr-text-muted);
    text-align: center;
}

.wr-empty i { font-size: 1.75rem; color: var(--wr-text-subtle); }

/* ───────────────────────── Footer ───────────────────────── */

.footer {
    background: transparent;
    border-top: 1px solid var(--wr-border);
    color: var(--wr-text-muted);
}

/* ───────────────────────── Small screens ───────────────────────── */

@media (max-width: 767.98px) {
    .card-body { padding: 1rem; }
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_paginate { margin-left: 0 !important; }
    .dataTables_wrapper .dataTables_filter input { width: 100%; }
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_filter label { flex: 1 0 100%; }
    .wr-kpi__value { font-size: 1.4rem; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

/* ───────────────────────── Sign-in pages ───────────────────────── */

body.wr-auth {
    min-height: 100vh;
    background:
        radial-gradient(1200px 600px at 10% -10%, var(--wr-primary-soft), transparent 60%),
        radial-gradient(900px 500px at 110% 110%, var(--wr-primary-soft), transparent 60%),
        var(--wr-bg);
}

.wr-auth__wrap {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 2rem 16px;
}

.wr-auth__panel { width: 100%; max-width: 400px; }

.wr-auth__brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: .02em;
    color: var(--wr-text);
}

.wr-auth__mark {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--wr-primary);
    color: #fff;
    font-size: 1.2rem;
}

.wr-auth .card { box-shadow: var(--wr-shadow-lg); }
.wr-auth .card-body { padding: 2rem; }
.wr-auth h1 { font-size: 1.35rem; font-weight: 700; margin: 0 0 .25rem; }
.wr-auth .form-control { height: 42px; }
.wr-auth .btn-primary { height: 42px; }

.wr-auth .alert-danger {
    background: var(--wr-danger-soft);
    border: 0;
    color: var(--wr-danger);
    border-radius: var(--wr-radius-sm);
}

.wr-auth__foot {
    margin-top: 1.25rem;
    text-align: center;
    color: var(--wr-text-muted);
    font-size: .8rem;
}
.logout-checkmark { color: var(--wr-success); }

/* ───────────────────────── Avatars ───────────────────────── */

.wr-avatar {
    --size: 40px;
    position: relative;
    display: inline-grid;
    place-items: center;
    flex: none;
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    background: var(--wr-primary-soft);
    color: var(--wr-primary);
    font-weight: 700;
    font-size: calc(var(--size) * .38);
    letter-spacing: .02em;
    line-height: 1;
    vertical-align: middle;
}

.wr-avatar > img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.wr-avatar--sm { --size: 32px; }
.wr-avatar--md { --size: 40px; }
.wr-avatar--lg { --size: 64px; }
.wr-avatar--xl { --size: 104px; }

.nav-user .wr-avatar { margin-top: -2px; }
.wr-userbox-avatar { display: inline-block; border-radius: 50%; }
.wr-userbox-avatar .wr-avatar { box-shadow: 0 0 0 3px var(--wr-surface), 0 0 0 4px var(--wr-border); }

.wr-menu-who { padding: .6rem 1rem !important; max-width: 240px; }

/* ───────────────────────── Topbar theme toggle ───────────────────────── */

.wr-theme-toggle { border: 0; box-shadow: none !important; }
.wr-theme-toggle .wr-theme-toggle__light { display: none !important; }
:root[data-bs-theme="dark"] .wr-theme-toggle .wr-theme-toggle__light { display: inline-block !important; }
:root[data-bs-theme="dark"] .wr-theme-toggle .wr-theme-toggle__dark { display: none !important; }

/* ───────────────────────── Profile page ───────────────────────── */

.wr-profile { overflow: hidden; padding: 0; }

.wr-profile__cover {
    height: 120px;
    background:
        radial-gradient(600px 200px at 15% 0%, rgba(255, 255, 255, .25), transparent 70%),
        linear-gradient(120deg, var(--wr-primary), #7c3aed);
}

.wr-profile__body {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem 1.5rem;
    padding: 0 1.5rem 1.25rem;
    margin-top: -52px;
}

.wr-profile .wr-avatar--xl {
    box-shadow: 0 0 0 4px var(--wr-surface), var(--wr-shadow-lg);
    background: var(--wr-surface-2);
}

.wr-avatar__edit {
    position: absolute;
    right: 2px;
    bottom: 2px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    margin: 0;
    border-radius: 50%;
    background: var(--wr-surface);
    color: var(--wr-text);
    border: 1px solid var(--wr-border);
    box-shadow: var(--wr-shadow);
    font-size: 1rem;
    cursor: pointer;
    transition: transform .15s, color .15s;
}

.wr-avatar__edit:hover { color: var(--wr-primary); transform: scale(1.06); }
.wr-avatar input:focus-visible + .wr-avatar__edit,
.wr-avatar__edit:focus-visible { box-shadow: 0 0 0 3px var(--wr-primary-ring); }

/* The body is pulled up 52px over the cover; this leaves ~20px between the cover and the name. */
.wr-profile__who { flex: 1 1 260px; min-width: 0; padding-top: 72px; }
.wr-profile__who h1 { font-size: 1.4rem; font-weight: 700; margin: 0; }
.wr-profile__handle { color: var(--wr-text-muted); margin-top: .1rem; }
.wr-profile__badges { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .6rem; }
.wr-profile__badges:empty { display: none; }

.wr-profile__meta {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem 1.25rem;
    list-style: none;
    padding: 0;
    margin: .75rem 0 0;
    color: var(--wr-text-muted);
    font-size: .82rem;
}

.wr-profile__meta i { margin-right: .35rem; color: var(--wr-text-subtle); }

.wr-profile__actions { display: flex; flex-wrap: wrap; gap: .5rem; }

.btn-light {
    background: var(--wr-surface-2);
    border: 1px solid var(--wr-border);
    color: var(--wr-text);
}

.btn-light:hover { background: var(--wr-border); border-color: var(--wr-border-strong); color: var(--wr-text); }

.wr-profile__tabs {
    display: flex;
    gap: .25rem;
    padding: 0 1.25rem;
    border-top: 1px solid var(--wr-border);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}

.wr-profile__tabs a {
    padding: .8rem .75rem;
    color: var(--wr-text-muted);
    font-weight: 500;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.wr-profile__tabs a:hover { color: var(--wr-text); }
.wr-profile__tabs a.active { color: var(--wr-primary); border-bottom-color: var(--wr-primary); }

.wr-tabpane[hidden] { display: none !important; }

/* Service shortcuts */
.wr-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem; }

.wr-tile {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .8rem .9rem;
    border: 1px solid var(--wr-border);
    border-radius: var(--wr-radius-sm);
    background: var(--wr-surface);
    color: var(--wr-text);
    font-weight: 500;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}

.wr-tile:hover { color: var(--wr-text); border-color: var(--wr-primary); box-shadow: var(--wr-shadow); transform: translateY(-1px); }

.wr-tile__icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--wr-primary-soft);
    color: var(--wr-primary);
    font-size: 1.1rem;
    flex: none;
}

.wr-tile__label { flex: 1; min-width: 0; }
.wr-tile__go { color: var(--wr-text-subtle); transition: transform .15s, color .15s; }
.wr-tile:hover .wr-tile__go { color: var(--wr-primary); transform: translateX(2px); }

/* Label / value list */
.wr-list { list-style: none; padding: 0; margin: 0; }

.wr-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: .65rem 0;
    border-bottom: 1px solid var(--wr-border);
}

.wr-list li:last-child { border-bottom: 0; }
.wr-list li span { color: var(--wr-text-muted); }
.wr-list li span i { margin-right: .5rem; color: var(--wr-text-subtle); }

/* Segmented control (theme picker) */
.wr-segmented {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 4px;
    border-radius: 10px;
    background: var(--wr-surface-2);
    border: 1px solid var(--wr-border);
}

.wr-segmented label { margin: 0; }
.wr-segmented input { position: absolute; opacity: 0; pointer-events: none; }

.wr-segmented span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .5rem;
    border-radius: 7px;
    color: var(--wr-text-muted);
    font-weight: 500;
    cursor: pointer;
    transition: background-color .15s, color .15s;
}

.wr-segmented input:checked + span { background: var(--wr-surface); color: var(--wr-text); box-shadow: var(--wr-shadow); }
.wr-segmented input:focus-visible + span { box-shadow: 0 0 0 3px var(--wr-primary-ring); }

/* Password field with reveal button + strength bar */
.wr-password { position: relative; }
.wr-password .form-control { padding-right: 2.75rem; }

.wr-password__toggle {
    position: absolute;
    top: 50%;
    right: .35rem;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--wr-text-muted);
}

.wr-password__toggle:hover { color: var(--wr-text); background: var(--wr-surface-2); }
.wr-password .form-control.is-invalid { background-image: none; }

.wr-strength { height: 4px; margin-top: .5rem; border-radius: 999px; background: var(--wr-surface-2); overflow: hidden; }
.wr-strength span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--wr-danger); transition: width .2s, background-color .2s; }
.wr-strength span[data-score="2"] { background: var(--wr-warning); }
.wr-strength span[data-score="3"],
.wr-strength span[data-score="4"] { background: var(--wr-success); }

/* ───────────────────────── Toasts ───────────────────────── */

#wr-toasts {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    max-width: min(380px, calc(100vw - 32px));
}

.wr-toast {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    padding: .75rem .75rem .75rem 1rem;
    border-radius: var(--wr-radius-sm);
    background: var(--wr-surface);
    border: 1px solid var(--wr-border);
    border-left: 4px solid var(--wr-info);
    box-shadow: var(--wr-shadow-lg);
    color: var(--wr-text);
    animation: wr-toast-in .2s ease-out;
}

.wr-toast > i { font-size: 1.15rem; line-height: 1.2; color: var(--wr-info); }
.wr-toast > span { flex: 1; word-break: break-word; }
.wr-toast--success { border-left-color: var(--wr-success); }
.wr-toast--success > i { color: var(--wr-success); }
.wr-toast--error { border-left-color: var(--wr-danger); }
.wr-toast--error > i { color: var(--wr-danger); }
.wr-toast--warning { border-left-color: var(--wr-warning); }
.wr-toast--warning > i { color: var(--wr-warning); }
.wr-toast--out { opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; }

.wr-toast__close { border: 0; background: transparent; color: var(--wr-text-subtle); padding: 0 .25rem; }
.wr-toast__close:hover { color: var(--wr-text); }

@keyframes wr-toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ───────────────────────── List counter & copy ───────────────────────── */

.wr-listcount {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem .75rem;
    margin-top: .4rem;
    font-size: .8rem;
}

.wr-listcount__n { color: var(--wr-text-muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.wr-listcount__dupes { color: var(--wr-warning); font-family: var(--wr-mono); }
.wr-listcount__dupes::before { content: "\26A0\FE0E  "; }

td.wr-mono { cursor: copy; }
td.wr-mono:hover { color: var(--wr-primary); }
td.wr-mono.wr-copied { color: var(--wr-success); }

@media (max-width: 767.98px) {
    .wr-profile__body { padding: 0 1rem 1rem; }
    .wr-profile__who { padding-top: .25rem; flex-basis: 100%; }
    .wr-profile__actions { width: 100%; }
    .wr-profile__actions .btn { flex: 1; }
}

.wr-segmented input:checked + span { background: var(--wr-primary-soft); color: var(--wr-primary); box-shadow: none; }

.form-control:disabled, .form-control[readonly] {
    background: var(--wr-surface-2);
    color: var(--wr-text-muted);
    border-color: var(--wr-border);
}

.wr-listcount__fix {
    border: 0;
    padding: 0;
    background: none;
    color: var(--wr-primary);
    font-weight: 600;
    font-size: .8rem;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ───────────────────────── Form + activity panel ───────────────────────── */

.wr-formrow > [class*="col-"] > .card,
.wr-formrow .wr-activity-host { height: 100%; }
.wr-formrow > .col-xl-7 > .card { margin-bottom: 0; }

.wr-activity { display: flex; flex-direction: column; height: 100%; }
.wr-activity > .card:last-child { flex: 1; }

.wr-activity__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .9rem;
}

.wr-live {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: var(--wr-text-muted);
    font-size: .75rem;
    font-variant-numeric: tabular-nums;
}

.wr-live__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--wr-success);
    box-shadow: 0 0 0 0 var(--wr-success);
    animation: wr-pulse 2s infinite;
}

@keyframes wr-pulse {
    0% { box-shadow: 0 0 0 0 rgba(21, 128, 61, .45); }
    70% { box-shadow: 0 0 0 6px rgba(21, 128, 61, 0); }
    100% { box-shadow: 0 0 0 0 rgba(21, 128, 61, 0); }
}

.wr-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }

.wr-stat {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    padding: .65rem .75rem;
    border-radius: var(--wr-radius-sm);
    background: var(--wr-surface-2);
    border: 1px solid var(--wr-border);
    min-width: 0;
}

.wr-stat__n { font-size: 1.35rem; font-weight: 700; line-height: 1.1; color: var(--wr-text); }
.wr-stat__label { font-size: .72rem; color: var(--wr-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wr-stat--done .wr-stat__n { color: var(--wr-success); }
.wr-stat--queued .wr-stat__n { color: var(--wr-primary); }
.wr-stat--attention .wr-stat__n { color: var(--wr-warning); }

.wr-bar {
    display: flex;
    gap: 2px;
    height: 6px;
    margin-top: .85rem;
    border-radius: 999px;
    overflow: hidden;
    background: var(--wr-surface-2);
}

.wr-bar span { display: block; min-width: 4px; }
.wr-bar__done { background: var(--wr-success); }
.wr-bar__queued { background: var(--wr-primary); }
.wr-bar__attention { background: var(--wr-warning); }

.wr-activity__note {
    display: flex;
    align-items: center;
    gap: .45rem;
    margin: .85rem 0 0;
    color: var(--wr-text-muted);
    font-size: .8rem;
}

.wr-activity__note i { color: var(--wr-primary); font-size: 1rem; }

/* 7-day columns */
.wr-spark { display: grid; grid-template-columns: repeat(7, 1fr); gap: .4rem; height: 110px; align-items: end; }

.wr-spark__col {
    display: grid;
    grid-template-rows: auto 1fr auto;
    align-items: end;
    justify-items: center;
    height: 100%;
    gap: .25rem;
}

.wr-spark__n { font-size: .7rem; color: var(--wr-text-muted); min-height: 1em; }

.wr-spark__bar {
    width: 100%;
    max-width: 28px;
    min-height: 3px;
    border-radius: 5px 5px 2px 2px;
    background: var(--wr-primary);
    opacity: .35;
    align-self: end;
    transition: height .3s;
}

.wr-spark__col--today .wr-spark__bar { opacity: 1; }
.wr-spark__col--today .wr-spark__n { color: var(--wr-text); font-weight: 600; }
.wr-spark__day { font-size: .7rem; color: var(--wr-text-subtle); }
.wr-spark__col--today .wr-spark__day { color: var(--wr-primary); font-weight: 600; }

/* Latest submissions */
.wr-recent { list-style: none; margin: 0; padding: 0; }

.wr-recent li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: .6rem;
    padding: .55rem 0;
    border-bottom: 1px solid var(--wr-border);
}

.wr-recent li:last-child { border-bottom: 0; }
.wr-recent__dot { width: 8px; height: 8px; border-radius: 50%; }
.wr-recent__dot--done { background: var(--wr-success); }
.wr-recent__dot--queued { background: var(--wr-primary); }
.wr-recent__dot--attention { background: var(--wr-warning); }
.wr-recent__id { font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: copy; }
.wr-recent__id:hover { color: var(--wr-primary); }
.wr-recent__time { font-size: .75rem; color: var(--wr-text-subtle); min-width: 2.5em; text-align: right; font-variant-numeric: tabular-nums; }

.wr-pill {
    display: inline-block;
    max-width: 160px;
    padding: .15em .6em;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wr-pill--done { background: var(--wr-success-soft); color: var(--wr-success); }
.wr-pill--queued { background: var(--wr-primary-soft); color: var(--wr-primary); }
.wr-pill--attention { background: var(--wr-warning-soft); color: var(--wr-warning); }

@media (max-width: 575.98px) {
    .wr-stats { grid-template-columns: repeat(2, 1fr); }
}

/* The form card fills the row next to the panel: list box grows, steps sit at the bottom. */
.wr-formrow > .col-xl-7 > .card > .card-body { display: flex; flex-direction: column; }
.wr-formrow textarea.form-control { min-height: 13rem; resize: vertical; }

/* Pinned to the bottom of the card, never closer than 1.5rem to the form. */
.wr-steps-wrap { margin-top: auto; padding-top: 1.5rem; }

.wr-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .75rem;
    list-style: none;
    margin: 0;
    padding: 1.25rem 0 0;
    border-top: 1px dashed var(--wr-border);
}

.wr-steps li { display: flex; gap: .65rem; align-items: flex-start; min-width: 0; }

.wr-steps__n {
    display: grid;
    place-items: center;
    flex: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--wr-primary-soft);
    color: var(--wr-primary);
    font-weight: 700;
    font-size: .8rem;
}

.wr-steps strong { display: block; font-size: .85rem; color: var(--wr-text); margin-bottom: .1rem; }
.wr-steps span:not(.wr-steps__n) { display: block; font-size: .78rem; color: var(--wr-text-muted); line-height: 1.4; }

@media (max-width: 767.98px) {
    .wr-steps { grid-template-columns: 1fr; }
}

/* ───────────────────────── Illustrations ───────────────────────── */
/* Inline SVGs in common/templates/common/illustrations/, coloured from tokens
   so they follow light/dark and the page accent. */

.wr-illo { display: block; width: 100%; height: auto; overflow: visible; }
.wr-illo--sm { max-width: 150px; margin: 0 auto; }

.wr-illo .c-bg { fill: var(--wr-accent-soft, var(--wr-primary-soft)); }
.wr-illo .c-bg2 { fill: var(--wr-accent-soft, var(--wr-primary-soft)); opacity: .6; }
.wr-illo .c-card { fill: var(--wr-surface); stroke: var(--wr-border-strong); stroke-width: 1.5; }
.wr-illo .c-card-2 { fill: var(--wr-surface-2); stroke: var(--wr-border-strong); stroke-width: 1.5; }
.wr-illo .c-screen { fill: var(--wr-accent-soft, var(--wr-primary-soft)); }
.wr-illo .c-main { fill: var(--wr-accent, var(--wr-primary)); }
.wr-illo .c-mute { fill: var(--wr-border); }
.wr-illo .c-accent { fill: #f5b83d; }
.wr-illo .c-accent-ring { fill: none; stroke: #d99a1e; stroke-width: 2; }
.wr-illo .c-accent-line { fill: none; stroke: #c98a12; stroke-width: 1.6; stroke-linecap: round; }
.wr-illo .c-line { fill: none; stroke: var(--wr-accent, var(--wr-primary)); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.wr-illo .c-dash { fill: none; stroke: var(--wr-border-strong); stroke-width: 1.5; stroke-dasharray: 4 4; }
.wr-illo .c-arrow, .wr-illo .c-check { fill: none; stroke: #fff; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.wr-illo .c-euro { fill: none; stroke: #8a5a00; stroke-width: 3; stroke-linecap: round; }
.wr-illo .c-ok { fill: var(--wr-success); }
.wr-illo .c-spark { fill: var(--wr-accent, var(--wr-primary)); opacity: .45; }
.wr-illo .c-tag { fill: var(--wr-accent, var(--wr-primary)); font: 700 15px var(--wr-font); letter-spacing: .04em; }

:root[data-bs-theme="dark"] .wr-illo .c-accent { fill: #e0a63a; }
:root[data-bs-theme="dark"] .wr-illo .c-arrow,
:root[data-bs-theme="dark"] .wr-illo .c-check { stroke: var(--wr-bg); }

/* Gentle float so the art feels alive, not rigid. */
@keyframes wr-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.wr-hero__art .wr-illo { animation: wr-float 6s ease-in-out infinite; }

/* ───────────────────────── Page banner ───────────────────────── */

.wr-hero {
    --wr-accent: var(--wr-primary);
    --wr-accent-soft: var(--wr-primary-soft);
    position: relative;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    min-height: 132px;
    margin-bottom: 1.25rem;
    padding: 1.25rem 1.5rem;
    overflow: hidden;
    border-radius: var(--wr-radius);
    border: 1px solid var(--wr-border);
    background:
        radial-gradient(520px 220px at 100% 0%, var(--wr-accent-soft), transparent 70%),
        radial-gradient(360px 180px at 0% 100%, var(--wr-accent-soft), transparent 75%),
        var(--wr-surface);
    box-shadow: var(--wr-shadow);
}

.wr-hero::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--wr-accent);
}

.wr-hero__text { flex: 1; min-width: 0; }

.wr-hero__eyebrow {
    display: inline-block;
    margin-bottom: .35rem;
    padding: .15rem .55rem;
    border-radius: 999px;
    background: var(--wr-accent-soft);
    color: var(--wr-accent);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.wr-hero h1 { margin: 0; font-size: 1.45rem; font-weight: 700; }
.wr-hero p { margin: .35rem 0 0; max-width: 60ch; color: var(--wr-text-muted); }
.wr-hero__art { flex: none; width: 210px; margin: -.5rem 0 -.75rem; }

/* Operator accents -- only the stripe, eyebrow and illustration pick them up. */
.wr-hero--vodafone { --wr-accent: #e60000; --wr-accent-soft: rgba(230, 0, 0, .09); }
.wr-hero--lebara { --wr-accent: #d6197f; --wr-accent-soft: rgba(214, 25, 127, .09); }
.wr-hero--telephonica { --wr-accent: #0a4fd6; --wr-accent-soft: rgba(10, 79, 214, .09); }
.wr-hero--variatel { --wr-accent: #0d9488; --wr-accent-soft: rgba(13, 148, 136, .10); }
.wr-hero--lyca { --wr-accent: #1d4ed8; --wr-accent-soft: rgba(29, 78, 216, .09); }

:root[data-bs-theme="dark"] .wr-hero--vodafone { --wr-accent: #ff4d4d; --wr-accent-soft: rgba(255, 77, 77, .14); }
:root[data-bs-theme="dark"] .wr-hero--lebara { --wr-accent: #f050a8; --wr-accent-soft: rgba(240, 80, 168, .14); }
:root[data-bs-theme="dark"] .wr-hero--telephonica,
:root[data-bs-theme="dark"] .wr-hero--lyca { --wr-accent: #6b9bff; --wr-accent-soft: rgba(107, 155, 255, .14); }
:root[data-bs-theme="dark"] .wr-hero--variatel { --wr-accent: #2dd4bf; --wr-accent-soft: rgba(45, 212, 191, .14); }

@media (max-width: 767.98px) {
    .wr-hero { padding: 1rem 1.1rem; }
    .wr-hero__art { width: 120px; margin: 0; }
    .wr-hero h1 { font-size: 1.2rem; }
}

@media (max-width: 479.98px) {
    .wr-hero__art { display: none; }
}

/* ───────────────────────── Table polish ───────────────────────── */

th.wr-mono { font-family: var(--wr-font); cursor: default; }
th.wr-mono:hover { color: inherit; }

/* Pills carry the status now; the old whole-row tints only added noise. */
.table tbody tr.table-success > *,
.table tbody tr.table-danger > *,
.table tbody tr.table-warning > * { --bs-table-bg: transparent; --bs-table-accent-bg: transparent; background: transparent; color: var(--wr-text); }

.wr-pill--muted { background: var(--wr-surface-2); color: var(--wr-text-muted); border: 1px solid var(--wr-border); }
td > .wr-pill { max-width: 220px; }

.wr-date { display: inline-flex; align-items: baseline; gap: .45rem; font-variant-numeric: tabular-nums; }
.wr-date small { color: var(--wr-text-subtle); font-size: .78rem; }


.wr-quick__copy { padding: .35rem .75rem; font-size: .8rem; white-space: nowrap; }

.wr-chips {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px;
    border-radius: 10px;
    background: var(--wr-surface-2);
    border: 1px solid var(--wr-border);
}

.wr-chips__label { padding: 0 .5rem 0 .4rem; color: var(--wr-text-muted); font-size: .78rem; font-weight: 600; }

.wr-chip {
    border: 0;
    padding: .3rem .75rem;
    border-radius: 7px;
    background: transparent;
    color: var(--wr-text-muted);
    font-size: .8rem;
    font-weight: 500;
    transition: background-color .15s, color .15s;
}

.wr-chip:hover { color: var(--wr-text); }
.wr-chip.active { background: var(--wr-surface); color: var(--wr-primary); box-shadow: var(--wr-shadow); font-weight: 600; }
.wr-chip:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--wr-primary-ring); }

.wr-table-empty { display: grid; justify-items: center; gap: .25rem; padding: .5rem 0; }
.wr-table-empty strong { color: var(--wr-text); font-size: .95rem; }
.wr-table-empty span { color: var(--wr-text-muted); font-size: .82rem; }

/* A table card reads as one surface: the header row sits flush with the card. */
.card-body.table-responsive > .header-title { margin-bottom: .25rem !important; }
.card-body.table-responsive > .header-title + p.text-muted:empty { display: none; }
.wr-chipped { display: none !important; }
.wr-dash { color: var(--wr-text-subtle); }

/* ───────────────────────── Tables: filters + list ───────────────────────── */
/* webrobot-ui.js moves ajax_datatable's controls into .wr-tbl-filters and wraps
   the table in .wr-tbl-list with a .wr-tbl-foot under it. */

.dataTables_wrapper.wr-tbl { display: block; }
.wr-tbl .toolbar:empty,
.wr-tbl .toolbar:not(:has(:not([hidden]))) { display: none; }

.wr-tbl-filters {
    margin-bottom: 1rem;
    padding: .85rem 1rem;
    border-radius: var(--wr-radius);
    background: var(--wr-surface-2);
    border: 1px solid var(--wr-border);
}

.wr-tbl-filters__main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .6rem .75rem;
}

.wr-tbl-filters__search { flex: 1 1 260px; max-width: 420px; }
.wr-tbl-filters__search:empty,
.wr-tbl-filters__dates:empty,
.wr-tbl-filters__chips:empty { display: none; }
.wr-tbl-filters__chips { display: flex; flex-wrap: wrap; gap: .5rem; }

.wr-tbl-filters__actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-left: auto;
}

.wr-tbl-filters__count {
    padding: .2rem .6rem;
    border-radius: 999px;
    background: var(--wr-primary-soft);
    color: var(--wr-primary);
    font-size: .75rem;
    font-weight: 600;
}

.wr-tbl-filters__clear { padding: .2rem .25rem; font-size: .8rem; font-weight: 600; color: var(--wr-text-muted); text-decoration: none; }
.wr-tbl-filters__clear:hover { color: var(--wr-danger); }

.wr-tbl-filters__more {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: .6rem .75rem;
    margin-top: .8rem;
    padding-top: .8rem;
    border-top: 1px dashed var(--wr-border-strong);
}

.wr-tbl-filters.has-more .wr-tbl-filters__more { display: grid; }

.wr-search {
    position: relative;
    display: block;
    margin: 0;
}

.wr-search i {
    position: absolute;
    left: .7rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--wr-text-subtle);
    font-size: 1.1rem;
    pointer-events: none;
}

.wr-tbl .wr-search input {
    width: 100% !important;
    height: 38px !important;
    padding-left: 2.2rem !important;
    background: var(--wr-surface);
    font-size: .875rem !important;
}

.wr-daterange {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    height: 38px;
    padding: 0 .35rem 0 .6rem;
    border-radius: var(--wr-radius-sm);
    border: 1px solid var(--wr-border-strong);
    background: var(--wr-surface);
}

.wr-daterange i { color: var(--wr-text-subtle); font-size: 1.05rem; }
.wr-daterange__sep { color: var(--wr-text-subtle); }

.wr-tbl .wr-daterange input.form-control {
    width: auto;
    height: 30px !important;
    padding: 0 .35rem !important;
    border: 0;
    box-shadow: none;
    background: transparent;
    font-size: .82rem !important;
}

.wr-daterange:focus-within { border-color: var(--wr-primary); box-shadow: 0 0 0 3px var(--wr-primary-ring); }

.wr-field { display: flex; flex-direction: column; gap: .3rem; margin: 0; min-width: 0; }
.wr-field__label { font-size: .72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--wr-text-muted); }
.wr-tbl .wr-field .form-control,
.wr-tbl .wr-field .form-select { height: 36px; min-height: 36px; padding: .3rem .65rem; font-size: .85rem; background-color: var(--wr-surface); }

.wr-tbl-filters .wr-chips { background: var(--wr-surface); }
.wr-tbl-filters .wr-chip.active { background: var(--wr-primary-soft); box-shadow: none; }

/* The list */
.wr-tbl-list {
    position: relative;
    border: 1px solid var(--wr-border);
    border-radius: var(--wr-radius);
    overflow: hidden;
    background: var(--wr-surface);
}

.wr-tbl-list > .table { margin: 0 !important; border: 0; width: 100% !important; }
.wr-tbl-list .table thead th { border-top: 0; padding-top: .75rem; padding-bottom: .75rem; }
.wr-tbl-list .table tbody tr:last-child > * { border-bottom: 0; }
.wr-tbl-list .table > :not(caption) > * > * { padding-left: 1rem; padding-right: 1rem; }
.wr-tbl-list .table tbody td { vertical-align: middle; }

/* Sort indicators: quieter, and visible only where they matter. */
.wr-tbl-list table.dataTable thead > tr > th.sorting::before,
.wr-tbl-list table.dataTable thead > tr > th.sorting::after { opacity: .18; }
.wr-tbl-list table.dataTable thead > tr > th.sorting_asc::before,
.wr-tbl-list table.dataTable thead > tr > th.sorting_desc::after { opacity: .9; color: var(--wr-primary); }
.wr-tbl-list table.dataTable thead > tr > th.sorting_asc,
.wr-tbl-list table.dataTable thead > tr > th.sorting_desc { color: var(--wr-text); }

.wr-tbl .dataTables_processing {
    position: absolute;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%);
    margin: 0 !important;
    width: auto !important;
    padding: .6rem 1rem !important;
    z-index: 5;
}

.wr-tbl-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem 1.25rem;
    padding: .85rem .25rem 0;
}

.wr-tbl-foot .dataTables_info { order: 1; padding: 0 !important; }
.wr-tbl-foot .dataTables_length { order: 2; }
.wr-tbl-foot .dataTables_paginate { order: 3; margin-left: auto !important; }
.wr-tbl-foot .dataTables_length label { display: inline-flex; align-items: center; gap: .5rem; margin: 0; color: var(--wr-text-muted); font-size: .8rem; }
.wr-tbl-foot .dataTables_length select { height: 32px !important; padding: 0 1.75rem 0 .6rem !important; font-size: .8rem !important; }

@media (max-width: 767.98px) {
    .wr-tbl-filters__search { max-width: none; flex-basis: 100%; }
    .wr-tbl-filters__actions { margin-left: 0; }
    .wr-tbl-foot .dataTables_paginate { margin-left: 0 !important; }
}

/* ───────────────────────── Invoice page ───────────────────────── */

[v-cloak] { display: none; }

.wr-period { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; padding: .85rem 1.25rem; }
.wr-period__custom { display: flex; align-items: center; gap: .5rem; }
.wr-period__custom .form-control { width: auto; height: 36px; font-size: .85rem; }

.wr-statement__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--wr-border);
}

.wr-statement__brand { display: flex; align-items: center; gap: .7rem; }
.wr-statement__brand strong { display: block; font-size: 1rem; letter-spacing: .04em; }
.wr-statement__brand div > span { color: var(--wr-text-muted); font-size: .8rem; }
.wr-statement__meta { display: flex; flex-direction: column; align-items: flex-end; gap: .1rem; font-size: .82rem; }
.wr-statement__meta h2 { margin: 0 0 .15rem; font-size: 1.25rem; font-weight: 700; letter-spacing: -.01em; }

.wr-statement__to { display: flex; flex-direction: column; gap: .1rem; padding: 1rem 0; font-size: .85rem; }
.wr-statement__to .text-muted { font-size: .72rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }

.wr-lines { border: 1px solid var(--wr-border); border-radius: var(--wr-radius-sm); border-collapse: separate; border-spacing: 0; overflow: hidden; }
.wr-lines tbody tr:last-child > * { border-bottom: 0; }
.wr-lines__service { margin-left: .5rem; }

.wr-op {
    display: inline-block;
    padding: .12em .55em;
    border-radius: 6px;
    background: var(--wr-surface-2);
    color: var(--wr-text-muted);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .02em;
}

.wr-op--lyca { background: rgba(29, 78, 216, .1); color: #1d4ed8; }
.wr-op--vodafone { background: rgba(230, 0, 0, .09); color: #c70000; }
.wr-op--lebara { background: rgba(214, 25, 127, .1); color: #b3126a; }
.wr-op--telephonica { background: rgba(10, 79, 214, .1); color: #0a4fd6; }
.wr-op--variatel { background: rgba(13, 148, 136, .12); color: #0b7a70; }
:root[data-bs-theme="dark"] .wr-op--lyca, :root[data-bs-theme="dark"] .wr-op--telephonica { color: #8fb1ff; }
:root[data-bs-theme="dark"] .wr-op--vodafone { color: #ff7a7a; }
:root[data-bs-theme="dark"] .wr-op--lebara { color: #f47dbd; }
:root[data-bs-theme="dark"] .wr-op--variatel { color: #5eead4; }

.wr-op-bar--lyca { background: #1d4ed8 !important; }
.wr-op-bar--vodafone { background: #e60000 !important; }
.wr-op-bar--lebara { background: #d6197f !important; }
.wr-op-bar--telephonica { background: #0a4fd6 !important; }
.wr-op-bar--variatel { background: #0d9488 !important; }

.wr-totals { display: flex; flex-direction: column; gap: .35rem; margin: 1.25rem 0 0 auto; max-width: 360px; font-size: .88rem; }
.wr-totals > div { display: flex; justify-content: space-between; gap: 1rem; }
.wr-totals__payment { color: var(--wr-success); }
.wr-totals__grand { margin-top: .4rem; padding-top: .6rem; border-top: 2px solid var(--wr-text); font-size: 1.1rem; font-weight: 700; }
.wr-totals__grand.is-due { color: var(--wr-danger); border-top-color: var(--wr-danger); }
.wr-totals__note { margin: .35rem 0 0; color: var(--wr-text-subtle); font-size: .75rem; text-align: right; }

.wr-statement__actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--wr-border); }

.wr-timeline { list-style: none; margin: 0; padding: 0 0 0 .4rem; }
.wr-timeline li { position: relative; display: flex; gap: .75rem; padding: 0 0 1rem 1rem; border-left: 2px solid var(--wr-border); }
.wr-timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.wr-timeline__dot { position: absolute; left: -7px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--wr-success); box-shadow: 0 0 0 3px var(--wr-surface); }
.wr-timeline li div { display: flex; flex-direction: column; }
.wr-timeline li span { color: var(--wr-text-muted); font-size: .8rem; }

.wr-skeleton {
    display: inline-block;
    width: 7rem;
    height: 1.2em;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--wr-surface-2), var(--wr-border), var(--wr-surface-2));
    background-size: 200% 100%;
    animation: wr-shimmer 1.2s linear infinite;
}

.wr-skeleton--row { display: block; width: 100%; height: 38px; margin-bottom: .5rem; }
@keyframes wr-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Print: just the statement. */
@media print {
    .left-side-menu, .navbar-custom, .footer, .wr-hero, .wr-noprint, #wr-toasts, .rightbar-overlay, .right-bar { display: none !important; }
    .content-page { margin: 0 !important; padding: 0 !important; }
    body, .content-page { background: #fff !important; }
    .wr-invoice-app .col-xl-8 { flex: 0 0 100%; max-width: 100%; }
    .wr-statement { border: 0 !important; box-shadow: none !important; }
    .wr-kpi { box-shadow: none; }
}

/* table-bordered drew every cell border in the text colour; one hairline between rows is enough. */
.wr-tbl-list .table,
.wr-tbl-list .table-bordered { border: 0 !important; }
.wr-tbl-list .table > :not(caption) > * > * {
    border-color: var(--wr-border) !important;
    border-width: 0 0 1px 0 !important;
}

/* A few column filters sit inline in the main row, label as placeholder. */
.wr-field--inline { flex: 0 1 220px; }
.wr-field--inline .wr-field__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.wr-tbl .wr-field--inline .form-control,
.wr-tbl .wr-field--inline .form-select { height: 38px; background-color: var(--wr-surface); }

/* ───────────────────────── Brand + topbar on small screens ───────────────────────── */

.wr-brand { display: flex !important; align-items: center; height: 70px; padding: 0 18px; line-height: 1 !important; }
.logo.wr-brand span.logo-lg { display: flex; align-items: center; gap: .6rem; }  /* beats the theme's .logo span.logo-lg */
.wr-brand__mark {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--wr-primary);
    color: #fff;
    font-size: 1.15rem;
}
.wr-brand__name { color: var(--wr-text); font-weight: 800; font-size: 1.05rem; letter-spacing: .06em; }
body[data-sidebar-size="condensed"] .wr-brand { justify-content: center; padding: 0; }

.wr-noti-empty { display: grid; justify-items: center; gap: .3rem; padding: 1.5rem 1.25rem 1.75rem; text-align: center; white-space: normal; }
.wr-noti-empty i { font-size: 1.8rem; color: var(--wr-success); }
.wr-noti-empty strong { color: var(--wr-text); }
.wr-noti-empty span { color: var(--wr-text-muted); font-size: .8rem; }

/* Bell dropdown and the notifications page (notification/templates/notification/) */
.wr-noti-badge[hidden] { display: none !important; }
.wr-noti-menu { width: min(380px, calc(100vw - 24px)); padding: 0; overflow: hidden; }
.wr-noti-menu .wr-noti-empty i.mdi-bell-outline, .wr-noti-menu .wr-noti-empty i.mdi-wifi-off { color: var(--wr-text-subtle); }
.wr-noti-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .8rem 1rem; border-bottom: 1px solid var(--wr-border); }
.wr-noti-head h5 { margin: 0; font-size: .95rem; font-weight: 700; display: flex; align-items: center; gap: .45rem; }
.wr-noti-count { padding: .05rem .45rem; border-radius: 999px; background: var(--wr-primary-soft); color: var(--wr-primary); font-size: .72rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.wr-noti-head .btn-link { font-size: .8rem; text-decoration: none; }
.wr-noti-scroll { max-height: min(420px, 60vh); overflow-y: auto; }
.wr-noti-foot { display: block; padding: .7rem 1rem; border-top: 1px solid var(--wr-border); text-align: center; font-size: .82rem; font-weight: 600; color: var(--wr-primary); }
.wr-noti-foot:hover { background: var(--wr-surface-2); color: var(--wr-primary-hover); }

.wr-noti-item {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    gap: .75rem;
    align-items: start;
    padding: .75rem 1rem;
    color: var(--wr-text);
    white-space: normal;
    transition: background-color .15s;
}
.wr-noti-item + .wr-noti-item { border-top: 1px solid var(--wr-border); }
.wr-noti-item:hover { background: var(--wr-surface-2); color: var(--wr-text); }
.wr-noti-item:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--wr-primary-ring); }
.wr-noti-item.is-unread { background: color-mix(in srgb, var(--wr-primary-soft) 55%, transparent); }
.wr-noti-item.is-unread:hover { background: var(--wr-primary-soft); }
.wr-noti-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; font-size: 1.05rem; }
.wr-noti-icon--success { background: var(--wr-success-soft); color: var(--wr-success); }
.wr-noti-icon--danger { background: var(--wr-danger-soft); color: var(--wr-danger); }
.wr-noti-icon--info { background: var(--wr-primary-soft); color: var(--wr-primary); }
.wr-noti-text { display: grid; gap: .1rem; min-width: 0; }
.wr-noti-text strong { font-weight: 600; font-size: .85rem; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.wr-noti-item:not(.is-unread) .wr-noti-text strong { font-weight: 500; }
.wr-noti-text > span { color: var(--wr-text-muted); font-size: .8rem; }
.wr-noti-meta { display: flex; flex-direction: column; align-items: flex-end; gap: .4rem; color: var(--wr-text-subtle); font-size: .74rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.wr-noti-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--wr-primary); }

.wr-noti-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1.25rem; }
.wr-noti-toolbar .wr-chip { text-decoration: none; }
.wr-noti-day + .wr-noti-day { margin-top: 1.5rem; }
.wr-noti-day h2 { margin: 0 0 .5rem; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--wr-text-muted); }
.wr-noti-group { border: 1px solid var(--wr-border); border-radius: var(--wr-radius-sm); overflow: hidden; }
.wr-noti-page .wr-noti-item { padding: .85rem 1.1rem; }
.wr-noti-pages { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1.5rem; }

@media (max-width: 991.98px) {
    /* The theme keeps a 70px logo square here; on a phone it was just empty space. */
    .navbar-custom .logo-box { display: none !important; }
    .navbar-custom .topnav-menu-left { display: flex; align-items: center; min-width: 0; }
    .navbar-custom .button-menu-mobile { width: 56px; }
    .navbar-custom .page-title-main {
        display: block !important;
        max-width: calc(100vw - 56px - 190px);
        padding: 0 4px;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        font-size: 1rem;
    }
    .navbar-custom .topnav-menu .nav-link { padding: 0 10px; }
    .navbar-custom .pro-user-name { display: none; }
}

@media (max-width: 575.98px) {
    .content-page > .content > .container-fluid { padding-left: 12px; padding-right: 12px; padding-top: 1rem; }
    .navbar-custom .topnav-menu .nav-link { padding: 0 8px; }
    .wr-hero { margin-bottom: 1rem; }
    .card { margin-bottom: 1rem; }
}

/* Chip groups and the custom period wrap on narrow screens instead of running off the edge. */
.wr-chips { flex-wrap: wrap; max-width: 100%; }
.wr-period__custom { flex-wrap: wrap; }

@media (max-width: 575.98px) {
    .wr-period { padding: .75rem; }
    .wr-period .wr-chips { width: 100%; }
    .wr-period__custom { width: 100%; }
    .wr-period__custom .form-control { flex: 1 1 120px; min-width: 0; }
    .wr-statement__head { flex-direction: column; }
    .wr-statement__meta { align-items: flex-start; }
    .wr-totals { max-width: none; }
    .wr-statement__actions { flex-direction: column; }
    .wr-statement__actions .btn { width: 100%; }
}

/* Three money tiles on a phone: two side by side, the third full width. */
@media (max-width: 767.98px) {
    .wr-kpis > .col-md-4 { flex: 0 0 50%; max-width: 50%; }
    .wr-kpis > .col-md-4:nth-child(3) { flex-basis: 100%; max-width: 100%; }
    .wr-kpis .wr-kpi { padding: .85rem .9rem; }
    .wr-kpis .wr-kpi__label { font-size: .75rem; }
    .wr-kpis .wr-kpi__icon { width: 26px; height: 26px; font-size: .9rem; }
    .wr-kpis .wr-kpi__value { font-size: 1.25rem; }
}

.wr-lines__qty { display: none; }

/* Invoice lines as small cards on a phone: service + package left, amount right, qty × unit under it. */
@media (max-width: 575.98px) {
    .wr-lines thead { display: none; }
    .wr-lines, .wr-lines tbody { display: block; }
    .wr-lines tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: .2rem .75rem;
        padding: .7rem .85rem;
        border-bottom: 1px solid var(--wr-border);
    }
    .wr-lines tbody tr:last-child { border-bottom: 0; }
    .wr-lines td { display: block; padding: 0 !important; border: 0 !important; text-align: left !important; }
    .wr-lines td:nth-child(1) { grid-column: 1; grid-row: 1; }
    .wr-lines td:nth-child(2) { grid-column: 1; grid-row: 2; color: var(--wr-text-muted); font-size: .8rem; }
    .wr-lines td:nth-child(3) { display: none; }
    .wr-lines td:nth-child(4) { grid-column: 2; grid-row: 2; text-align: right !important; color: var(--wr-text-muted); font-size: .8rem; }
    .wr-lines td:nth-child(5) { grid-column: 2; grid-row: 1; text-align: right !important; }
    .wr-lines__qty { display: inline; }
    .wr-lines__service { display: block; margin: .25rem 0 0; }
}

/* Wide tables scroll inside their frame instead of being clipped. */
.wr-tbl-list { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
.card-body.table-responsive { overflow-x: visible; }

/* Responsive child rows (hidden columns under the ⊕ button). */
.wr-tbl-list table.dataTable > tbody > tr.child ul.dtr-details { width: 100%; }
.wr-tbl-list table.dataTable > tbody > tr.child ul.dtr-details > li { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-bottom-color: var(--wr-border); }
.wr-tbl-list table.dataTable > tbody > tr.child span.dtr-title { color: var(--wr-text-muted); font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.wr-tbl-list table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control::before,
.wr-tbl-list table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control::before { background-color: var(--wr-primary); box-shadow: none; border: 0; }

.wr-tbl-foot .page-link { font-size: .85rem; padding: .35rem .7rem; line-height: 1.4; }

@media (max-width: 575.98px) {
    .wr-tbl-filters { padding: .75rem; }
    .wr-tbl-filters__dates, .wr-daterange { width: 100%; }
    .wr-daterange input.form-control { flex: 1 1 0; min-width: 0; }
    .wr-field--inline { flex: 1 1 100%; }
    .wr-tbl-filters__actions { width: 100%; justify-content: space-between; }
    .wr-tbl-foot { justify-content: space-between; }
    .wr-tbl-foot .dataTables_paginate { width: 100%; margin-left: 0 !important; }
    .wr-tbl-foot .pagination { justify-content: center; flex-wrap: wrap; }
}

/* Responsive expand control: a round +/− before the first cell, whatever the plugin theme draws. */
.wr-tbl-list table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control {
    position: relative;
    padding-left: 2.4rem !important;
    cursor: pointer;
}

.wr-tbl-list table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control::before {
    content: "+" !important;
    position: absolute;
    left: .8rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    margin: 0;
    border: 0;
    border-radius: 50%;
    box-shadow: none;
    background: var(--wr-primary);
    color: #fff;
    font: 700 14px/18px var(--wr-font);
    text-align: center;
    text-indent: 0;
}

.wr-tbl-list table.dataTable.dtr-inline.collapsed > tbody > tr.parent > td.dtr-control::before,
.wr-tbl-list table.dataTable.dtr-inline.collapsed > tbody > tr.dt-hasChild > td.dtr-control::before {
    content: "−" !important;
    background: var(--wr-text-muted);
}

.wr-tbl-list table.dataTable > tbody > tr.child > td { background: var(--wr-surface-2); }

/* Mobile menu: dim the page around it (a tap outside already closes it). A
   huge shadow spread instead of an overlay: the sidebar sits in a lower
   stacking context than anything we could add to <body>. */
@media (max-width: 991.98px) {
    body.sidebar-enable .left-side-menu { box-shadow: 0 0 0 100vmax rgba(15, 20, 32, .38); }
}
@keyframes wr-fade { from { opacity: 0; } to { opacity: 1; } }
