:root {
    --saral-sidebar: #171827;
    --saral-sidebar-hover: #23253c;
    --saral-accent: #6d28d9;
    --saral-accent-soft: #ede9fe;
    --saral-ink: #1f2233;
    --saral-muted: #6b7189;
    --saral-line: #e4e6ef;
    --saral-bg: #f4f5fa;
    --saral-sidebar-width: 252px;
}

body {
    background: var(--saral-bg);
    color: var(--saral-ink);
    font-family: "Segoe UI", Inter, "Helvetica Neue", Arial, sans-serif;
    font-size: 0.925rem;
}

/* ------------------------------------------------------------------ shell */
.saral-shell {
    display: flex;
    min-height: 100vh;
}

.saral-sidebar {
    width: var(--saral-sidebar-width);
    flex: 0 0 var(--saral-sidebar-width);
    background: var(--saral-sidebar);
    color: #b9bcd0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.saral-brand {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: 1.15rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.saral-brand img { width: 38px; height: 38px; }

.saral-brand-text { line-height: 1.1; }

.saral-brand-name {
    color: #fff;
    font-weight: 700;
    letter-spacing: 2px;
    font-size: 1.02rem;
}

.saral-brand-name span { color: #a78bfa; font-weight: 300; }

.saral-brand-sub {
    font-size: .62rem;
    letter-spacing: 1.6px;
    color: #7b7f9c;
    text-transform: uppercase;
}

.saral-nav { padding: .85rem .7rem; flex: 1 1 auto; overflow-y: auto; }

.saral-nav-label {
    font-size: .66rem;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: #61658a;
    padding: .9rem .65rem .4rem;
}

.saral-nav a {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .58rem .65rem;
    border-radius: 8px;
    color: #b9bcd0;
    text-decoration: none;
    font-size: .875rem;
    margin-bottom: 2px;
    transition: background .12s ease, color .12s ease;
}

.saral-nav a:hover { background: var(--saral-sidebar-hover); color: #fff; }

.saral-nav a.active {
    background: linear-gradient(90deg, rgba(109, 40, 217, .95), rgba(147, 51, 234, .75));
    color: #fff;
    font-weight: 600;
}

.saral-nav a i { font-size: 1rem; width: 1.15rem; text-align: center; }

.saral-sidebar-foot {
    padding: .85rem 1.1rem;
    border-top: 1px solid rgba(255, 255, 255, .07);
    font-size: .7rem;
    color: #61658a;
}

.saral-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.saral-topbar {
    background: #fff;
    border-bottom: 1px solid var(--saral-line);
    padding: .7rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 20;
}

.saral-page-title { font-size: 1.06rem; font-weight: 600; margin: 0; }
.saral-page-sub { font-size: .78rem; color: var(--saral-muted); margin: 0; }

.saral-content { padding: 1.4rem 1.5rem 3rem; }

/* ------------------------------------------------------------------ cards */
.saral-card {
    background: #fff;
    border: 1px solid var(--saral-line);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(20, 22, 40, .04);
}

.saral-card-head {
    padding: .85rem 1.15rem;
    border-bottom: 1px solid var(--saral-line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.saral-card-head h2 { font-size: .95rem; font-weight: 600; margin: 0; }
.saral-card-body { padding: 1.15rem; }

.saral-stat {
    background: #fff;
    border: 1px solid var(--saral-line);
    border-radius: 12px;
    padding: .95rem 1.1rem;
    display: flex;
    align-items: center;
    gap: .9rem;
}

.saral-stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 1.15rem;
    background: var(--saral-accent-soft);
    color: var(--saral-accent);
    flex: 0 0 auto;
}

.saral-stat-value { font-size: 1.4rem; font-weight: 700; line-height: 1.1; }
.saral-stat-label { font-size: .74rem; color: var(--saral-muted); text-transform: uppercase; letter-spacing: .6px; }

/* ------------------------------------------------------------------ tables */
table.dataTable thead th {
    background: #fafbfd;
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--saral-muted);
    border-bottom: 1px solid var(--saral-line) !important;
    white-space: nowrap;
}

table.dataTable tbody td { vertical-align: middle; font-size: .86rem; }

.saral-mono { font-family: "Cascadia Mono", Consolas, "SF Mono", monospace; }

.badge-soft-success { background: #e6f6ec; color: #146c43; }
.badge-soft-danger  { background: #fdeaea; color: #b02a37; }
.badge-soft-warning { background: #fff4e0; color: #a06407; }
.badge-soft-info    { background: #e7f1ff; color: #0b5ed7; }
.badge-soft-muted   { background: #eef0f5; color: #5c6274; }

/* ------------------------------------------------------------------ login */
.saral-login {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    background: #0f1020;
}

.saral-login-art {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3.5rem;
    color: #d7d9ec;
    background:
        radial-gradient(900px 480px at 12% 8%, rgba(109, 40, 217, .55), transparent 60%),
        radial-gradient(760px 520px at 82% 88%, rgba(162, 28, 175, .42), transparent 62%),
        #0f1020;
}

.saral-login-art::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(circle at 40% 45%, #000 30%, transparent 78%);
}

.saral-login-art > * { position: relative; z-index: 1; }
.saral-login-art img { width: min(430px, 88%); margin-bottom: 2rem; }
.saral-login-art h1 { font-size: 1.6rem; font-weight: 600; color: #fff; margin-bottom: .7rem; }
.saral-login-art p { max-width: 44ch; color: #9ea2c2; font-size: .92rem; }

.saral-login-features { list-style: none; padding: 0; margin: 2rem 0 0; }
.saral-login-features li { display: flex; gap: .6rem; align-items: center; margin-bottom: .55rem; font-size: .88rem; color: #b3b7d4; }
.saral-login-features i { color: #a78bfa; }

.saral-login-panel {
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
}

.saral-login-form { width: 100%; max-width: 380px; }
.saral-login-form h2 { font-size: 1.32rem; font-weight: 700; margin-bottom: .25rem; }
.saral-login-form .lead { font-size: .88rem; color: var(--saral-muted); margin-bottom: 1.6rem; }

.saral-login-mark { display: none; }

@media (max-width: 991.98px) {
    .saral-login { grid-template-columns: 1fr; }
    .saral-login-art { display: none; }
    .saral-login-panel { background: #f4f5fa; }
    .saral-login-mark { display: block; text-align: center; margin-bottom: 1.5rem; }
    .saral-login-mark img { width: 340px; max-width: 100%; }
    .saral-login-form { background: #fff; padding: 2rem; border-radius: 14px; box-shadow: 0 10px 40px rgba(15, 16, 32, .1); }
}

@media (max-width: 767.98px) {
    .saral-sidebar { position: fixed; z-index: 1040; transform: translateX(-100%); transition: transform .2s ease; }
    .saral-sidebar.open { transform: translateX(0); }
    .saral-content { padding: 1rem; }
}

/* ------------------------------------------------------------------ misc */
.btn-saral {
    background: linear-gradient(135deg, #6d28d9, #9333ea);
    border: none;
    color: #fff;
}

.btn-saral:hover, .btn-saral:focus { background: linear-gradient(135deg, #5b21b6, #7e22ce); color: #fff; }
.btn-saral:disabled { opacity: .65; }

.form-label { font-size: .82rem; font-weight: 600; color: #414660; margin-bottom: .3rem; }
.form-text { font-size: .76rem; }
.required::after { content: " *"; color: #dc3545; }

.readonly-field {
    background: #f7f8fc !important;
    font-weight: 600;
    color: var(--saral-ink);
}

.saral-kv { font-size: .86rem; }
.saral-kv dt { color: var(--saral-muted); font-weight: 500; }
.saral-kv dd { font-weight: 600; margin-bottom: .55rem; }

.override-step { display: none; }
.override-step.active { display: block; }

.saral-code {
    font-family: "Cascadia Mono", Consolas, monospace;
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: 6px;
    color: var(--saral-accent);
}

/* ------------------------------------------------------- wide operational grid */
/* The recharge grid carries a lot of columns. Pinning the action column keeps the
   primary button reachable instead of hiding it behind a horizontal scroll. */
.saral-sticky-actions th:last-child,
.saral-sticky-actions td:last-child {
    position: sticky;
    right: 0;
    background: #fff;
    box-shadow: -8px 0 10px -8px rgba(20, 22, 40, .2);
}

.saral-sticky-actions thead th:last-child { background: #fafbfd; }
.saral-sticky-actions tbody tr:hover td:last-child { background: #f6f7fb; }
.saral-sticky-actions th, .saral-sticky-actions td { padding-left: .55rem; padding-right: .55rem; }

.saral-card-sub {
    font-size: .72rem;
    color: var(--saral-muted);
    margin-top: .15rem;
}
