/* ==========================================================================
   EMI LOCK — PREMIUM DEVICE MANAGEMENT CONSOLE
   File: static/style.css

   Design goals
   --------------------------------------------------------------------------
   • Premium SaaS / fintech / device-management appearance
   • Fully responsive: desktop, laptop, tablet and mobile
   • Large + small cards without visual clutter
   • Strong Font Awesome icon treatment
   • Smooth micro-interactions
   • Responsive sidebar + mobile bottom navigation
   • Tables that remain usable on smaller screens
   • Premium status badges
   • Toasts, alerts, modals and loading states
   • Device / payment / command / map / activity components
   ========================================================================== */


/* ==========================================================================
   01. DESIGN TOKENS
   ========================================================================== */

:root {
    --bg: #f5f7fb;
    --bg-soft: #f8fafc;
    --bg-deep: #070a10;

    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --surface-muted: #f1f5f9;

    --sidebar: #090d15;
    --sidebar-2: #0d121d;
    --sidebar-3: #111827;

    --text: #0f172a;
    --text-2: #334155;
    --text-3: #64748b;
    --text-4: #94a3b8;
    --white: #ffffff;

    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-soft: #eff6ff;
    --primary-ring: rgba(37, 99, 235, 0.18);

    --success: #16a34a;
    --success-2: #15803d;
    --success-soft: #f0fdf4;

    --danger: #dc2626;
    --danger-2: #b91c1c;
    --danger-soft: #fef2f2;

    --warning: #d97706;
    --warning-2: #b45309;
    --warning-soft: #fffbeb;

    --purple: #7c3aed;
    --purple-soft: #f5f3ff;

    --cyan: #0891b2;
    --cyan-soft: #ecfeff;

    --border: #e5eaf1;
    --border-strong: #d9e0ea;

    --shadow-xs:
        0 1px 2px rgba(15, 23, 42, 0.04);

    --shadow-sm:
        0 6px 18px rgba(15, 23, 42, 0.05);

    --shadow-md:
        0 12px 35px rgba(15, 23, 42, 0.08);

    --shadow-lg:
        0 25px 70px rgba(15, 23, 42, 0.14);

    --shadow-premium:
        0 24px 70px rgba(15, 23, 42, 0.09),
        0 2px 8px rgba(15, 23, 42, 0.04);

    --radius-xs: 8px;
    --radius-sm: 12px;
    --radius: 16px;
    --radius-lg: 20px;
    --radius-xl: 26px;

    --sidebar-width: 278px;
    --topbar-height: 82px;

    --ease:
        cubic-bezier(0.2, 0.75, 0.2, 1);

    --fast: 160ms;
    --normal: 260ms;
    --slow: 420ms;
}


/* ==========================================================================
   02. RESET
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    width: 100%;
    min-height: 100%;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    overflow-x: hidden;

    color: var(--text);
    background: var(--bg);

    font-family:
        "Inter",
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    font-size: 14px;
    line-height: 1.55;

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.sidebar-open {
    overflow: hidden;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

img,
svg {
    display: block;
    max-width: 100%;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
    margin-top: 0;
}

h1,
h2,
h3,
h4,
h5,
h6,
.brand,
.page-title,
.stat-value {
    font-family:
        "Manrope",
        "Inter",
        sans-serif;
}

::selection {
    color: var(--white);
    background: var(--primary);
}

:focus-visible {
    outline: 3px solid var(--primary-ring);
    outline-offset: 2px;
}


/* ==========================================================================
   03. SCROLLBAR
   ========================================================================== */

* {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: #cbd5e1;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
    background-clip: padding-box;
}


/* ==========================================================================
   04. APP SHELL
   ========================================================================== */

.app-shell {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

.app-workspace {
    width: calc(100% - var(--sidebar-width));
    min-width: 0;
    margin-left: var(--sidebar-width);
}

.app-main {
    min-height: calc(100vh - var(--topbar-height));
}

.page-content {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 30px 34px 40px;
}


/* ==========================================================================
   05. SIDEBAR
   ========================================================================== */

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 900;

    display: flex;
    flex-direction: column;

    width: var(--sidebar-width);
    height: 100vh;
    padding: 20px 16px 16px;

    color: #d8e0eb;
    background:
        radial-gradient(
            circle at 20% 0%,
            rgba(37, 99, 235, 0.14),
            transparent 30%
        ),
        linear-gradient(
            180deg,
            #080c13 0%,
            #0b1019 55%,
            #070a10 100%
        );

    border-right: 1px solid rgba(255, 255, 255, 0.055);
}

.sidebar-brand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 62px;
    padding: 2px 5px 15px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    display: inline-grid;
    place-items: center;

    width: 44px;
    height: 44px;

    border-radius: 14px;
    background:
        linear-gradient(
            145deg,
            rgba(59, 130, 246, 0.24),
            rgba(37, 99, 235, 0.08)
        );

    border: 1px solid rgba(96, 165, 250, 0.18);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 8px 20px rgba(0, 0, 0, 0.15);
}

.brand-logo-inner {
    display: grid;
    place-items: center;

    width: 34px;
    height: 34px;

    border-radius: 11px;
    color: #fff;

    background:
        linear-gradient(
            135deg,
            #3b82f6,
            #1d4ed8
        );

    box-shadow:
        0 8px 22px rgba(37, 99, 235, 0.32);
}

.brand-logo-inner i {
    font-size: 16px;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.brand-copy strong {
    color: #ffffff;
    font-size: 17px;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.brand-copy small {
    margin-top: 4px;
    color: #7f8ca0;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.sidebar-close {
    display: none;
    place-items: center;

    width: 38px;
    height: 38px;

    border: 0;
    border-radius: 12px;

    color: #94a3b8;
    background: rgba(255, 255, 255, 0.055);
}

.sidebar-close:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}


/* ==========================================================================
   06. WORKSPACE CARD
   ========================================================================== */

.workspace-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 11px;

    margin: 5px 0 22px;
    padding: 13px 12px;

    border-radius: 15px;

    background:
        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.07),
            rgba(255, 255, 255, 0.025)
        );

    border: 1px solid rgba(255, 255, 255, 0.07);
}

.workspace-icon {
    display: grid;
    place-items: center;

    width: 36px;
    height: 36px;

    color: #93c5fd;
    background: rgba(37, 99, 235, 0.14);

    border: 1px solid rgba(96, 165, 250, 0.12);
    border-radius: 11px;
}

.workspace-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.workspace-copy span {
    color: #77849a;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.workspace-copy strong {
    overflow: hidden;
    margin-top: 2px;

    color: #e5ebf3;
    font-size: 12px;
    font-weight: 650;

    white-space: nowrap;
    text-overflow: ellipsis;
}

.workspace-status {
    display: grid;
    place-items: center;

    width: 26px;
    height: 26px;

    border-radius: 50%;
    background: rgba(34, 197, 94, 0.08);
}

.workspace-status-dot {
    width: 7px;
    height: 7px;

    border-radius: 50%;
    background: #22c55e;

    box-shadow:
        0 0 0 4px rgba(34, 197, 94, 0.1),
        0 0 13px rgba(34, 197, 94, 0.6);

    animation: statusPulse 2.4s ease infinite;
}


/* ==========================================================================
   07. SIDEBAR NAV
   ========================================================================== */

.sidebar-nav {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0 2px 12px;
}

.nav-group {
    margin-bottom: 21px;
}

