:root {
    --bg: #f4f8fd;
    --surface: #ffffff;
    --text: #0d1930;
    --muted: #647187;
    --border: #dfe7f2;
    --primary: #0876ee;
    --primary-dark: #0062cc;
    --good: #0aa568;
    --warn: #d88700;
    --bad: #d13f46;
    --shadow: 0 18px 48px rgba(25, 49, 86, .07);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Vazirmatn, Tahoma, Arial, sans-serif;
    line-height: 1.7;
}
a { color: var(--primary); text-decoration: none; }
code, pre { direction: ltr; text-align: left; }
pre {
    white-space: pre-wrap;
    background: #111827;
    color: #d6e2ff;
    padding: 18px;
    border-radius: 10px;
    overflow: auto;
}
.shell-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 34px;
    min-height: 82px;
    padding: 8px 42px;
    direction: rtl;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}
.shell-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    white-space: nowrap;
}
.shell-logo {
    width: 230px;
    height: 83px;
    border-radius: 8px;
    object-fit: contain;
    background: #fff;
}
.shell-brand > div {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
}
.shell-header strong { display: inline; font-size: 18px; font-weight: 750; }
.shell-header span { display: inline; color: var(--muted); font-size: 12px; }
.top-nav {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    direction: rtl;
    margin-right: 10px;
}
.top-nav a, .top-nav button {
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #58667d;
    padding: 27px 12px 24px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    position: relative;
}
.top-nav a:hover, .top-nav button:hover { color: var(--primary); }
.top-nav a.active {
    color: var(--primary);
}
.top-nav a.active::after {
    content: "";
    position: absolute;
    right: 10px;
    left: 10px;
    bottom: -13px;
    height: 3px;
    border-radius: 999px 999px 0 0;
    background: var(--primary);
}
.shell-main {
    width: min(1440px, calc(100% - 48px));
    margin: 32px auto 60px;
}
.hero-panel, .panel, .login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
}
.hero-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 30px;
    margin-bottom: 22px;
}
h1, h2 { margin: 0 0 10px; line-height: 1.35; }
p { margin: 0 0 16px; color: var(--muted); }
.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}
.metric {
    position: relative;
    min-height: 120px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 22px 26px 18px 88px;
    box-shadow: 0 10px 28px rgba(25, 49, 86, .05);
    overflow: hidden;
}
.metric span { color: #58667d; font-size: 16px; font-weight: 700; }
.metric strong { display: block; font-size: 32px; margin-top: 10px; line-height: 1; }
.metric.good strong { color: var(--good); }
.metric.warn strong { color: var(--warn); }
.metric.bad strong { color: var(--bad); }
.panel { padding: 24px; margin-bottom: 20px; }
.panel.narrow, .login-card { max-width: 640px; margin: 40px auto; }

.auth-page {
    height: 100vh;
    height: 100svh;
    min-height: 100vh;
    background:
        radial-gradient(circle at 17% 46%, rgba(31, 122, 224, .13), transparent 34%),
        radial-gradient(circle at 73% 36%, rgba(20, 195, 216, .08), transparent 30%),
        linear-gradient(135deg, #fafdff 0%, #f4f8fe 52%, #eef5ff 100%);
    overflow: hidden;
}
.auth-page .shell-header {
    position: fixed;
    inset: 0 0 auto;
    justify-content: flex-start;
    padding: 24px 46px;
    background: transparent;
    border-bottom: 0;
    box-shadow: none;
    backdrop-filter: none;
}
.auth-page .shell-logo {
    width: 54px;
    height: 54px;
    border-radius: 14px;
}
.auth-page .shell-header strong {
    color: #07142d;
    font-size: 23px;
    font-weight: 800;
    letter-spacing: 0;
}
.auth-page .shell-header span { display: none; }
.auth-page .shell-main {
    width: min(1540px, calc(100% - 96px));
    height: 100vh;
    height: 100svh;
    min-height: 0;
    margin: 0 auto;
    padding: 34px 0;
    display: flex;
    align-items: center;
    overflow: hidden;
}
.login-shell {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 500px;
    align-items: center;
    gap: clamp(44px, 5vw, 88px);
    direction: ltr;
}
.login-shell > * { direction: rtl; }
.login-visual {
    position: relative;
    min-height: min(620px, calc(100vh - 90px));
    min-height: min(620px, calc(100svh - 90px));
    overflow: hidden;
}
.map-texture {
    position: absolute;
    inset: 2% 0 4% 0;
    opacity: .6;
    background:
        radial-gradient(circle, rgba(31, 122, 224, .16) 1.4px, transparent 1.6px) 0 0 / 15px 15px,
        radial-gradient(circle at 34% 45%, rgba(255, 255, 255, .9), transparent 28%),
        radial-gradient(circle at 47% 50%, rgba(31, 122, 224, .18), transparent 24%);
    mask-image: linear-gradient(90deg, rgba(0, 0, 0, .85), rgba(0, 0, 0, .68), transparent 98%);
}
.hub-graphic {
    position: absolute;
    inset: 0;
}
.hub-graphic img {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(350px, 36vw);
    transform: translate(-50%, -50%);
    opacity: .9;
    filter: drop-shadow(0 22px 34px rgba(30, 107, 205, .12));
}
.hub-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    border: 1px solid rgba(31, 122, 224, .15);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}
.ring-one { width: 390px; height: 390px; }
.ring-two { width: 530px; height: 530px; }
.route {
    position: absolute;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(31, 122, 224, .88), rgba(20, 156, 228, .18));
    transform-origin: right center;
}
.route::after {
    content: "";
    position: absolute;
    left: -5px;
    top: 50%;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #1f7ae0;
    transform: translateY(-50%);
    box-shadow: 0 0 0 7px rgba(31, 122, 224, .12);
}
.route-a {
    top: 40%;
    left: 13%;
    width: 270px;
    transform: rotate(12deg);
}
.route-b {
    top: 53%;
    left: 10%;
    width: 305px;
}
.route-c {
    top: 66%;
    left: 14%;
    width: 250px;
    transform: rotate(-13deg);
}
.client-node {
    position: absolute;
    width: 88px;
    height: 88px;
    border-radius: 28px;
    background:
        linear-gradient(#fff, #fff) padding-box,
        linear-gradient(135deg, rgba(31, 122, 224, .28), rgba(255, 144, 16, .18)) border-box;
    border: 1px solid transparent;
    box-shadow: 0 18px 42px rgba(36, 91, 156, .14);
}
.client-node::before {
    content: "";
    position: absolute;
    inset: 24px 29px;
    border: 3px solid #143b77;
    border-radius: 7px;
    background: linear-gradient(180deg, #eaf7ff, #fff);
}
.client-node::after {
    content: "";
    position: absolute;
    right: 18px;
    bottom: 18px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #1f7ae0;
    box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .08), 0 0 0 6px rgba(31, 122, 224, .1);
}
.node-phone { top: 27%; left: 8%; }
.node-app { top: 58%; left: 9%; }
.node-user-a, .node-user-b {
    width: 76px;
    height: 76px;
    border-radius: 50%;
}
.node-user-a::before, .node-user-b::before {
    inset: 22px 25px 25px;
    border: 0;
    border-radius: 50% 50% 45% 45%;
    background: #315b98;
}
.node-user-a::after, .node-user-b::after {
    inset: auto 18px 15px auto;
    width: 38px;
    height: 16px;
    border-radius: 18px 18px 9px 9px;
    background: #315b98;
    box-shadow: none;
}
.node-user-a { top: 34%; left: 72%; }
.node-user-b { top: 59%; left: 76%; }
.login-card {
    width: 100%;
    max-width: 500px;
    margin: 0;
    padding: 30px 48px;
    text-align: center;
    border-radius: 22px;
    border: 1px solid rgba(191, 205, 225, .92);
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 26px 70px rgba(22, 47, 86, .15);
    backdrop-filter: blur(18px);
}
.login-logo {
    display: block;
    width: 168px;
    height: 84px;
    object-fit: contain;
    margin: 0 auto 14px;
}
.login-card h1 {
    margin: 0 0 6px;
    color: #07142d;
    font-size: 29px;
    font-weight: 850;
    line-height: 1.2;
}
.login-card h2 {
    margin: 0 0 24px;
    color: #0f78df;
    font-size: 21px;
    font-weight: 800;
}
.login-form {
    display: grid;
    gap: 14px;
}
.login-field {
    position: relative;
    display: block;
    color: #65748b;
    font-size: 0;
}
.login-field span {
    position: absolute;
    top: 50%;
    right: 17px;
    z-index: 1;
    color: #66758d;
    font-size: 14px;
    line-height: 1;
    pointer-events: none;
    transform: translateY(-50%);
}
.login-field input {
    height: 54px;
    padding: 0 112px 0 18px;
    border-radius: 11px;
    border-color: #cfdbea;
    background: rgba(255, 255, 255, .94);
    color: #10213e;
    font-size: 15px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
}
.login-field input:focus {
    outline: 0;
    border-color: #1f7ae0;
    box-shadow: 0 0 0 4px rgba(31, 122, 224, .12);
}
.login-submit {
    width: 100%;
    min-height: 56px;
    margin-top: 4px;
    border-radius: 11px;
    background: linear-gradient(135deg, #0876ee, #006de2);
    font-weight: 800;
    box-shadow: 0 14px 27px rgba(0, 110, 226, .28);
}
.login-submit:hover {
    background: linear-gradient(135deg, #006fe3, #075fc0);
}
.dashboard-page {
    background:
        radial-gradient(circle at 82% 12%, rgba(8, 118, 238, .07), transparent 28%),
        linear-gradient(180deg, #f7fbff 0%, #f2f7fd 100%);
}
.dashboard-page .shell-main {
    width: min(1760px, calc(100% - 96px));
    margin-top: 40px;
}
.dashboard-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 28px;
}
.add-customer {
    min-width: 190px;
    min-height: 58px;
    gap: 14px;
    border-radius: 9px;
    background: linear-gradient(180deg, #0879f4, #006ae0);
    box-shadow: 0 14px 26px rgba(0, 104, 226, .21);
    font-size: 17px;
    font-weight: 800;
}
.add-customer::before {
    content: "+";
    font-size: 30px;
    line-height: 1;
    font-weight: 300;
    margin-top: -2px;
}
.dashboard-metrics {
    margin-bottom: 26px;
}
.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(360px, .58fr) minmax(0, 1fr);
    gap: 24px;
    align-items: stretch;
    direction: ltr;
}
.dashboard-grid > * { direction: rtl; }
.dashboard-grid .panel {
    margin-bottom: 0;
}
.gateway-summary,
.usage-panel {
    padding: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 14px 34px rgba(23, 49, 83, .06);
}
.panel-title {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    min-height: 76px;
    padding: 20px 28px;
    border-bottom: 1px solid var(--border);
}
.panel-title h2 {
    margin: 0;
    color: #0d1930;
    font-size: 22px;
    font-weight: 850;
}
.gateway-summary dl {
    margin: 0;
}
.gateway-summary dl div {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    min-height: 64px;
    padding: 0 28px;
    border-bottom: 1px solid var(--border);
}
.gateway-summary dt {
    color: #26334b;
    font-size: 16px;
    font-weight: 700;
}
.gateway-summary dd {
    margin: 0;
    color: #101b32;
    font-size: 16px;
    font-weight: 800;
    direction: ltr;
    text-align: left;
}
.good-value { color: var(--good) !important; font-weight: 850; }
.bad-value { color: var(--bad) !important; font-weight: 850; }
.strong-cell { font-weight: 850; color: #15223a; }
.ltr { direction: ltr; text-align: left; }
.panel-link {
    display: flex;
    align-items: center;
    min-height: 66px;
    padding: 0 28px;
    border-top: 1px solid var(--border);
    color: var(--primary);
    font-size: 17px;
    font-weight: 850;
}
.panel-link::after {
    content: "";
    width: 9px;
    height: 9px;
    margin-right: 12px;
    border-top: 2px solid currentColor;
    border-left: 2px solid currentColor;
    transform: rotate(-45deg);
}
.dashboard-table th,
.dashboard-table td {
    height: 56px;
    padding: 14px 20px;
    text-align: right;
    vertical-align: middle;
}
.dashboard-table thead th {
    color: #56647c;
    font-size: 14px;
    font-weight: 800;
    background: rgba(247, 250, 254, .66);
}
.dashboard-table tbody td {
    color: #142039;
    font-size: 16px;
}
.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
}
th, td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border);
    text-align: right;
    vertical-align: top;
}
th { color: var(--muted); font-weight: 600; font-size: 13px; }
td span { color: var(--muted); font-size: 12px; }
.pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 2px 10px;
    background: #eef4fc;
    color: var(--primary);
    font-size: 12px;
}
.pill.active, .pill.sent { background: #e7f7f0; color: var(--good); }
.pill.failed, .pill.disabled { background: #fdecef; color: var(--bad); }
.pill.invalid_token { background: #fff3d8; color: var(--warn); }
.pill.pending, .pill.processing { background: #eaf3ff; color: #2367a8; }
.stack, .grid-form { display: grid; gap: 14px; }
.grid-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-form textarea, .grid-form .check, .grid-form button { grid-column: 1 / -1; }
.grid-form.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; }
.grid-form.compact button { grid-column: auto; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
input, textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 11px 12px;
    font: inherit;
    color: var(--text);
    background: #fff;
}
select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 11px 12px;
    font: inherit;
    color: var(--text);
    background: #fff;
}
textarea { min-height: 92px; resize: vertical; }
button, .link-button {
    border: 0;
    border-radius: 9px;
    padding: 11px 18px;
    font: inherit;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}
.primary {
    background: var(--primary);
    color: #fff;
}
.primary:hover { background: var(--primary-dark); color: #fff; }
.danger { background: var(--bad); color: #fff; }
.alert {
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
}
.alert.bad { background: #fdecef; color: var(--bad); }
.alert.warn { background: #fff3d8; color: #8a5700; }
.secret-box {
    direction: ltr;
    text-align: left;
    background: #eaf3ff;
    border: 1px solid #b8d7ff;
    color: #0f4d91;
    border-radius: 10px;
    padding: 16px;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    overflow-wrap: anywhere;
    margin: 12px 0 16px;
}
.kv {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.kv div {
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 10px 12px;
}
.kv dt { color: var(--muted); font-size: 12px; }
.kv dd { margin: 2px 0 0; direction: ltr; text-align: left; overflow-wrap: anywhere; }
.empty { text-align: center; color: var(--muted); padding: 30px; }

@media (max-width: 820px) {
    .shell-header, .hero-panel, .panel-head { align-items: stretch; flex-direction: column; }
    .top-nav { overflow-x: auto; padding-bottom: 3px; }
    .top-nav a, .top-nav button { padding: 10px 12px; }
    .top-nav a.active::after { bottom: 0; }
    .metric-grid, .grid-form, .kv { grid-template-columns: 1fr; }
    table { display: block; overflow-x: auto; white-space: nowrap; }
    .dashboard-page .shell-main {
        width: min(100% - 28px, 620px);
        margin-top: 22px;
    }
    .dashboard-actions {
        justify-content: stretch;
        margin-bottom: 16px;
    }
    .add-customer {
        width: 100%;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .metric {
        min-height: 108px;
    }
    .panel-title {
        min-height: 64px;
        padding: 16px 18px;
    }
    .gateway-summary dl div,
    .panel-link {
        padding-inline: 18px;
    }
    .auth-page .shell-header {
        position: static;
        padding: 18px 20px 0;
    }
    .auth-page .shell-main {
        width: min(100% - 32px, 520px);
        height: 100vh;
        height: 100svh;
        min-height: 0;
        padding: 18px 0;
    }
    .login-shell {
        display: block;
    }
    .login-visual {
        display: none;
    }
    .login-card {
        padding: 26px 22px;
        border-radius: 18px;
    }
    .login-logo {
        width: 150px;
        height: 76px;
    }
    .login-card h1 {
        font-size: 25px;
    }
    .login-card h2 {
        font-size: 19px;
        margin-bottom: 20px;
    }
}

@media (min-width: 821px) and (max-width: 1120px) {
    .dashboard-page .shell-main {
        width: min(100% - 48px, 960px);
    }
    .dashboard-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .auth-page .shell-main {
        width: min(100% - 56px, 760px);
    }
    .login-shell {
        grid-template-columns: 1fr;
    }
    .login-visual {
        display: none;
    }
    .login-card {
        justify-self: center;
    }
}

@media (max-height: 760px) and (min-width: 821px) {
    .auth-page .shell-main {
        padding: 22px 0;
    }
    .login-visual {
        min-height: calc(100vh - 56px);
        min-height: calc(100svh - 56px);
    }
    .login-card {
        padding: 26px 44px;
        border-radius: 20px;
    }
    .login-logo {
        width: 150px;
        height: 76px;
        margin-bottom: 10px;
    }
    .login-card h1 {
        font-size: 27px;
    }
    .login-card h2 {
        margin-bottom: 18px;
        font-size: 20px;
    }
    .login-field input {
        height: 50px;
    }
    .login-submit {
        min-height: 52px;
    }
}

/* Dashboard scale tuning after visual QA */
.dashboard-page .shell-header {
    min-height: 82px;
    padding: 8px 42px;
}
.dashboard-page .shell-logo {
    width: 230px;
    height: 83px;
    border-radius: 8px;
}
.dashboard-page .shell-header strong {
    font-size: 17px;
    font-weight: 750;
}
.dashboard-page .shell-header span {
    font-size: 12px;
}
.dashboard-page .top-nav {
    gap: 8px;
}
.dashboard-page .top-nav a,
.dashboard-page .top-nav button {
    padding: 18px 10px 17px;
    font-size: 14px;
    font-weight: 600;
}
.dashboard-page .top-nav a.active::after {
    bottom: -9px;
}
.dashboard-page .shell-main {
    width: min(1520px, calc(100% - 72px));
    margin-top: 24px;
}
.dashboard-actions {
    margin-bottom: 20px;
}
.add-customer {
    min-width: 156px;
    min-height: 46px;
    gap: 10px;
    border-radius: 8px;
    font-size: 15px;
}
.add-customer::before {
    font-size: 24px;
}
.dashboard-metrics {
    gap: 16px;
    margin-bottom: 22px;
}
.dashboard-page .metric {
    min-height: 92px;
    border-radius: 10px;
    padding: 16px 20px 14px 72px;
}
.dashboard-page .metric span {
    font-size: 14px;
}
.dashboard-page .metric strong {
    margin-top: 6px;
    font-size: 26px;
}
.dashboard-grid {
    grid-template-columns: 420px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}
.gateway-summary,
.usage-panel {
    border-radius: 10px;
}
.panel-title {
    min-height: 56px;
    padding: 14px 20px;
}
.panel-title h2 {
    font-size: 18px;
}
.gateway-summary dl div {
    min-height: 46px;
    padding: 0 20px;
}
.gateway-summary dt,
.gateway-summary dd {
    font-size: 14px;
}
.panel-link {
    min-height: 48px;
    padding: 0 20px;
    font-size: 15px;
}
.dashboard-table th,
.dashboard-table td {
    height: 44px;
    padding: 10px 16px;
}
.dashboard-table thead th {
    font-size: 13px;
}
.dashboard-table tbody td {
    font-size: 14px;
}
.dashboard-page .pill {
    padding: 1px 9px;
    font-size: 12px;
}

@media (max-width: 820px) {
    .dashboard-page .shell-header {
        min-height: auto;
        padding: 12px 16px;
    }
    .dashboard-page .shell-main {
        width: min(100% - 28px, 620px);
        margin-top: 18px;
    }
    .dashboard-page .metric {
        min-height: 86px;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 821px) and (max-width: 1120px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Font Awesome UI icon system */
.fa-solid {
    display: inline-block;
    flex: 0 0 auto;
}
.top-nav a,
.top-nav button,
button,
.link-button,
.inline-action,
.actions a,
.panel-link {
    gap: 8px;
}
.top-nav a,
.top-nav button {
    display: inline-flex;
    align-items: center;
}
.top-nav a span,
.top-nav button span {
    color: inherit;
    font-size: inherit;
}
.top-nav .fa-solid {
    font-size: 14px;
}
.panel-head h1,
.panel h1 {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.panel-head h1 .fa-solid,
.panel h1 .fa-solid {
    color: var(--primary);
    font-size: .82em;
}
.add-customer::before,
.panel-link::after {
    content: none;
}
.metric-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    transform: translateY(-50%);
}
.metric-icon .fa-solid {
    font-size: 21px;
}
.metric.good .metric-icon {
    color: var(--good);
    background: rgba(10, 165, 104, .12);
}
.metric.bad .metric-icon {
    color: var(--bad);
    background: rgba(209, 63, 70, .12);
}
.metric.warn .metric-icon {
    color: var(--warn);
    background: rgba(216, 135, 0, .12);
}
.panel-fa {
    color: var(--primary);
    font-size: 20px;
}
.panel-link {
    justify-content: flex-start;
}
.panel-link .fa-solid {
    font-size: 13px;
}
.actions {
    white-space: nowrap;
}
.actions a,
.inline-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.actions a + a {
    margin-right: 12px;
}
.actions .fa-solid,
.inline-action .fa-solid {
    font-size: 12px;
}
.login-field .fa-solid {
    position: absolute;
    top: 50%;
    right: 16px;
    z-index: 2;
    color: #7a889c;
    font-size: 14px;
    transform: translateY(-50%);
    pointer-events: none;
}
.login-field span {
    right: 38px;
}
.login-field input {
    padding-right: 124px;
}
.login-submit {
    gap: 8px;
}
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
}
.alert::before {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    line-height: 1;
}
.alert.bad::before {
    content: "\f057";
}
.alert.warn::before {
    content: "\f071";
}

/* Keep legacy KPI CSS from overriding Font Awesome glyphs. */
.metric .metric-icon .fa-solid::before {
    position: static !important;
    display: inline-block !important;
    width: auto !important;
    height: auto !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: none !important;
    box-shadow: none !important;
    transform: none !important;
    clip-path: none !important;
}
.metric .metric-icon .fa-solid::after {
    content: none !important;
    display: none !important;
}
.metric .metric-icon .fa-circle-check::before { content: "\f058" !important; }
.metric .metric-icon .fa-circle-xmark::before { content: "\f057" !important; }
.metric .metric-icon .fa-triangle-exclamation::before { content: "\f071" !important; }
.metric .metric-icon .fa-circle-info::before { content: "\f05a" !important; }

/* Shared admin page redesign */
.admin-page:not(.dashboard-page) {
    background:
        radial-gradient(circle at 82% 10%, rgba(8, 118, 238, .055), transparent 25%),
        linear-gradient(180deg, #f7fbff 0%, #f2f7fd 100%);
}
.admin-page:not(.dashboard-page) .shell-main {
    width: min(1320px, calc(100% - 72px));
    margin-top: 26px;
}
.admin-page .panel,
.admin-page .panel-head {
    border-radius: 10px;
}
.admin-page .panel {
    padding: 20px;
    box-shadow: 0 14px 34px rgba(23, 49, 83, .055);
}
.admin-page .panel + .panel {
    margin-top: 18px;
}
.admin-page .panel-head {
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 14px 34px rgba(23, 49, 83, .055);
    padding: 16px 20px;
}
.admin-page .panel-head h1,
.admin-page .panel h1 {
    margin-bottom: 0;
    font-size: 22px;
    font-weight: 850;
}
.admin-page .panel h2 {
    font-size: 18px;
    font-weight: 850;
}
.admin-page .panel p {
    max-width: 820px;
    color: #607089;
}
.admin-page table {
    border: 1px solid var(--border);
    border-radius: 10px;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
}
.admin-page th,
.admin-page td {
    height: 46px;
    padding: 10px 14px;
    vertical-align: middle;
}
.admin-page th {
    background: rgba(247, 250, 254, .9);
    color: #56647c;
    font-size: 13px;
    font-weight: 800;
}
.admin-page td {
    color: #142039;
    font-size: 14px;
}
.admin-page td strong {
    font-weight: 850;
}
.admin-page td span {
    font-size: 12px;
}
.admin-page .grid-form {
    gap: 16px;
}
.admin-page .grid-form.compact {
    gap: 12px;
}
.admin-page label {
    color: #5d6b82;
    font-weight: 700;
}
.admin-page input,
.admin-page textarea,
.admin-page select {
    border-color: #d5dfec;
    background: #fff;
}
.admin-page input:focus,
.admin-page textarea:focus,
.admin-page select:focus {
    outline: 0;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(8, 118, 238, .1);
}
.admin-page button,
.admin-page .link-button {
    min-height: 42px;
    border-radius: 8px;
    font-weight: 800;
}
.admin-page .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.admin-page .actions a {
    min-height: 30px;
    padding: 4px 9px;
    border-radius: 999px;
    background: #eef5ff;
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
}
.admin-page .actions a + a {
    margin-right: 0;
}
.admin-page .kv {
    gap: 12px;
}
.admin-page .kv div {
    min-height: 68px;
    border-radius: 10px;
    background: #fff;
}
.admin-page .kv dt {
    color: #66758d;
    font-weight: 800;
}
.admin-page .kv dd {
    color: #142039;
    font-weight: 800;
}
.admin-page .secret-box,
.admin-page pre {
    border-radius: 10px;
}
.admin-page .empty {
    height: 84px;
}

@media (max-width: 820px) {
    .admin-page .shell-header {
        align-items: flex-start;
        direction: rtl;
    }
    .admin-page .top-nav {
        justify-content: flex-start;
        direction: rtl;
    }
    .admin-page:not(.dashboard-page) .shell-main {
        width: min(100% - 28px, 620px);
        margin-top: 18px;
    }
    .admin-page .panel-head {
        gap: 12px;
    }
    .admin-page .grid-form,
    .admin-page .grid-form.compact {
        grid-template-columns: 1fr;
    }
}

/* Match every admin screen to the dashboard typography scale */
.admin-page:not(.dashboard-page) .shell-header {
    min-height: 82px;
    padding: 8px 42px;
}
.admin-page:not(.dashboard-page) .shell-logo {
    width: 230px;
    height: 83px;
    border-radius: 8px;
}
.admin-page:not(.dashboard-page) .shell-header strong {
    font-size: 17px;
    font-weight: 750;
}
.admin-page:not(.dashboard-page) .shell-header span {
    font-size: 12px;
}
.admin-page:not(.dashboard-page) .top-nav {
    gap: 8px;
}
.admin-page:not(.dashboard-page) .top-nav a,
.admin-page:not(.dashboard-page) .top-nav button {
    padding: 18px 10px 17px;
    font-size: 14px;
    font-weight: 600;
}
.admin-page:not(.dashboard-page) .top-nav a.active::after {
    bottom: -9px;
}
.admin-page:not(.dashboard-page) .panel-head {
    padding: 14px 20px;
}
.admin-page:not(.dashboard-page) .panel {
    padding: 18px 20px;
}
.admin-page:not(.dashboard-page) .panel-head h1,
.admin-page:not(.dashboard-page) .panel h1 {
    font-size: 18px;
    font-weight: 850;
}
.admin-page:not(.dashboard-page) .panel h2 {
    font-size: 17px;
    font-weight: 850;
}
.admin-page:not(.dashboard-page) .panel p {
    font-size: 14px;
    line-height: 1.75;
}
.admin-page:not(.dashboard-page) th,
.admin-page:not(.dashboard-page) td {
    height: 44px;
    padding: 10px 16px;
}
.admin-page:not(.dashboard-page) th {
    font-size: 13px;
}
.admin-page:not(.dashboard-page) td {
    font-size: 14px;
}
.admin-page:not(.dashboard-page) label {
    font-size: 13px;
    font-weight: 700;
}
.admin-page:not(.dashboard-page) input,
.admin-page:not(.dashboard-page) textarea,
.admin-page:not(.dashboard-page) select {
    font-size: 14px;
}
.admin-page:not(.dashboard-page) button,
.admin-page:not(.dashboard-page) .link-button {
    min-height: 42px;
    font-size: 14px;
    font-weight: 800;
}
.admin-page:not(.dashboard-page) .actions a {
    font-size: 12px;
    font-weight: 800;
}
.admin-page:not(.dashboard-page) .kv dt {
    font-size: 12px;
}
.admin-page:not(.dashboard-page) .kv dd {
    font-size: 14px;
}
