:root {
    /* Athentech / Sahasra Enterprise theme */
    --scms-primary: #1e6fd9;
    --scms-primary-dark: #1657ab;
    --scms-accent: #00b8a9;
    --scms-sidebar-bg: #10233d;
    --scms-sidebar-hover: #1c3a63;
    --scms-bg: #eef2f7;
    --scms-sidebar-w: 240px;
    --scms-topbar-h: 60px;
    --ath-brand-1: #0b1526;
    --ath-brand-2: #12294a;
    --ath-brand-3: #173a63;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", system-ui, -apple-system, sans-serif; background: var(--scms-bg); color: #1e293b; }

/* ---------- Authenticated shell ---------- */
.scms-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: var(--scms-sidebar-w);
    background: var(--scms-sidebar-bg); color: #cbd5e1; display: flex; flex-direction: column; z-index: 1030;
}
.scms-brand {
    min-height: var(--scms-topbar-h); display: flex; align-items: center; gap: .55rem;
    padding: .55rem 1rem; color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.scms-brand i { color: var(--scms-primary); }
.scms-brand-logo { height: 30px; max-width: 74px; object-fit: contain; background: #fff; border-radius: 5px; padding: 3px 5px; flex: 0 0 auto; }
.scms-brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.1; }
.scms-brand-name { font-size: .95rem; font-weight: 700; }
.scms-brand-by { font-size: .62rem; font-weight: 400; color: #94a3b8; letter-spacing: .4px; }
.scms-nav { flex: 1; overflow-y: auto; padding: .75rem 0; }
.scms-nav-item {
    display: flex; align-items: center; gap: .75rem; padding: .7rem 1.25rem;
    color: #cbd5e1; text-decoration: none; font-size: .92rem; transition: background .15s, color .15s;
}
.scms-nav-item i { width: 20px; text-align: center; }
.scms-nav-item:hover { background: var(--scms-sidebar-hover); color: #fff; }
.scms-nav-item.active { background: var(--scms-primary); color: #fff; border-right: 3px solid #fff; }

.scms-main { margin-left: var(--scms-sidebar-w); min-height: 100vh; }
.scms-topbar {
    height: var(--scms-topbar-h); background: #fff; border-bottom: 1px solid #e2e8f0;
    display: flex; align-items: center; justify-content: space-between; padding: 0 1.5rem;
    position: sticky; top: 0; z-index: 1020;
}
.scms-org { font-weight: 600; color: #475569; }
.scms-user .dropdown-toggle { display: flex; align-items: center; gap: .5rem; text-decoration: none; color: #1e293b; }
.scms-user i { font-size: 1.4rem; color: var(--scms-primary); }
.scms-content { padding: 1.5rem; }

.page-head { margin-bottom: 1.25rem; }
.page-head h1 { font-size: 1.5rem; margin: 0 0 .1rem; }

/* ---------- KPI cards ---------- */
.kpi-card { background: #fff; border-radius: 12px; padding: 1.1rem; display: flex; align-items: center; gap: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.06); border-left: 4px solid var(--scms-primary); }
.kpi-icon { width: 48px; height: 48px; border-radius: 10px; display: grid; place-items: center; font-size: 1.25rem; color: #fff; background: var(--scms-primary); }
.kpi-value { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.kpi-label { color: #64748b; font-size: .82rem; }
.kpi-primary { border-left-color: #1e6fd9; } .kpi-primary .kpi-icon { background: #1e6fd9; }
.kpi-info    { border-left-color: #0ea5e9; } .kpi-info .kpi-icon    { background: #0ea5e9; }
.kpi-warning { border-left-color: #f59e0b; } .kpi-warning .kpi-icon { background: #f59e0b; }
.kpi-success { border-left-color: #22c55e; } .kpi-success .kpi-icon { background: #22c55e; }

.stat-tile { background: #fff; border-radius: 12px; padding: 1.1rem; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.stat-value { font-size: 1.5rem; font-weight: 700; }
.stat-label { color: #64748b; font-size: .82rem; }

/* ---------- Status badges ---------- */
.badge.status-draft         { background: #94a3b8; }
.badge.status-scheduled     { background: #0ea5e9; }
.badge.status-running       { background: #f59e0b; }
.badge.status-completed     { background: #22c55e; }
.badge.status-failed        { background: #ef4444; }
.badge.status-paused        { background: #a855f7; }
.badge.status-cancelled     { background: #64748b; }
.badge.status-pendingapproval { background: #eab308; }

.card { border: none; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.card-header { background: #fff; font-weight: 600; border-bottom: 1px solid #e2e8f0; }

/* ---------- Auth screens ---------- */
.app-guest { display: grid; place-items: center; min-height: 100vh;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%); }
.auth-wrapper { width: 100%; max-width: 400px; padding: 1rem; }
.auth-card { background: #fff; border-radius: 16px; padding: 2rem; box-shadow: 0 10px 40px rgba(0,0,0,.2); }
.auth-brand { text-align: center; margin-bottom: 1.5rem; }
.auth-brand i { font-size: 2.5rem; color: var(--scms-primary); }
.auth-brand h1 { font-size: 1.75rem; margin: .5rem 0 .1rem; }
.auth-brand p { color: #64748b; font-size: .85rem; margin: 0; }
.auth-footer { text-align: center; color: #94a3b8; font-size: .78rem; margin-top: 1.25rem; }

.btn-primary { background: var(--scms-primary); border-color: var(--scms-primary); }
.btn-primary:hover { background: var(--scms-primary-dark); border-color: var(--scms-primary-dark); }

/* hamburger shown only on small screens */
.scms-hamburger { display: none; background: none; border: 0; font-size: 1.3rem; color: #334155; padding: .25rem .55rem; margin-right: .35rem; cursor: pointer; line-height: 1; }
.scms-sidebar-overlay { display: none; }

@media (max-width: 991px) {
    .scms-sidebar {
        transform: translateX(-100%); transition: transform .25s ease;
        z-index: 1050; box-shadow: 2px 0 14px rgba(0,0,0,.25);
    }
    .scms-sidebar.open { transform: translateX(0); }
    .scms-main { margin-left: 0; }
    .scms-hamburger { display: inline-flex; align-items: center; }
    .scms-sidebar-overlay {
        display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45);
        z-index: 1040; opacity: 0; visibility: hidden; transition: opacity .25s;
    }
    .scms-sidebar-overlay.show { opacity: 1; visibility: visible; }
    .scms-topbar { padding: 0 1rem; }
    .scms-org { font-size: .88rem; max-width: 45vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .scms-content { padding: 1rem; }
    .scms-footer { flex-direction: column; gap: .25rem; text-align: center; }
    .page-head h1 { font-size: 1.35rem; }
}

/* ============================================================
   Premium Auth (Athentech branding) — split-screen sign-in
   ============================================================ */
.auth-body { margin: 0; min-height: 100vh; background: #0b1020; }
.auth-split { display: flex; min-height: 100vh; }

/* Left brand panel */
.auth-brandpanel {
    position: relative; overflow: hidden; flex: 1 1 52%;
    background: linear-gradient(135deg, #0b1526 0%, #12294a 55%, #173a63 100%);
    color: #fff; padding: 3rem 3.5rem; display: flex; flex-direction: column; justify-content: space-between;
}
.ath-logo-chip { background: #fff; padding: .55rem 1rem; border-radius: 12px; display: inline-block; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.ath-logo-chip img { height: 36px; display: block; }
.auth-formlogo { display: none; margin-bottom: 1.5rem; text-align: center; }
.auth-formlogo img { height: 44px; }
@media (max-width: 900px) { .auth-formlogo { display: block; } }

.auth-brand-mid { position: relative; z-index: 2; max-width: 520px; }
.auth-product-badge {
    display: inline-block; font-size: .72rem; letter-spacing: 1.5px; text-transform: uppercase;
    background: rgba(255,255,255,.14); padding: .3rem .8rem; border-radius: 999px; margin-bottom: 1.1rem;
    border: 1px solid rgba(255,255,255,.2);
}
.auth-product h1 { font-size: 2.4rem; line-height: 1.15; font-weight: 800; margin: 0 0 1rem; }
.auth-product p { font-size: 1.02rem; color: rgba(255,255,255,.82); line-height: 1.6; margin-bottom: 2rem; }
.auth-features { list-style: none; padding: 0; margin: 0; display: grid; gap: .85rem; }
.auth-features li { display: flex; align-items: center; gap: .8rem; font-size: .95rem; color: rgba(255,255,255,.92); }
.auth-features i { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: rgba(255,255,255,.13); }
.auth-brand-bottom { position: relative; z-index: 2; font-size: .78rem; color: rgba(255,255,255,.6); }

.auth-orb { position: absolute; border-radius: 50%; filter: blur(50px); opacity: .5; }
.auth-orb-1 { width: 340px; height: 340px; background: #00b8a9; top: -80px; right: -80px; }
.auth-orb-2 { width: 300px; height: 300px; background: #1e6fd9; bottom: -100px; left: -60px; opacity: .45; }

/* Right form panel */
.auth-formpanel { flex: 1 1 48%; background: #fff; display: grid; place-items: center; padding: 2rem; }
.auth-formwrap { width: 100%; max-width: 380px; }
.auth-card-head { margin-bottom: 1.75rem; }
.auth-card-head h2 { font-size: 1.7rem; font-weight: 700; margin: 0 0 .25rem; }
.auth-card-head p { color: #64748b; margin: 0; }
.auth-form .form-label { font-weight: 600; font-size: .85rem; color: #334155; }
.input-affix { position: relative; }
.input-affix > i:first-child { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: #94a3b8; pointer-events: none; }
.input-affix .form-control { height: 46px; padding-left: 2.5rem; border-radius: 10px; border-color: #e2e8f0; }
.input-affix .form-control:focus { border-color: var(--scms-primary); box-shadow: 0 0 0 .2rem rgba(79,70,229,.15); }
.pwd-toggle { position: absolute; right: .6rem; top: 50%; transform: translateY(-50%); background: none; border: none; color: #94a3b8; cursor: pointer; }
.btn-auth {
    height: 48px; border-radius: 10px; font-weight: 600; color: #fff; border: none;
    background: linear-gradient(135deg, #1e6fd9, #1657ab);
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem; transition: filter .15s, transform .05s;
}
.btn-auth:hover { filter: brightness(1.07); color: #fff; }
.btn-auth:active { transform: translateY(1px); }
.auth-help { text-align: center; margin-top: 1.5rem; font-size: .82rem; color: #94a3b8; }

@media (max-width: 900px) {
    .auth-brandpanel { display: none; }
    .auth-formpanel { flex: 1 1 100%; }
}

/* ============================================================
   Client (tenant) cards on the Organizations page
   ============================================================ */
.client-card { border: none; border-radius: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.07); transition: box-shadow .15s, transform .15s; border-top: 3px solid var(--scms-primary); }
.client-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,.1); transform: translateY(-2px); }
.client-suspended { opacity: .7; border-top-color: #94a3b8; }
.client-stats { background: #f8fafc; border-radius: 10px; padding: .6rem 0; }
.client-stats .cs-val { font-size: 1.15rem; font-weight: 700; }
.client-stats .cs-lbl { font-size: .72rem; color: #64748b; text-transform: uppercase; letter-spacing: .5px; }
.badge.plan-standard { background: #64748b; }
.badge.plan-enterprise { background: #1e6fd9; }
.badge.plan-premium { background: linear-gradient(135deg, #00b8a9, #1e6fd9); }

/* ---------- Coming-soon / ops module accents ---------- */
.cs-emblem { width: 88px; height: 88px; border-radius: 22px; margin: 0 auto; display: grid; place-items: center;
    font-size: 2.2rem; color: var(--scms-primary); background: rgba(30,111,217,.1); }
.badge.cs-badge { background: rgba(0,184,169,.14); color: #0f766e; font-weight: 600; padding: .5rem .8rem; }
.report-card { border: none; border-radius: 12px; box-shadow: 0 1px 3px rgba(16,35,61,.08); transition: transform .15s, box-shadow .15s; }
.report-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(16,35,61,.12); }
.report-icon { width: 46px; height: 46px; border-radius: 11px; display: grid; place-items: center; font-size: 1.2rem;
    color: var(--scms-primary); background: rgba(30,111,217,.1); margin-bottom: .75rem; }
.notif-unread { background: #f2f7ff; }
.notif-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: .35rem; flex: 0 0 auto; background: #94a3b8; }
.notif-dot.notif-high, .notif-dot.notif-critical { background: #e5433d; }
.notif-dot.notif-normal { background: var(--scms-primary); }
.notif-dot.notif-low { background: #94a3b8; }
.settings-dl dt { color: #6b7a90; font-weight: 600; padding: .35rem 0; }
.settings-dl dd { padding: .35rem 0; margin-bottom: 0; }
.settings-links .list-group-item { border: none; padding: .7rem .25rem; }
.settings-links i { width: 22px; color: var(--scms-primary); }

.badge.cs-live { background: rgba(34,164,93,.14); color: #167c48; font-weight: 600; padding: .4rem .7rem; }
.report-card.text-reset:hover h6 { color: var(--scms-primary); }