.nav-section-label {
    display: block;
    margin: 0 11px 7px;

    color: #586579;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.nav-item {
    position: relative;

    display: flex;
    align-items: center;
    gap: 11px;

    min-height: 44px;
    margin: 4px 0;
    padding: 7px 10px;

    border: 1px solid transparent;
    border-radius: 12px;

    color: #8f9aae;
    font-size: 13px;
    font-weight: 600;

    transition:
        color var(--fast) ease,
        background var(--normal) var(--ease),
        border var(--normal) var(--ease),
        transform var(--normal) var(--ease);
}

.nav-item::after {
    content: "";

    position: absolute;
    right: 9px;

    width: 4px;
    height: 4px;

    border-radius: 50%;

    background: transparent;

    transition:
        background var(--fast),
        box-shadow var(--fast);
}

.nav-item:hover {
    color: #edf4ff;
    background: rgba(255, 255, 255, 0.055);
    transform: translateX(2px);
}

.nav-item.active {
    color: #ffffff;

    border-color: rgba(96, 165, 250, 0.13);

    background:
        linear-gradient(
            90deg,
            rgba(37, 99, 235, 0.2),
            rgba(37, 99, 235, 0.07)
        );

    box-shadow:
        inset 3px 0 0 #3b82f6;
}

.nav-item.active::after {
    background: #60a5fa;
    box-shadow: 0 0 8px rgba(96, 165, 250, 0.7);
}

.nav-icon {
    display: grid;
    place-items: center;

    width: 30px;
    height: 30px;

    border-radius: 9px;

    background: rgba(255, 255, 255, 0.035);

    transition:
        background var(--normal),
        color var(--normal),
        transform var(--normal);
}

.nav-icon i {
    font-size: 13px;
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.12);
}

.nav-item:hover .nav-icon {
    transform: scale(1.04);
}


/* ==========================================================================
   08. SIDEBAR FOOTER
   ========================================================================== */

.sidebar-bottom {
    display: grid;
    gap: 10px;
    padding-top: 10px;

    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.security-card {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 10px;

    border-radius: 13px;

    background: rgba(34, 197, 94, 0.055);
    border: 1px solid rgba(34, 197, 94, 0.09);
}

.security-card-icon {
    display: grid;
    place-items: center;

    width: 33px;
    height: 33px;

    flex: 0 0 33px;

    color: #86efac;

    border-radius: 10px;
    background: rgba(34, 197, 94, 0.1);
}

.security-card-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.security-card-copy strong {
    color: #d9efe0;
    font-size: 11px;
}

.security-card-copy span {
    margin-top: 1px;
    color: #73877a;
    font-size: 9px;
}

.sidebar-user {
    display: grid;
    grid-template-columns: 38px 1fr 35px;
    align-items: center;
    gap: 9px;

    min-width: 0;
    padding: 9px 7px;
}

.sidebar-user-avatar,
.profile-avatar,
.profile-dropdown-avatar {
    display: grid;
    place-items: center;

    color: #fff;
    font-weight: 750;

    border-radius: 12px;

    background:
        linear-gradient(
            145deg,
            #334155,
            #172033
        );

    border: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-user-avatar {
    width: 38px;
    height: 38px;
}

.sidebar-user-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar-user-copy strong {
    overflow: hidden;

    color: #e8eef6;
    font-size: 11px;

    white-space: nowrap;
    text-overflow: ellipsis;
}

.sidebar-user-copy span {
    color: #69768a;
    font-size: 9px;
}

.sidebar-logout {
    display: grid;
    place-items: center;

    width: 34px;
    height: 34px;

    color: #78869a;

    border-radius: 10px;

    transition:
        color var(--fast),
        background var(--fast),
        transform var(--normal);
}

.sidebar-logout:hover {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.08);
    transform: translateX(2px);
}


/* ==========================================================================
   09. TOPBAR
   ========================================================================== */

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 700;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;

    height: var(--topbar-height);
    padding: 0 34px;

    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);

    border-bottom: 1px solid rgba(226, 232, 240, 0.85);
}

.topbar-left,
.topbar-actions {
    display: flex;
    align-items: center;
}

.topbar-left {
    gap: 14px;
}

.topbar-actions {
    gap: 8px;
}

.topbar-heading {
    display: flex;
    flex-direction: column;
}

.topbar-kicker {
    color: var(--text-4);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.17em;
}

.topbar-heading strong {
    margin-top: 2px;
    font-family: "Manrope", sans-serif;
    font-size: 15px;
    line-height: 1.2;
}

.mobile-menu-btn {
    display: none;
    place-items: center;

    width: 42px;
    height: 42px;

    border: 1px solid var(--border);
    border-radius: 12px;

    color: var(--text-2);
    background: var(--surface);
}

.system-health {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    height: 38px;
    padding: 0 13px;

    border-radius: 11px;

    color: #536273;
    background: #f8fafc;
    border: 1px solid #edf1f5;

    font-size: 10px;
    font-weight: 650;
}

.system-health-dot {
    width: 7px;
    height: 7px;

    border-radius: 50%;
    background: #22c55e;

    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.1);
}

.topbar-icon-btn {
    position: relative;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    height: 40px;
    min-width: 40px;
    padding: 0 12px;

    border: 1px solid var(--border);
    border-radius: 11px;

    color: var(--text-2);
    background: #fff;

    font-size: 12px;
    font-weight: 650;

    transition:
        transform var(--normal) var(--ease),
        border var(--fast),
        color var(--fast),
        background var(--fast),
        box-shadow var(--normal);
}

.topbar-icon-btn:hover {
    color: var(--primary);
    border-color: #cad8ef;
    background: #fafdff;

    box-shadow: var(--shadow-sm);

    transform: translateY(-1px);
}

.topbar-icon-btn i {
    font-size: 13px;
}

.notification-indicator {
    position: absolute;
    top: 8px;
    right: 8px;

    width: 6px;
    height: 6px;

    border: 2px solid white;
    border-radius: 50%;

    background: #ef4444;
}


/* ==========================================================================
   10. PROFILE MENU
   ========================================================================== */

.profile-menu {
    position: relative;
    margin-left: 4px;
}

.profile-trigger {
    display: grid;
    grid-template-columns: 34px auto 16px;
    align-items: center;
    gap: 9px;

    height: 46px;
    padding: 4px 9px 4px 5px;

    border: 1px solid transparent;
    border-radius: 13px;

    color: var(--text);
    background: transparent;

    transition:
        background var(--fast),
        border var(--fast);
}

.profile-trigger:hover,
.profile-trigger[aria-expanded="true"] {
    background: #f8fafc;
    border-color: var(--border);
}

.profile-avatar {
    width: 34px;
    height: 34px;

    background:
        linear-gradient(
            145deg,
            #2563eb,
            #1e40af
        );

    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.2);
}

.profile-trigger-copy {
    display: flex;
    flex-direction: column;
    min-width: 80px;
    text-align: left;
}

.profile-trigger-copy strong {
    max-width: 130px;
    overflow: hidden;

    font-size: 11px;

    white-space: nowrap;
    text-overflow: ellipsis;
}

.profile-trigger-copy small {
    margin-top: 1px;
    color: var(--text-4);
    font-size: 8px;
}

.profile-chevron {
    color: #94a3b8;
    font-size: 9px;

    transition: transform var(--normal);
}

.profile-trigger[aria-expanded="true"] .profile-chevron {
    transform: rotate(180deg);
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 11px);
    right: 0;

    z-index: 800;

    width: 245px;
    padding: 9px;

    opacity: 0;
    visibility: hidden;

    border: 1px solid var(--border);
    border-radius: 17px;

    background: #fff;
    box-shadow: var(--shadow-lg);

    transform:
        translateY(-8px)
        scale(0.98);

    transform-origin: top right;

    transition:
        opacity var(--fast),
        visibility var(--fast),
        transform var(--normal) var(--ease);
}

.profile-dropdown.open {
    opacity: 1;
    visibility: visible;

    transform:
        translateY(0)
        scale(1);
}

.profile-dropdown-head {
    display: grid;
    grid-template-columns: 43px 1fr;
    align-items: center;
    gap: 11px;

    padding: 8px;
}

.profile-dropdown-avatar {
    width: 43px;
    height: 43px;

    background:
        linear-gradient(
            145deg,
            #2563eb,
            #1e40af
        );
}

.profile-dropdown-head > div:last-child {
    display: flex;
    flex-direction: column;
}

.profile-dropdown-head strong {
    font-size: 12px;
}

.profile-dropdown-head span {
    margin-top: 2px;
    color: var(--text-4);
    font-size: 9px;
}

.dropdown-divider {
    height: 1px;
    margin: 6px 4px;
    background: #edf1f5;
}

.profile-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 10px 11px;

    border-radius: 10px;

    color: var(--text-2);
    font-size: 11px;
    font-weight: 600;

    transition:
        color var(--fast),
        background var(--fast),
        transform var(--fast);
}

.profile-dropdown-item i {
    width: 18px;
    color: #94a3b8;
    text-align: center;
}

.profile-dropdown-item:hover {
    color: var(--primary);
    background: var(--primary-soft);
    transform: translateX(2px);
}

.profile-dropdown-danger:hover,
.profile-dropdown-danger:hover i {
    color: var(--danger);
    background: var(--danger-soft);
}


/* ==========================================================================
   11. PAGE HEADERS
   ========================================================================== */

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;

    margin-bottom: 26px;
}

.page-heading {
    min-width: 0;
}

.page-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    margin-bottom: 7px;

    color: var(--primary);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.page-eyebrow i {
    font-size: 9px;
}

.page-title {
    margin: 0;

    color: #0d1728;
    font-size: clamp(25px, 3vw, 34px);
    font-weight: 750;
    line-height: 1.16;
    letter-spacing: -0.035em;
}

.page-description {
    max-width: 680px;
    margin: 9px 0 0;

    color: var(--text-3);
    font-size: 12px;
    line-height: 1.7;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}


/* ==========================================================================
   12. BUTTON SYSTEM
   ========================================================================== */

.btn {
    position: relative;
    isolation: isolate;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    min-height: 42px;
    padding: 0 15px;

    overflow: hidden;

    border: 1px solid transparent;
    border-radius: 11px;

    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;

    transition:
        color var(--fast),
        background var(--fast),
        border var(--fast),
        transform var(--normal) var(--ease),
        box-shadow var(--normal) var(--ease),
        opacity var(--fast);
}

.btn::before {
    content: "";

    position: absolute;
    inset: 0;
    z-index: -1;

    opacity: 0;

    background:
        linear-gradient(
            100deg,
            transparent 15%,
            rgba(255, 255, 255, 0.18) 50%,
            transparent 85%
        );

    transform: translateX(-120%);

    transition:
        opacity var(--fast),
        transform 500ms var(--ease);
}

.btn:hover::before {
    opacity: 1;
    transform: translateX(120%);
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0) scale(0.985);
}

.btn i {
    font-size: 11px;
}

.btn-primary {
    color: #fff;
    background:
        linear-gradient(
            135deg,
            #2f6df5,
            #1d4ed8
        );

    border-color: #2460dd;

    box-shadow:
        0 8px 20px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    box-shadow:
        0 11px 25px rgba(37, 99, 235, 0.27);
}

.btn-secondary {
    color: #334155;
    background: #fff;
    border-color: var(--border);
}

.btn-secondary:hover {
    color: #1e40af;
    border-color: #c9d6ec;
    box-shadow: var(--shadow-sm);
}

.btn-success {
    color: white;

    background:
        linear-gradient(
            135deg,
            #22a652,
            #15803d
        );

    box-shadow:
        0 8px 20px rgba(22, 163, 74, 0.17);
}

.btn-danger {
    color: white;

    background:
        linear-gradient(
            135deg,
            #ef4444,
            #b91c1c
        );

    box-shadow:
        0 8px 20px rgba(220, 38, 38, 0.17);
}

.btn-warning {
    color: white;

    background:
        linear-gradient(
            135deg,
            #f59e0b,
            #b45309
        );
}

.btn-ghost {
    color: var(--text-2);
    background: transparent;
    border-color: transparent;
}

.btn-ghost:hover {
    background: #f1f5f9;
}

.btn-soft-primary {
    color: var(--primary);
    background: var(--primary-soft);
    border-color: #dbeafe;
}

.btn-soft-danger {
    color: var(--danger);
    background: var(--danger-soft);
    border-color: #fee2e2;
}

.btn-soft-success {
    color: var(--success);
    background: var(--success-soft);
    border-color: #dcfce7;
}

.btn-sm {
    min-height: 35px;
    padding: 0 11px;
    border-radius: 9px;
    font-size: 10px;
}

.btn-lg {
    min-height: 49px;
    padding: 0 19px;
    border-radius: 13px;
    font-size: 12px;
}

.btn-icon {
    width: 40px;
    min-width: 40px;
    padding: 0;
}

.btn[disabled],
.btn.disabled {
    pointer-events: none;
    opacity: 0.48;
    transform: none;
}


/* ==========================================================================
   13. STATS GRID
   ========================================================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;

    margin-bottom: 23px;
}

.stat-card {
    position: relative;

    min-width: 0;
    padding: 18px;

    overflow: hidden;

    border: 1px solid var(--border);
    border-radius: 18px;

    background:
        linear-gradient(
            145deg,
            #ffffff,
            #fbfdff
        );

    box-shadow: var(--shadow-xs);

    transition:
        transform var(--normal) var(--ease),
        box-shadow var(--normal) var(--ease),
        border var(--fast);
}

.stat-card::after {
    content: "";

    position: absolute;
    top: -45px;
    right: -45px;

    width: 110px;
    height: 110px;

    border-radius: 50%;

    background:
        radial-gradient(
            circle,
            rgba(37, 99, 235, 0.07),
            transparent 68%
        );
}

.stat-card:hover {
    border-color: #d6deeb;
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;

    margin-bottom: 14px;
}

.stat-label {
    color: var(--text-3);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.stat-icon {
    display: grid;
    place-items: center;

    width: 39px;
    height: 39px;

    border-radius: 12px;

    font-size: 14px;
}

.stat-icon.blue {
    color: #2563eb;
    background: #eff6ff;
}

.stat-icon.green {
    color: #16a34a;
    background: #f0fdf4;
}

.stat-icon.red {
    color: #dc2626;
    background: #fef2f2;
}

.stat-icon.orange {
    color: #d97706;
    background: #fffbeb;
}

.stat-icon.purple {
    color: #7c3aed;
    background: #f5f3ff;
}

.stat-value {
    margin: 0;

    color: #0f172a;
    font-size: clamp(24px, 2.5vw, 31px);
    font-weight: 750;
    line-height: 1;
    letter-spacing: -0.04em;
}

.stat-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;

    margin-top: 12px;

    color: var(--text-4);
    font-size: 9px;
}

.stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 5px;

    font-weight: 700;
}

.stat-trend.up {
    color: var(--success);
}

.stat-trend.down {
    color: var(--danger);
}


/* ==========================================================================
   14. GENERIC PREMIUM CARDS
   ========================================================================== */

.card {
    min-width: 0;

    border: 1px solid var(--border);
    border-radius: 18px;

    background: #fff;
    box-shadow: var(--shadow-xs);
}

.card-hover {
    transition:
        transform var(--normal) var(--ease),
        border var(--fast),
        box-shadow var(--normal);
}

.card-hover:hover {
    border-color: #d7dfeb;
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;

    padding: 17px 19px;

    border-bottom: 1px solid #edf1f5;
}

.card-title-wrap {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.card-title-icon {
    display: grid;
    place-items: center;

    width: 36px;
    height: 36px;

    flex: 0 0 36px;

    border-radius: 11px;

    color: var(--primary);
    background: var(--primary-soft);
}

.card-title-icon i {
    font-size: 12px;
}

.card-title {
    margin: 0;
    font-size: 13px;
    font-weight: 750;
}

.card-subtitle {
    margin: 2px 0 0;
    color: var(--text-4);
    font-size: 9px;
}

.card-body {
    padding: 19px;
}

.card-footer {
    padding: 13px 19px;
    border-top: 1px solid #edf1f5;
}


/* ==========================================================================
   15. LAYOUT GRIDS
   ========================================================================== */

.grid {
    display: grid;
    gap: 16px;
}

.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.75fr) minmax(300px, 0.8fr);
    gap: 17px;
}

.dashboard-grid-balanced {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 17px;
}

.span-2 {
    grid-column: span 2;
}


/* ==========================================================================
   16. STATUS BADGES
   ========================================================================== */

.status-badge,
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    min-height: 27px;
    padding: 0 9px;

    border: 1px solid transparent;
    border-radius: 999px;

    font-size: 9px;
    font-weight: 750;
    white-space: nowrap;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-active {
    color: #15803d;
    background: #f0fdf4;
    border-color: #dcfce7;
}

.status-active .status-dot {
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.09);
}

.status-locked {
    color: #b91c1c;
    background: #fef2f2;
    border-color: #fee2e2;
}

.status-locked .status-dot {
    background: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.09);
}

.status-pending {
    color: #b45309;
    background: #fffbeb;
    border-color: #fde68a;
}

.status-pending .status-dot {
    background: #f59e0b;
}

.status-released {
    color: #475569;
    background: #f8fafc;
    border-color: #e2e8f0;
}

.status-online {
    color: #15803d;
    background: #f0fdf4;
}

.status-offline {
    color: #64748b;
    background: #f8fafc;
}

.status-command {
    color: #1d4ed8;
    background: #eff6ff;
}

.status-failed {
    color: #b91c1c;
    background: #fef2f2;
}


/* ==========================================================================
   17. DEVICE CARDS
   ========================================================================== */

.device-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.device-card {
    position: relative;

    display: flex;
    flex-direction: column;

    min-width: 0;
    min-height: 230px;
    padding: 17px;

    overflow: hidden;

    border: 1px solid var(--border);
    border-radius: 18px;

    background: #fff;

    transition:
        transform var(--normal) var(--ease),
        border var(--fast),
        box-shadow var(--normal);
}

.device-card::before {
    content: "";

    position: absolute;
    inset: 0 0 auto 0;

    height: 2px;

    opacity: 0;

    background:
        linear-gradient(
            90deg,
            transparent,
            var(--primary),
            transparent
        );

    transition: opacity var(--fast);
}

.device-card:hover {
    border-color: #d1dbea;
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.device-card:hover::before {
    opacity: 1;
}

.device-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.device-identity {
    display: flex;
    align-items: center;
    gap: 11px;

    min-width: 0;
}

.device-icon {
    display: grid;
    place-items: center;

    width: 43px;
    height: 43px;

    flex: 0 0 43px;

    border-radius: 13px;

    color: #2563eb;
    background:
        linear-gradient(
            145deg,
            #eff6ff,
            #f8fbff
        );

    border: 1px solid #dbeafe;
}

.device-icon i {
    font-size: 16px;
}

.device-name-wrap {
    min-width: 0;
}

.device-name {
    margin: 0;

    overflow: hidden;

    color: #172033;
    font-size: 12px;
    font-weight: 750;

    white-space: nowrap;
    text-overflow: ellipsis;
}

.device-customer {
    margin: 3px 0 0;

    overflow: hidden;

    color: var(--text-4);
    font-size: 9px;

    white-space: nowrap;
    text-overflow: ellipsis;
}

.device-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;

    margin-top: 17px;
}

.device-meta-item {
    padding: 10px;

    border-radius: 11px;
    background: #f8fafc;
}

.device-meta-label {
    display: block;

    margin-bottom: 4px;

    color: var(--text-4);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.device-meta-value {
    display: block;

    overflow: hidden;

    color: var(--text-2);
    font-size: 10px;
    font-weight: 700;

    white-space: nowrap;
    text-overflow: ellipsis;
}

.device-card-actions {
    display: flex;
    gap: 7px;

    margin-top: auto;
    padding-top: 16px;
}


/* ==========================================================================
   18. ONLINE / BATTERY
   ========================================================================== */

.online-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;

    color: var(--success);
    font-size: 9px;
    font-weight: 700;
}

.online-indicator::before {
    content: "";

    width: 6px;
    height: 6px;

    border-radius: 50%;
    background: #22c55e;

    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.offline-indicator {
    color: #94a3b8;
}

.offline-indicator::before {
    background: #94a3b8;
    box-shadow: none;
}

.battery {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    color: var(--text-3);
    font-size: 9px;
    font-weight: 700;
}

.battery-icon {
    position: relative;

    width: 22px;
    height: 10px;

    overflow: hidden;

    border: 1.5px solid #94a3b8;
    border-radius: 3px;
}

.battery-icon::after {
    content: "";

    position: absolute;
    top: 2px;
    right: -4px;

    width: 2px;
    height: 4px;

    border-radius: 0 2px 2px 0;
    background: #94a3b8;
}

.battery-fill {
    height: 100%;
    border-radius: 1px;
    background: #22c55e;
}

.battery-low .battery-fill {
    background: #ef4444;
}


/* ==========================================================================
   19. TABLES
   ========================================================================== */

.table-card {
    overflow: hidden;
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    min-width: 760px;

    border-spacing: 0;
    border-collapse: separate;
}

.data-table th {
    padding: 11px 14px;

    color: #7b8798;
    background: #fafbfd;

    border-bottom: 1px solid #e9edf3;

    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.data-table td {
    padding: 13px 14px;

    color: var(--text-2);

    border-bottom: 1px solid #eef2f6;

    font-size: 10px;
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background var(--fast);
}

.data-table tbody tr:hover {
    background: #fafcff;
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.table-primary {
    color: #172033;
    font-weight: 700;
}

.table-secondary {
    margin-top: 2px;
    color: var(--text-4);
    font-size: 8px;
}

.table-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}


/* ==========================================================================
   20. SEARCH / FILTER TOOLBAR
   ========================================================================== */

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 13px;

    margin-bottom: 15px;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 9px;
}

.toolbar-left {
    flex: 1;
}

.search-box {
    position: relative;

    width: min(100%, 330px);
}

.search-box i {
    position: absolute;
    top: 50%;
    left: 13px;

    z-index: 1;

    color: #94a3b8;
    font-size: 11px;

    transform: translateY(-50%);
}

.search-input {
    width: 100%;
    height: 42px;

    padding: 0 13px 0 36px;

    border: 1px solid var(--border);
    border-radius: 11px;

    color: var(--text);
    background: white;

    font-size: 10px;

    transition:
        border var(--fast),
        box-shadow var(--fast);
}

.search-input:focus {
    border-color: #93b5ef;
    outline: none;
    box-shadow: 0 0 0 4px var(--primary-ring);
}

.search-input::placeholder {
    color: #a6b0be;
}

.filter-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    min-height: 41px;
    padding: 0 12px;

    border: 1px solid var(--border);
    border-radius: 11px;

    color: var(--text-3);
    background: #fff;

    font-size: 10px;
    font-weight: 650;
}


/* ==========================================================================
   21. FORMS
   ========================================================================== */

.form-card {
    padding: 22px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 18px;
}

.form-group {
    min-width: 0;
}

.form-group.full {
    grid-column: 1 / -1;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 6px;

    margin-bottom: 7px;

    color: #374151;
    font-size: 10px;
    font-weight: 700;
}

.form-label i {
    color: #94a3b8;
    font-size: 9px;
}

.required {
    color: var(--danger);
}

.form-control,
.form-select,
.form-textarea {
    width: 100%;

    border: 1px solid var(--border-strong);
    border-radius: 11px;

    color: var(--text);
    background: #fff;

    font-size: 11px;

    transition:
        border var(--fast),
        box-shadow var(--fast),
        background var(--fast);
}

.form-control,
.form-select {
    height: 44px;
    padding: 0 13px;
}

.form-textarea {
    min-height: 110px;
    padding: 12px 13px;
    resize: vertical;
}

.form-control:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: #8fb3ec;
    outline: 0;
    box-shadow: 0 0 0 4px var(--primary-ring);
}

.form-control::placeholder,
.form-textarea::placeholder {
    color: #aab4c2;
}

.form-help {
    margin-top: 6px;

    color: var(--text-4);
    font-size: 9px;
    line-height: 1.5;
}

.input-prefix-wrap {
    position: relative;
}

.input-prefix-icon {
    position: absolute;
    top: 50%;
    left: 13px;

    color: #94a3b8;
    font-size: 10px;

    transform: translateY(-50%);
}

.input-prefix-wrap .form-control {
    padding-left: 36px;
}

.form-section {
    margin-bottom: 27px;
}

.form-section:last-child {
    margin-bottom: 0;
}

.form-section-title {
    margin: 0 0 4px;

    color: #182234;
    font-size: 13px;
    font-weight: 750;
}

.form-section-description {
    margin: 0 0 17px;

    color: var(--text-4);
    font-size: 9px;
}

.form-divider {
    height: 1px;
    margin: 22px 0;
    background: var(--border);
}


/* ==========================================================================
   22. ALERTS
   ========================================================================== */

.alert {
    display: grid;
    grid-template-columns: 34px 1fr auto;
    align-items: flex-start;
    gap: 11px;

    padding: 13px;

    border: 1px solid transparent;
    border-radius: 13px;

    animation:
        alertEnter 360ms var(--ease) both;
}

.alert-icon {
    display: grid;
    place-items: center;

    width: 34px;
    height: 34px;

    border-radius: 10px;

    font-size: 12px;
}

.alert-content strong {
    display: block;
    margin: 1px 0 3px;
    font-size: 10px;
}

.alert-content p {
    margin: 0;
    font-size: 9px;
    line-height: 1.55;
}

.alert-success {
    color: #166534;
    background: #f0fdf4;
    border-color: #dcfce7;
}

.alert-success .alert-icon {
    color: #15803d;
    background: #dcfce7;
}

.alert-danger {
    color: #991b1b;
    background: #fef2f2;
    border-color: #fee2e2;
}

.alert-danger .alert-icon {
    color: #dc2626;
    background: #fee2e2;
}

.alert-warning {
    color: #92400e;
    background: #fffbeb;
    border-color: #fde68a;
}

.alert-warning .alert-icon {
    color: #d97706;
    background: #fef3c7;
}

.alert-info {
    color: #1e40af;
    background: #eff6ff;
    border-color: #dbeafe;
}

.alert-info .alert-icon {
    color: #2563eb;
    background: #dbeafe;
}


/* ==========================================================================
   23. TOASTS
   ========================================================================== */

.toast-stack {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 3000;

    display: grid;
    gap: 9px;

    width: min(360px, calc(100vw - 28px));

    pointer-events: none;
}

.toast {
    display: grid;
    grid-template-columns: 38px 1fr 27px;
    align-items: center;
    gap: 10px;

    min-height: 68px;
    padding: 11px;

    pointer-events: auto;

    border: 1px solid var(--border);
    border-radius: 15px;

    background: rgba(255, 255, 255, 0.97);

    box-shadow: var(--shadow-lg);

    backdrop-filter: blur(16px);

    animation:
        toastIn 380ms var(--ease) both;
}

.toast.removing {
    animation:
        toastOut 260ms ease forwards;
}

.toast-icon {
    display: grid;
    place-items: center;

    width: 38px;
    height: 38px;

    border-radius: 11px;
}

.toast-success .toast-icon {
    color: var(--success);
    background: var(--success-soft);
}

.toast-error .toast-icon {
    color: var(--danger);
    background: var(--danger-soft);
}

.toast-warning .toast-icon {
    color: var(--warning);
    background: var(--warning-soft);
}

.toast-info .toast-icon {
    color: var(--primary);
    background: var(--primary-soft);
}

.toast-copy {
    min-width: 0;
}

.toast-copy strong {
    display: block;

    margin-bottom: 2px;

    color: #172033;
    font-size: 10px;
}

.toast-copy span {
    display: block;

    color: var(--text-3);
    font-size: 9px;
    line-height: 1.45;
}

.toast-close {
    display: grid;
    place-items: center;

    width: 27px;
    height: 27px;

    border: 0;
    border-radius: 8px;

    color: #94a3b8;
    background: transparent;
}

.toast-close:hover {
    color: #475569;
    background: #f1f5f9;
}


/* ==========================================================================
   24. GLOBAL MODAL
   ========================================================================== */

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2500;

    display: grid;
    place-items: center;

    padding: 20px;

    opacity: 0;
    visibility: hidden;

    background: rgba(5, 8, 14, 0.55);
    backdrop-filter: blur(7px);

    transition:
        opacity var(--normal),
        visibility var(--normal);
}

.modal-backdrop.open {
    opacity: 1;
    visibility: visible;
}

.global-modal {
    position: relative;

    width: min(460px, 100%);
    padding: 26px;

    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 22px;

    background: #fff;
    box-shadow: 0 35px 100px rgba(0, 0, 0, 0.24);

    transform:
        translateY(17px)
        scale(0.965);

    transition:
        transform var(--normal) var(--ease);
}

.modal-backdrop.open .global-modal {
    transform:
        translateY(0)
        scale(1);
}

.modal-close {
    position: absolute;
    top: 13px;
    right: 13px;

    display: grid;
    place-items: center;

    width: 32px;
    height: 32px;

    border: 0;
    border-radius: 9px;

    color: #94a3b8;
    background: #f8fafc;
}

.modal-close:hover {
    color: #334155;
}

.modal-icon-wrap {
    display: grid;
    place-items: center;

    width: 50px;
    height: 50px;

    margin-bottom: 17px;

    border-radius: 15px;

    color: var(--danger);
    background: var(--danger-soft);

    font-size: 18px;
}

.modal-eyebrow {
    display: block;

    margin-bottom: 5px;

    color: var(--text-4);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.modal-title {
    margin: 0;

    font-size: 20px;
    letter-spacing: -0.025em;
}

.modal-description {
    margin: 8px 0 0;

    color: var(--text-3);
    font-size: 10px;
    line-height: 1.65;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;

    margin-top: 23px;
}


/* ==========================================================================
   25. GLOBAL LOADING BAR
   ========================================================================== */

.global-loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 5000;

    width: 0;
    height: 3px;

    opacity: 0;

    background:
        linear-gradient(
            90deg,
            #2563eb,
            #60a5fa,
            #2563eb
        );

    box-shadow:
        0 0 13px rgba(37, 99, 235, 0.6);

    transition:
        width 300ms ease,
        opacity var(--fast);
}

.global-loading-bar.loading {
    width: 72%;
    opacity: 1;
}

.global-loading-bar.complete {
    width: 100%;
    opacity: 0;
}


/* ==========================================================================
   26. CONNECTION BANNER
   ========================================================================== */

.connection-banner {
    position: fixed;
    left: 50%;
    bottom: 22px;
    z-index: 2600;

    display: grid;
    grid-template-columns: 37px 1fr;
    align-items: center;
    gap: 10px;

    width: min(390px, calc(100vw - 30px));
    padding: 11px 13px;

    opacity: 0;
    visibility: hidden;

    border: 1px solid #fed7aa;
    border-radius: 14px;

    background: rgba(255, 251, 235, 0.98);
    box-shadow: var(--shadow-lg);

    transform:
        translate(-50%, 20px);

    transition:
        opacity var(--normal),
        visibility var(--normal),
        transform var(--normal) var(--ease);
}

.connection-banner.show {
    opacity: 1;
    visibility: visible;

    transform:
        translate(-50%, 0);
}

.connection-banner-icon {
    display: grid;
    place-items: center;

    width: 37px;
    height: 37px;

    border-radius: 11px;

    color: #b45309;
    background: #fef3c7;
}

.connection-banner-copy {
    display: flex;
    flex-direction: column;
}

.connection-banner-copy strong {
    color: #78350f;
    font-size: 10px;
}

.connection-banner-copy span {
    margin-top: 1px;
    color: #a16207;
    font-size: 8px;
}


/* ==========================================================================
   27. ACTIVITY TIMELINE
   ========================================================================== */

.timeline {
    position: relative;
    display: grid;
    gap: 3px;
}

.timeline-item {
    position: relative;

    display: grid;
    grid-template-columns: 38px 1fr auto;
    gap: 11px;

    padding: 10px 0;
}

.timeline-item:not(:last-child)::after {
    content: "";

    position: absolute;
    top: 47px;
    bottom: -3px;
    left: 18px;

    width: 1px;

    background: #e7ebf1;
}

.timeline-icon {
    position: relative;
    z-index: 1;

    display: grid;
    place-items: center;

    width: 37px;
    height: 37px;

    border-radius: 11px;

    color: #2563eb;
    background: #eff6ff;

    font-size: 11px;
}

.timeline-content {
    min-width: 0;
}

.timeline-title {
    margin: 2px 0 2px;

    color: #283548;
    font-size: 10px;
    font-weight: 700;
}

.timeline-description {
    margin: 0;

    overflow: hidden;

    color: var(--text-4);
    font-size: 9px;

    white-space: nowrap;
    text-overflow: ellipsis;
}

.timeline-time {
    padding-top: 2px;

    color: #a1aab7;
    font-size: 8px;
    white-space: nowrap;
}


/* ==========================================================================
   28. COMMAND / ACK UI
   ========================================================================== */

.command-state {
    display: flex;
    align-items: center;
    gap: 9px;
}

.command-state-icon {
    display: grid;
    place-items: center;

    width: 32px;
    height: 32px;

    border-radius: 10px;

    background: #f8fafc;
}

.command-pending .command-state-icon {
    color: #d97706;
    background: #fffbeb;
}

.command-success .command-state-icon {
    color: #16a34a;
    background: #f0fdf4;
}

.command-failed .command-state-icon {
    color: #dc2626;
    background: #fef2f2;
}

.command-spinner {
    animation: spin 850ms linear infinite;
}


/* ==========================================================================
   29. PAYMENT COMPONENTS
   ========================================================================== */

.money {
    font-family: "Manrope", sans-serif;
    font-weight: 750;
    letter-spacing: -0.025em;
}

.money-positive {
    color: var(--success);
}

.money-due {
    color: var(--danger);
}

.payment-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 11px;
}

.payment-summary-item {
    padding: 13px;

    border: 1px solid var(--border);
    border-radius: 13px;

    background: #fbfcfe;
}

.payment-summary-label {
    display: block;

    color: var(--text-4);
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
}

.payment-summary-value {
    display: block;

    margin-top: 6px;

    color: var(--text);
    font-family: "Manrope", sans-serif;
    font-size: 17px;
    font-weight: 750;
}


/* ==========================================================================
   30. LOCATION / MAP
   ========================================================================== */

.map-panel {
    position: relative;

    min-height: 340px;
    overflow: hidden;

    border: 1px solid var(--border);
    border-radius: 18px;

    background:
        radial-gradient(
            circle at 20% 25%,
            rgba(37, 99, 235, 0.08),
            transparent 30%
        ),
        linear-gradient(
            135deg,
            #f8fbff,
            #f3f7fc
        );
}

.map-placeholder {
    position: absolute;
    inset: 0;

    display: grid;
    place-items: center;

    padding: 30px;
}

.map-placeholder-inner {
    max-width: 320px;
    text-align: center;
}

.map-placeholder-icon {
    display: grid;
    place-items: center;

    width: 55px;
    height: 55px;

    margin: 0 auto 13px;

    border-radius: 17px;

    color: #2563eb;
    background: #eff6ff;

    font-size: 19px;
}

.map-placeholder h3 {
    margin-bottom: 5px;
    font-size: 14px;
}

.map-placeholder p {
    margin: 0;
    color: var(--text-4);
    font-size: 9px;
}


/* ==========================================================================
   31. DETAILS / KEY-VALUE LIST
   ========================================================================== */

.detail-list {
    display: grid;
}

.detail-row {
    display: grid;
    grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1.2fr);
    gap: 15px;

    padding: 11px 0;

    border-bottom: 1px solid #edf1f5;
}

.detail-row:last-child {
    border-bottom: 0;
}

.detail-label {
    color: var(--text-4);
    font-size: 9px;
    font-weight: 600;
}

.detail-value {
    color: var(--text-2);
    font-size: 10px;
    font-weight: 650;
    text-align: right;
    word-break: break-word;
}


/* ==========================================================================
   32. EMPTY STATES
   ========================================================================== */

.empty-state {
    display: grid;
    place-items: center;

    min-height: 260px;
    padding: 35px 20px;

    text-align: center;
}

.empty-state-icon {
    position: relative;

    display: grid;
    place-items: center;

    width: 62px;
    height: 62px;

    margin-bottom: 16px;

    border: 1px solid #dbeafe;
    border-radius: 19px;

    color: #2563eb;
    background:
        linear-gradient(
            145deg,
            #eff6ff,
            #ffffff
        );

    font-size: 20px;

    box-shadow: var(--shadow-sm);
}

.empty-state h3 {
    margin: 0 0 6px;

    color: #1e293b;
    font-size: 15px;
}

.empty-state p {
    max-width: 390px;
    margin: 0 0 17px;

    color: var(--text-4);
    font-size: 9px;
    line-height: 1.7;
}


/* ==========================================================================
   33. SKELETON LOADING
   ========================================================================== */

.skeleton {
    position: relative;
    overflow: hidden;

    border-radius: 8px;
    background: #eef2f6;
}

.skeleton::after {
    content: "";

    position: absolute;
    inset: 0;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(255, 255, 255, 0.65),
            transparent
        );

    transform: translateX(-100%);

    animation:
        skeletonShimmer 1.4s infinite;
}

.skeleton-line {
    height: 10px;
}

.skeleton-line.sm {
    width: 35%;
}

.skeleton-line.md {
    width: 60%;
}

.skeleton-line.lg {
    width: 85%;
}


/* ==========================================================================
   34. TOOLTIP
   ========================================================================== */

[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);

    position: absolute;
    left: 50%;
    bottom: calc(100% + 9px);
    z-index: 100;

    max-width: 210px;
    padding: 6px 8px;

    opacity: 0;
    visibility: hidden;

    color: #fff;
    background: #0f172a;

    border-radius: 7px;

    font-size: 8px;
    line-height: 1.3;
    white-space: nowrap;

    transform:
        translate(-50%, 4px);

    transition:
        opacity var(--fast),
        visibility var(--fast),
        transform var(--fast);
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;

    transform:
        translate(-50%, 0);
}


/* ==========================================================================
   35. LOGIN / PUBLIC AREA
   ========================================================================== */

.public-shell {
    display: flex;
    flex-direction: column;

    min-height: 100vh;

    background:
        radial-gradient(
            circle at 12% 15%,
            rgba(37, 99, 235, 0.12),
            transparent 28%
        ),
        radial-gradient(
            circle at 88% 82%,
            rgba(124, 58, 237, 0.07),
            transparent 30%
        ),
        #f7f9fc;
}

.public-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    width: 100%;
    max-width: 1380px;
    min-height: 82px;

    margin: 0 auto;
    padding: 0 30px;
}

.public-brand .brand-copy strong {
    color: #142033;
}

.public-brand .brand-copy small {
    color: #94a3b8;
}

.public-security-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    min-height: 34px;
    padding: 0 11px;

    color: #64748b;
    background: rgba(255, 255, 255, 0.75);

    border: 1px solid #e5eaf1;
    border-radius: 10px;

    font-size: 9px;
    font-weight: 650;
}

.public-security-badge i {
    color: #16a34a;
}

.public-content {
    display: grid;
    place-items: center;

    flex: 1;
    width: 100%;

    padding: 30px;
}

.public-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    min-height: 64px;
    padding: 14px 20px;

    color: #94a3b8;
    font-size: 8px;
}

.public-footer-dot {
    width: 3px;
    height: 3px;

    border-radius: 50%;
    background: #cbd5e1;
}

.legacy-public-body:empty {
    display: none;
}


/* ==========================================================================
   36. LOGIN CARD
   ========================================================================== */

.login-card {
    width: min(420px, 100%);
    padding: 29px;

    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 23px;

    background: rgba(255, 255, 255, 0.94);

    box-shadow:
        0 35px 85px rgba(15, 23, 42, 0.11);

    backdrop-filter: blur(18px);
}

.login-card-icon {
    display: grid;
    place-items: center;

    width: 49px;
    height: 49px;

    margin-bottom: 20px;

    color: white;

    border-radius: 15px;

    background:
        linear-gradient(
            145deg,
            #3b82f6,
            #1d4ed8
        );

    box-shadow:
        0 12px 25px rgba(37, 99, 235, 0.24);

    font-size: 16px;
}

.login-title {
    margin: 0;

    font-size: 23px;
    letter-spacing: -0.035em;
}

.login-description {
    margin: 7px 0 22px;

    color: var(--text-3);
    font-size: 10px;
    line-height: 1.65;
}


/* ==========================================================================
   37. FOOTER
   ========================================================================== */

.app-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    width: 100%;
    max-width: 1600px;

    margin: 8px auto 0;
    padding: 22px 34px 28px;

    color: #94a3b8;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 9px;
}

.footer-brand-mark {
    display: grid;
    place-items: center;

    width: 31px;
    height: 31px;

    color: #2563eb;

    border-radius: 9px;
    background: #eff6ff;
}

.footer-left > div {
    display: flex;
    flex-direction: column;
}

.footer-left strong {
    color: #536273;
    font-size: 9px;
}

.footer-left span,
.footer-right {
    font-size: 8px;
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.footer-security {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.footer-security i {
    color: #22c55e;
}


/* ==========================================================================
   38. MOBILE QUICKBAR
   ========================================================================== */

.mobile-quickbar {
    display: none;
}


/* ==========================================================================
   39. SIDEBAR BACKDROP
   ========================================================================== */

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 850;

    opacity: 0;
    visibility: hidden;

    background: rgba(4, 7, 12, 0.56);
    backdrop-filter: blur(4px);

    transition:
        opacity var(--normal),
        visibility var(--normal);
}

.sidebar-backdrop.show {
    opacity: 1;
    visibility: visible;
}


/* ==========================================================================
   40. UTILITIES
   ========================================================================== */

.text-primary {
    color: var(--primary) !important;
}

.text-success {
    color: var(--success) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.text-warning {
    color: var(--warning) !important;
}

.text-muted {
    color: var(--text-4) !important;
}

.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.font-bold {
    font-weight: 700;
}

.hidden {
    display: none !important;
}

.w-100 {
    width: 100%;
}

.mt-0 {
    margin-top: 0 !important;
}

.mt-1 {
    margin-top: 8px !important;
}

.mt-2 {
    margin-top: 14px !important;
}

.mt-3 {
    margin-top: 20px !important;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.mb-1 {
    margin-bottom: 8px !important;
}

.mb-2 {
    margin-bottom: 14px !important;
}

.mb-3 {
    margin-bottom: 20px !important;
}

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-1 {
    gap: 7px;
}

.gap-2 {
    gap: 12px;
}

.wrap {
    flex-wrap: wrap;
}


/* ==========================================================================
   41. ANIMATIONS
   ========================================================================== */

@keyframes statusPulse {
    0%,
    100% {
        box-shadow:
            0 0 0 4px rgba(34, 197, 94, 0.08),
            0 0 11px rgba(34, 197, 94, 0.45);
    }

    50% {
        box-shadow:
            0 0 0 6px rgba(34, 197, 94, 0.03),
            0 0 17px rgba(34, 197, 94, 0.68);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform:
            translateX(24px)
            scale(0.97);
    }

    to {
        opacity: 1;
        transform:
            translateX(0)
            scale(1);
    }
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform:
            translateX(25px)
            scale(0.96);
    }
}

@keyframes alertEnter {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes skeletonShimmer {
    to {
        transform: translateX(100%);
    }
}

@keyframes softFloat {
    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}


/* ==========================================================================
   42. LAPTOP — <= 1280
   ========================================================================== */

@media (max-width: 1280px) {

    :root {
        --sidebar-width: 250px;
    }

    .page-content {
        padding-left: 24px;
        padding-right: 24px;
    }

    .app-topbar {
        padding-left: 24px;
        padding-right: 24px;
    }

    .stats-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .device-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid {
        grid-template-columns:
            minmax(0, 1.55fr)
            minmax(280px, 0.85fr);
    }
}


/* ==========================================================================
   43. TABLET — <= 1024
   ========================================================================== */

@media (max-width: 1024px) {

    :root {
        --sidebar-width: 278px;
        --topbar-height: 72px;
    }

    .app-sidebar {
        transform: translateX(-105%);
        box-shadow: 30px 0 70px rgba(0, 0, 0, 0.22);

        transition:
            transform var(--normal) var(--ease);
    }

    .app-sidebar.open {
        transform: translateX(0);
    }

    .sidebar-close {
        display: grid;
    }

    .app-workspace {
        width: 100%;
        margin-left: 0;
    }

    .mobile-menu-btn {
        display: grid;
    }

    .system-health-text {
        display: none;
    }

    .system-health {
        width: 40px;
        padding: 0;
        justify-content: center;
    }

    .dashboard-grid,
    .dashboard-grid-balanced {
        grid-template-columns: 1fr;
    }

    .grid-4 {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}


/* ==========================================================================
   44. LARGE MOBILE / SMALL TABLET — <= 768
   ========================================================================== */

@media (max-width: 768px) {

    body {
        padding-bottom: 73px;
    }

    .app-topbar {
        height: 66px;
        padding: 0 15px;
    }

    .topbar-kicker {
        display: none;
    }

    .topbar-heading strong {
        font-size: 13px;
    }

    .system-health,
    .topbar-add-device,
    .profile-trigger-copy,
    .profile-chevron {
        display: none;
    }

    .profile-trigger {
        display: grid;
        grid-template-columns: 34px;
        width: 42px;
        height: 42px;
        padding: 4px;
    }

    .page-content {
        padding: 21px 15px 30px;
    }

    .page-header {
        flex-direction: column;
        gap: 14px;

        margin-bottom: 19px;
    }

    .page-actions {
        width: 100%;
    }

    .page-actions .btn {
        flex: 1;
    }

    .stats-grid {
        gap: 10px;
    }

    .stat-card {
        padding: 14px;
        border-radius: 15px;
    }

    .stat-icon {
        width: 35px;
        height: 35px;
    }

    .stat-value {
        font-size: 24px;
    }

    .device-grid {
        grid-template-columns: 1fr;
    }

    .grid-3,
    .grid-4 {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-group.full {
        grid-column: auto;
    }

    .payment-summary {
        grid-template-columns: 1fr;
    }

    .toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .toolbar-left,
    .toolbar-right {
        width: 100%;
    }

    .search-box {
        width: 100%;
        max-width: none;
    }

    .card-header {
        padding: 14px;
    }

    .card-body {
        padding: 14px;
    }

    .app-footer {
        display: none;
    }


    /* --------------------------------------------------------------
       MOBILE BOTTOM NAV
       -------------------------------------------------------------- */

    .mobile-quickbar {
        position: fixed;
        right: 9px;
        bottom: 9px;
        left: 9px;
        z-index: 780;

        display: grid;
        grid-template-columns: repeat(5, 1fr);
        align-items: center;

        height: 64px;
        padding: 6px 5px;

        border: 1px solid rgba(226, 232, 240, 0.88);
        border-radius: 18px;

        background: rgba(255, 255, 255, 0.94);

        box-shadow:
            0 15px 45px rgba(15, 23, 42, 0.16);

        backdrop-filter: blur(19px);
        -webkit-backdrop-filter: blur(19px);
    }

    .mobile-quick-item {
        position: relative;

        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;

        height: 100%;

        color: #7c8898;
        border-radius: 12px;

        font-size: 8px;
        font-weight: 650;
    }

    .mobile-quick-item i {
        font-size: 14px;
    }

    .mobile-quick-item:hover {
        color: var(--primary);
        background: #f8fafc;
    }

    .mobile-quick-primary {
        overflow: visible;
        margin-top: -19px;
        background: transparent !important;
    }

    .mobile-quick-plus {
        display: grid;
        place-items: center;

        width: 43px;
        height: 43px;

        color: #fff;

        border: 4px solid #f5f7fb;
        border-radius: 14px;

        background:
            linear-gradient(
                145deg,
                #3b82f6,
                #1d4ed8
            );

        box-shadow:
            0 8px 20px rgba(37, 99, 235, 0.27);
    }

    .mobile-quick-primary > span:last-child {
        color: #2563eb;
    }

    .toast-stack {
        top: 12px;
        right: 12px;
        left: 12px;

        width: auto;
    }

    .profile-dropdown {
        position: fixed;
        top: 71px;
        right: 12px;
    }
}


/* ==========================================================================
   45. PHONE — <= 560
   ========================================================================== */

@media (max-width: 560px) {

    .app-sidebar {
        width: min(88vw, 310px);
    }

    .topbar-actions {
        gap: 5px;
    }

    .topbar-icon-btn {
        width: 39px;
        min-width: 39px;
        padding: 0;
    }

    .topbar-action-text {
        display: none;
    }

    .notification-button {
        display: none;
    }

    .page-title {
        font-size: 25px;
    }

    .page-description {
        font-size: 10px;
    }

    .stats-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .stat-card {
        min-height: 128px;
    }

    .stat-label {
        font-size: 8px;
    }

    .stat-bottom {
        align-items: flex-start;
        flex-direction: column;
    }

    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .device-card {
        min-height: 220px;
    }

    .device-meta {
        gap: 7px;
    }

    .device-card-actions {
        flex-wrap: wrap;
    }

    .device-card-actions .btn {
        flex: 1;
    }

    .detail-row {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .detail-value {
        text-align: left;
    }

    .modal-backdrop {
        align-items: end;
        padding: 10px;
    }

    .global-modal {
        width: 100%;
        padding: 23px 19px 19px;

        border-radius: 21px;
    }

    .modal-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .modal-actions .btn {
        width: 100%;
    }

    .timeline-item {
        grid-template-columns: 36px 1fr;
    }

    .timeline-time {
        grid-column: 2;
        padding: 0;
    }

    .login-card {
        padding: 22px 18px;
        border-radius: 19px;
    }

    .public-header {
        min-height: 68px;
        padding: 0 17px;
    }

    .public-security-badge {
        display: none;
    }

    .public-content {
        padding: 20px 14px;
    }
}


/* ==========================================================================
   46. VERY SMALL PHONE — <= 390
   ========================================================================== */

@media (max-width: 390px) {

    .page-content {
        padding-right: 11px;
        padding-left: 11px;
    }

    .stats-grid {
        gap: 8px;
    }

    .stat-card {
        padding: 12px;
    }

    .stat-top {
        margin-bottom: 11px;
    }

    .stat-value {
        font-size: 21px;
    }

    .mobile-menu-btn,
    .topbar-icon-btn,
    .profile-trigger {
        width: 37px;
        height: 37px;
        min-width: 37px;
    }

    .app-topbar {
        padding-right: 11px;
        padding-left: 11px;
    }

    .topbar-heading strong {
        font-size: 11px;
    }

    .card-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .toolbar-right {
        flex-wrap: wrap;
    }

    .filter-button {
        flex: 1;
    }
}


/* ==========================================================================
   47. REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}


/* ==========================================================================
   48. PRINT
   ========================================================================== */

@media print {

    .app-sidebar,
    .app-topbar,
    .mobile-quickbar,
    .app-footer,
    .toast-stack,
    .connection-banner,
    .page-actions,
    .btn {
        display: none !important;
    }

    .app-workspace {
        width: 100%;
        margin: 0;
    }

    .page-content {
        max-width: none;
        padding: 0;
    }

    body {
        color: #000;
        background: #fff;
    }

    .card,
    .stat-card {
        box-shadow: none;
        break-inside: avoid;
    }
}