* {
    box-sizing: border-box;
}

:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --sidebar: #0d1726;
    --sidebar-2: #142236;
    --text: #172033;
    --muted: #758097;
    --border: #e6eaf0;
    --primary: #2563eb;
    --primary-soft: #eef4ff;
    --success: #16a36a;
    --shadow:
        0 8px 30px rgba(23, 32, 51, .06);
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    background: var(--bg);
    color: var(--text);
}

button,
a {
    font: inherit;
}

.app-shell {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: 260px;
    position: fixed;
    inset: 0 auto 0 0;
    padding: 25px 18px;
    background:
        linear-gradient(
            180deg,
            var(--sidebar),
            #09111e
        );
    color: white;
    display: flex;
    flex-direction: column;
    z-index: 20;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px 28px;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 14px;
    background:
        linear-gradient(
            135deg,
            #3b82f6,
            #2563eb
        );
    box-shadow:
        0 8px 25px rgba(37, 99, 235, .3);
}

.brand strong,
.brand span {
    display: block;
}

.brand strong {
    font-size: 17px;
}

.brand span {
    color: #93a2b9;
    font-size: 12px;
    margin-top: 2px;
}

.navigation {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nav-item {
    color: #aab6c7;
    text-decoration: none;
    padding: 11px 13px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    transition: .2s;
}

.nav-item:hover {
    color: white;
    background: var(--sidebar-2);
}

.nav-item.active {
    color: white;
    background: #1c2b40;
}

.nav-item span {
    width: 20px;
    text-align: center;
}

.nav-label {
    color: #53627a;
    font-size: 10px;
    letter-spacing: .12em;
    font-weight: 700;
    padding: 25px 13px 8px;
}

.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid #1d2a3c;
    padding: 20px 8px 0;
    display: flex;
    gap: 10px;
    align-items: center;
}

.system-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #21c67a;
    box-shadow:
        0 0 0 5px rgba(33, 198, 122, .1);
}

.sidebar-footer strong,
.sidebar-footer span {
    display: block;
}

.sidebar-footer strong {
    font-size: 12px;
}

.sidebar-footer span {
    color: #708098;
    font-size: 10px;
    margin-top: 2px;
}

.main {
    width: calc(100% - 260px);
    margin-left: 260px;
}

.topbar {
    height: 82px;
    padding: 0 34px;
    display: flex;
    align-items: center;
    background: rgba(255,255,255,.9);
    border-bottom: 1px solid var(--border);
    justify-content: space-between;
}

.topbar h1 {
    font-size: 20px;
    margin: 0;
}

.topbar p {
    color: var(--muted);
    margin: 3px 0 0;
    font-size: 12px;
}

.account {
    display: flex;
    align-items: center;
    gap: 10px;
}

.account-avatar {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #e9effa;
    color: #345078;
    font-size: 12px;
    font-weight: 800;
}

.account strong,
.account span {
    display: block;
}

.account strong {
    font-size: 12px;
}

.account span {
    color: var(--muted);
    font-size: 10px;
    margin-top: 2px;
}

.mobile-menu {
    display: none;
}

.content {
    max-width: 1500px;
    margin: auto;
    padding: 30px 34px 50px;
}

.welcome {
    min-height: 180px;
    border-radius: 20px;
    padding: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    background:
        radial-gradient(
            circle at 85% 20%,
            rgba(72, 131, 255, .5),
            transparent 30%
        ),
        linear-gradient(
            120deg,
            #0d1726,
            #14294a
        );
    box-shadow: var(--shadow);
}

.eyebrow {
    color: #7faaff;
    font-size: 10px;
    letter-spacing: .18em;
    font-weight: 800;
}

.welcome h2 {
    max-width: 580px;
    font-size: 30px;
    line-height: 1.2;
    margin: 12px 0 10px;
}

.welcome p {
    color: #aebdd1;
    max-width: 550px;
    margin: 0;
    font-size: 13px;
    line-height: 1.7;
}

.welcome-status {
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.06);
    border-radius: 30px;
    padding: 11px 16px;
    display: flex;
    gap: 9px;
    align-items: center;
    font-size: 12px;
}

.pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #27d487;
    box-shadow:
        0 0 0 5px rgba(39,212,135,.12);
}

.stats {
    margin-top: 20px;
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.stat-card,
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.stat-card {
    border-radius: 15px;
    padding: 20px;
    display: flex;
    gap: 15px;
    align-items: center;
}

.stat-icon {
    width: 43px;
    height: 43px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: bold;
}

.stat-card span,
.stat-card strong,
.stat-card small {
    display: block;
}

.stat-card span {
    color: var(--muted);
    font-size: 11px;
}

.stat-card strong {
    font-size: 22px;
    margin: 3px 0;
}

.stat-card small {
    color: #9aa3b4;
    font-size: 9px;
}

.stat-card .online {
    color: var(--success);
    font-size: 15px;
}

.dashboard-grid {
    margin-top: 20px;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.panel {
    border-radius: 16px;
    padding: 22px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.panel-header h3 {
    margin: 0;
    font-size: 15px;
}

.panel-header p {
    color: var(--muted);
    margin: 4px 0 0;
    font-size: 10px;
}

.button {
    border: 1px solid var(--border);
    background: white;
    color: var(--text);
    padding: 9px 13px;
    border-radius: 9px;
    cursor: pointer;
    font-size: 11px;
}

.button.primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.device-placeholder {
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 25px;
}

.phone {
    width: 90px;
    height: 150px;
    border: 6px solid #172033;
    border-radius: 20px;
    padding: 6px;
}

.phone-screen {
    width: 100%;
    height: 100%;
    border-radius: 11px;
    background:
        linear-gradient(
            150deg,
            #eef4ff,
            #f8fafc
        );
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 5px;
}

.phone-screen .signal {
    color: var(--success);
    font-size: 10px;
}

.phone-screen strong {
    font-size: 10px;
    margin: 4px 0;
}

.phone-screen small {
    color: var(--muted);
    font-size: 6px;
}

.device-placeholder h4 {
    margin: 0 0 6px;
}

.device-placeholder p {
    margin: 0;
    color: var(--muted);
    max-width: 210px;
    line-height: 1.6;
    font-size: 11px;
}

.quick-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quick-panel .panel-header {
    margin-bottom: 5px;
}

.quick-action {
    width: 100%;
    border: 1px solid var(--border);
    background: #fbfcfe;
    padding: 13px;
    border-radius: 11px;
    display: flex;
    gap: 12px;
    align-items: center;
    text-align: left;
    cursor: pointer;
}

.quick-action > span {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: var(--primary-soft);
    color: var(--primary);
}

.quick-action div {
    flex: 1;
}

.quick-action strong,
.quick-action small {
    display: block;
}

.quick-action strong {
    font-size: 11px;
}

.quick-action small {
    color: var(--muted);
    font-size: 9px;
    margin-top: 3px;
}

.quick-action b {
    color: #aab3c1;
}

.activity-panel {
    margin-top: 20px;
}

.empty-state {
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.empty-icon {
    width: 45px;
    height: 45px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #f2f5f9;
    color: #8894a7;
    margin-bottom: 10px;
}

.empty-state strong {
    font-size: 12px;
}

.empty-state span {
    color: var(--muted);
    font-size: 10px;
    margin-top: 4px;
}

@media (max-width: 1000px) {

    .stats {
        grid-template-columns:
            repeat(2, minmax(0,1fr));
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {

    .sidebar {
        transform: translateX(-100%);
        transition: .25s;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main {
        width: 100%;
        margin-left: 0;
    }

    .mobile-menu {
        display: block;
        border: 0;
        background: transparent;
        font-size: 20px;
        margin-right: 15px;
    }

    .topbar {
        padding: 0 18px;
        justify-content: flex-start;
    }

    .account {
        margin-left: auto;
    }

    .account > div:last-child {
        display: none;
    }

    .content {
        padding: 20px 16px 40px;
    }

    .welcome {
        padding: 25px;
        align-items: flex-start;
        flex-direction: column;
        gap: 25px;
    }

    .welcome h2 {
        font-size: 24px;
    }

    .stats {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   V1.014C DEVICE MANAGER
   ========================================================= */

.live-device-card {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fbfcfe;
}

.live-device-main {
    display: flex;
    align-items: center;
    gap: 18px;
}

.live-device-info h4 {
    margin: 0 0 5px;
    font-size: 14px;
}

.device-number {
    margin: 0 0 7px !important;
    color: var(--muted);
    font-size: 11px;
}

.device-state {
    font-size: 10px;
    font-weight: 800;
}

.device-state.connected,
.good-text {
    color: #16a36a !important;
}

.device-state.disconnected,
.warn-text {
    color: #d97706 !important;
}

.device-meta {
    display: flex;
    gap: 14px;
    margin-top: 9px;
    color: var(--muted);
    font-size: 9px;
}

.device-meta b {
    color: var(--text);
    text-transform: uppercase;
}

.device-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(5, 12, 24, .58);
    backdrop-filter: blur(5px);
}

.device-modal-backdrop.open {
    display: flex;
}

.device-modal {
    width: min(600px, 100%);
    max-height: 90vh;
    overflow: auto;
    background: white;
    border-radius: 20px;
    box-shadow:
        0 30px 100px
        rgba(0,0,0,.25);
}

.device-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 23px 25px;
    border-bottom:
        1px solid var(--border);
}

.device-modal-header h3 {
    margin: 5px 0 0;
    font-size: 18px;
}

.eyebrow-dark {
    color: var(--primary);
    font-size: 9px;
    letter-spacing: .15em;
    font-weight: 800;
}

.modal-close {
    width: 35px;
    height: 35px;
    border: 0;
    border-radius: 10px;
    background: #f3f5f8;
    cursor: pointer;
    font-size: 22px;
}

.device-modal-body {
    padding: 25px;
}

.device-detail-status {
    display: grid;
    grid-template-columns:
        repeat(3, 1fr);
    gap: 12px;
}

.device-detail-status > div {
    padding: 15px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.device-detail-status span,
.device-detail-status strong {
    display: block;
}

.device-detail-status span {
    color: var(--muted);
    font-size: 8px;
    letter-spacing: .1em;
    margin-bottom: 6px;
}

.device-detail-status strong {
    font-size: 11px;
}

.device-action-grid {
    display: grid;
    grid-template-columns:
        repeat(2, 1fr);
    gap: 12px;
    margin-top: 18px;
}

.device-action-btn {
    min-height: 105px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 14px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 16px;
    text-align: left;
}

.device-action-btn:hover {
    border-color: #b9c9e8;
    background: #f8fbff;
}

.device-action-btn b {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--primary);
}

.device-action-btn small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 9px;
}

.device-action-btn.primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.device-action-btn.primary b,
.device-action-btn.primary small {
    color: white;
}

.device-action-btn.danger b {
    color: #dc2626;
}

.device-tech {
    margin-top: 18px;
    border-top: 1px solid var(--border);
    padding-top: 15px;
    display: flex;
    gap: 20px;
    color: var(--muted);
    font-size: 9px;
}

.device-tech b {
    color: var(--text);
}

.qr-panel {
    text-align: center;
}

.qr-panel h4 {
    margin: 0 0 6px;
}

.qr-panel p {
    color: var(--muted);
    font-size: 11px;
}

.qr-frame {
    width: min(360px, 100%);
    aspect-ratio: 1;
    margin: 20px auto;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: white;
}

.qr-frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.qr-note {
    font-size: 9px !important;
}

.dse-toast {
    position: fixed;
    right: 25px;
    bottom: 25px;
    z-index: 2000;
    max-width: 360px;
    padding: 13px 17px;
    border-radius: 11px;
    color: white;
    background: #172033;
    box-shadow:
        0 15px 50px
        rgba(0,0,0,.22);
    font-size: 11px;
    opacity: 0;
    transform:
        translateY(15px);
    pointer-events: none;
    transition: .2s;
}

.dse-toast.show {
    opacity: 1;
    transform:
        translateY(0);
}

.dse-toast.success {
    background: #087a50;
}

.dse-toast.error {
    background: #b42318;
}

.activity-row {
    width: 100%;
    display: flex;
    gap: 13px;
    padding: 12px 0;
    border-bottom:
        1px solid #eef1f5;
    text-align: left;
}

.activity-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: #f8fafc;
}

.activity-icon.good {
    color: #16a36a;
    background: #ecfdf5;
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-content strong,
.activity-content span {
    display: block;
}

.activity-content strong {
    font-size: 11px;
}

.activity-content span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity-status {
    text-align: right;
    font-size: 9px;
    color: var(--muted);
}

.activity-status b,
.activity-status span {
    display: block;
}

.activity-status b {
    text-transform: uppercase;
}

@media (max-width: 620px) {

    .live-device-card {
        align-items: stretch;
        flex-direction: column;
    }

    .device-detail-status {
        grid-template-columns: 1fr;
    }

    .device-action-grid {
        grid-template-columns: 1fr;
    }

    .device-tech {
        flex-direction: column;
        gap: 6px;
    }
}

/* =========================================================
   V1.014D SEND MESSAGE
   ========================================================= */

.send-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.send-provider-status {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: 13px;
    background: #f8fafc;
    border: 1px solid var(--border);
}

.send-provider-icon {
    width: 39px;
    height: 39px;
    flex: 0 0 39px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: #ecfdf5;
    color: #16a36a;
    font-weight: 800;
}

.send-provider-status > div:nth-child(2) {
    flex: 1;
}

.send-provider-status strong,
.send-provider-status span {
    display: block;
}

.send-provider-status strong {
    font-size: 11px;
}

.send-provider-status
> div:nth-child(2)
> span {
    color: var(--muted);
    margin-top: 3px;
    font-size: 9px;
}

.send-provider-status
.send-online {
    color: #16a36a;
    font-size: 9px;
    font-weight: 800;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.form-group label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text);
}

.form-group select,
.form-group input,
.form-group textarea {
    width: 100%;
    border: 1px solid #dfe4eb;
    border-radius: 10px;
    outline: none;
    background: white;
    color: var(--text);
    padding: 11px 12px;
    font: inherit;
    font-size: 12px;
    transition: .18s;
}

.form-group select:focus,
.form-group input:focus,
.form-group textarea:focus {
    border-color: #7aa4f8;
    box-shadow:
        0 0 0 3px
        rgba(37,99,235,.08);
}

.form-group textarea {
    resize: vertical;
    min-height: 125px;
    line-height: 1.55;
}

.form-help {
    color: var(--muted);
    font-size: 9px;
    line-height: 1.5;
}

.phone-input-wrap {
    display: flex;
    align-items: center;
    border: 1px solid #dfe4eb;
    border-radius: 10px;
    overflow: hidden;
    background: white;
}

.phone-input-wrap > span {
    align-self: stretch;
    display: grid;
    place-items: center;
    min-width: 48px;
    background: #f4f7fb;
    border-right: 1px solid #dfe4eb;
    color: #64748b;
    font-size: 9px;
    font-weight: 800;
}

.phone-input-wrap input {
    border: 0;
    border-radius: 0;
}

.phone-input-wrap input:focus {
    box-shadow: none;
}

.label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.label-row span {
    color: var(--muted);
    font-size: 9px;
}

.send-preview {
    padding: 15px;
    border-radius: 13px;
    background: #eef8f2;
}

.send-preview > span {
    display: block;
    margin-bottom: 9px;
    color: #668073;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .1em;
}

.wa-bubble {
    width: fit-content;
    max-width: 85%;
    margin-left: auto;
    padding: 10px 12px;
    border-radius:
        12px 12px 3px 12px;
    background: #d9fdd3;
    color: #1c2b21;
    font-size: 11px;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.send-warning {
    display: flex;
    gap: 10px;
    padding: 12px;
    border: 1px solid #fde7b2;
    border-radius: 10px;
    background: #fffbeb;
    color: #7a5a13;
}

.send-warning > span {
    font-weight: 800;
}

.send-warning p {
    margin: 0;
    font-size: 9px;
    line-height: 1.55;
}

.send-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    padding-top: 4px;
}

.send-submit {
    min-width: 145px;
}

.send-submit:disabled {
    cursor: wait;
    opacity: .65;
}

.send-success {
    text-align: center;
    padding: 15px 0 5px;
}

.send-success-icon {
    width: 58px;
    height: 58px;
    margin: 0 auto 14px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #ecfdf5;
    color: #16a36a;
    font-size: 25px;
    font-weight: 800;
}

.send-success h4 {
    margin: 0;
    font-size: 17px;
}

.send-success > p {
    margin: 6px 0 20px;
    color: var(--muted);
    font-size: 11px;
}

.send-result-meta {
    display: grid;
    grid-template-columns:
        repeat(3, 1fr);
    gap: 9px;
    text-align: left;
}

.send-result-meta > div {
    padding: 12px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid var(--border);
}

.send-result-meta span,
.send-result-meta b {
    display: block;
}

.send-result-meta span {
    color: var(--muted);
    font-size: 7px;
    letter-spacing: .08em;
}

.send-result-meta b {
    margin-top: 5px;
    font-size: 9px;
    overflow-wrap: anywhere;
}

.send-empty {
    padding: 35px 20px;
    text-align: center;
}

.send-empty-icon {
    width: 55px;
    height: 55px;
    margin: auto;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background: #f2f5f9;
    color: #8793a6;
}

.send-empty h4 {
    margin: 14px 0 5px;
}

.send-empty p {
    max-width: 330px;
    margin: auto;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.6;
}

@media (max-width: 620px) {

    .send-result-meta {
        grid-template-columns: 1fr;
    }

    .send-footer {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .send-footer .button {
        width: 100%;
    }

    .wa-bubble {
        max-width: 95%;
    }
}

/* =========================================================
   V1.014E MESSAGE HISTORY
   ========================================================= */

.history-toolbar {
    display: grid;
    grid-template-columns:
        minmax(220px, 1fr)
        135px
        150px
        auto;
    gap: 9px;
    align-items: center;
}

.history-search {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: white;
    overflow: hidden;
}

.history-search span {
    padding-left: 12px;
    color: var(--muted);
}

.history-search input {
    width: 100%;
    border: 0;
    outline: 0;
    padding: 10px;
    font-size: 10px;
}

.history-select {
    height: 37px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: white;
    padding: 0 9px;
    font-size: 9px;
    outline: none;
}

.history-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 18px 0 10px;
}

.history-summary span {
    font-size: 10px;
    font-weight: 700;
}

.history-summary small {
    color: var(--muted);
    font-size: 9px;
}

.history-table {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.history-head,
.history-row {
    display: grid;
    grid-template-columns:
        130px
        minmax(160px, 1fr)
        115px
        90px
        135px
        65px;
    gap: 10px;
    align-items: center;
}

.history-head {
    padding: 10px 12px;
    background: #f7f9fc;
    border-bottom: 1px solid var(--border);
    color: var(--muted);
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.history-row {
    padding: 12px;
    border-bottom: 1px solid #eef1f5;
    font-size: 9px;
}

.history-row:last-child {
    border-bottom: 0;
}

.history-row:hover {
    background: #fafcff;
}

.history-recipient strong,
.history-recipient small {
    display: block;
}

.history-recipient strong {
    font-size: 10px;
}

.history-recipient small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 8px;
}

.history-message {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #4d5a70;
}

.history-device,
.history-date {
    color: var(--muted);
}

.history-status {
    display: inline-flex;
    padding: 4px 7px;
    border-radius: 20px;
    font-size: 7px;
    font-weight: 800;
    text-transform: uppercase;
}

.status-good {
    color: #087a50 !important;
    background: #ecfdf5;
}

.status-bad {
    color: #b42318 !important;
    background: #fef3f2;
}

.status-warn {
    color: #9a6700 !important;
    background: #fffaeb;
}

.history-detail-btn {
    border: 1px solid var(--border);
    border-radius: 7px;
    background: white;
    padding: 6px 8px;
    cursor: pointer;
    color: var(--primary);
    font-size: 8px;
    font-weight: 700;
}

.history-detail-btn:hover {
    background: var(--primary-soft);
}

.history-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
}

.history-pagination span {
    color: var(--muted);
    font-size: 9px;
}

.history-pagination button:disabled {
    opacity: .4;
    cursor: default;
}

.history-empty,
.history-loading {
    min-height: 190px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--muted);
    text-align: center;
}

.history-empty > div {
    width: 45px;
    height: 45px;
    margin-bottom: 10px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #f2f5f9;
}

.history-empty strong {
    color: var(--text);
    font-size: 11px;
}

.history-empty span {
    margin-top: 4px;
    font-size: 9px;
}

.history-loading {
    font-size: 10px;
}

.message-detail-top {
    display: grid;
    grid-template-columns:
        repeat(3, 1fr);
    gap: 10px;
}

.message-detail-top > div,
.message-detail-grid > div {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f8fafc;
}

.message-detail-top span,
.message-detail-top strong,
.message-detail-grid span,
.message-detail-grid b {
    display: block;
}

.message-detail-top span,
.message-detail-grid span {
    color: var(--muted);
    font-size: 7px;
    letter-spacing: .08em;
}

.message-detail-top strong,
.message-detail-grid b {
    margin-top: 5px;
    font-size: 9px;
    overflow-wrap: anywhere;
}

.message-detail-section {
    margin-top: 18px;
}

.message-detail-section > label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .1em;
}

.message-detail-body {
    padding: 14px;
    border-radius: 11px;
    background: #eef8f2;
    font-size: 10px;
    line-height: 1.7;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.message-detail-grid {
    display: grid;
    grid-template-columns:
        repeat(3, 1fr);
    gap: 9px;
    margin-top: 15px;
}

.message-detail-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.detail-timeline {
    border-left: 2px solid #e8ecf2;
    margin-left: 7px;
    padding-left: 16px;
}

.detail-timeline-item {
    position: relative;
    padding: 0 0 14px;
}

.detail-timeline-item > span {
    position: absolute;
    left: -22px;
    top: 2px;
    width: 10px;
    height: 10px;
    border: 2px solid white;
    border-radius: 50%;
    background: #c6ceda;
    box-shadow: 0 0 0 1px #dfe4eb;
}

.detail-timeline-item.active > span {
    background: var(--primary);
}

.detail-timeline-item strong,
.detail-timeline-item small {
    display: block;
}

.detail-timeline-item strong {
    font-size: 9px;
}

.detail-timeline-item small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 8px;
}

.attempt-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.attempt-item {
    display: grid;
    grid-template-columns:
        35px 1fr auto;
    gap: 8px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 9px;
}

.attempt-item span,
.attempt-item b,
.attempt-item small {
    font-size: 8px;
}

.attempt-item small {
    color: var(--muted);
}

.attempt-empty {
    color: var(--muted);
    font-size: 9px;
}

.message-error-box {
    margin-top: 15px;
    padding: 12px;
    border: 1px solid #fecdca;
    border-radius: 10px;
    background: #fef3f2;
    color: #b42318;
}

.message-error-box strong {
    font-size: 9px;
}

.message-error-box p {
    margin: 5px 0 0;
    font-size: 9px;
}

.message-detail-footer {
    display: flex;
    justify-content: space-between;
    gap: 9px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

@media (max-width: 820px) {

    .history-toolbar {
        grid-template-columns: 1fr 1fr;
    }

    .history-search-wide {
        grid-column: 1 / -1;
    }

    .history-table {
        overflow-x: auto;
    }

    .history-head,
    .history-row {
        min-width: 760px;
    }
}

@media (max-width: 620px) {

    .history-toolbar {
        grid-template-columns: 1fr;
    }

    .history-search-wide {
        grid-column: auto;
    }

    .message-detail-top,
    .message-detail-grid,
    .message-detail-columns {
        grid-template-columns: 1fr;
    }

    .message-detail-footer {
        flex-direction: column-reverse;
    }
}

/* =========================================================
   V1.014F SUPER ADMIN
   ========================================================= */

.super-admin-modal .device-modal {
    width: min(1180px, 96vw);
}

.admin-overview-grid {
    display: grid;
    grid-template-columns:
        repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.admin-stat {
    min-height: 105px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background:
        linear-gradient(
            180deg,
            #ffffff,
            #f9fbfe
        );
}

.admin-stat span,
.admin-stat strong,
.admin-stat small {
    display: block;
}

.admin-stat span {
    color: var(--muted);
    font-size: 7px;
    font-weight: 800;
    letter-spacing: .1em;
}

.admin-stat strong {
    margin: 8px 0 5px;
    font-size: 23px;
}

.admin-stat small {
    color: var(--muted);
    font-size: 8px;
}

.admin-section {
    margin-top: 18px;
    padding: 17px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: white;
}

.admin-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 13px;
}

.admin-section-head h4 {
    margin: 0;
    font-size: 12px;
}

.admin-section-head p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 8px;
}

.admin-search {
    width: 230px;
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 9px;
    overflow: hidden;
}

.admin-search span {
    padding-left: 10px;
    color: var(--muted);
}

.admin-search input {
    width: 100%;
    border: 0;
    outline: 0;
    padding: 9px;
    font-size: 9px;
}

.admin-table {
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.admin-table-row {
    display: grid;
    grid-template-columns:
        minmax(180px, 1.5fr)
        90px
        90px
        75px
        85px
        90px;
    gap: 12px;
    align-items: center;
    padding: 11px 12px;
    border-bottom:
        1px solid #eef1f5;
    font-size: 9px;
}

.admin-table-row:last-child {
    border-bottom: 0;
}

.admin-table-head {
    background: #f7f9fc;
    color: var(--muted);
    font-size: 7px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.admin-table-row strong,
.admin-table-row small {
    display: block;
}

.admin-table-row strong {
    font-size: 9px;
}

.admin-table-row small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 7px;
}

.admin-badge {
    display: inline-flex;
    padding: 4px 7px;
    border-radius: 20px;
    font-size: 7px;
    font-weight: 800;
    text-transform: uppercase;
}

.admin-badge.good {
    color: #087a50;
    background: #ecfdf5;
}

.admin-badge.bad {
    color: #b42318;
    background: #fef3f2;
}

.admin-badge.neutral {
    color: #596579;
    background: #f2f5f9;
}

.admin-two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.admin-device-list,
.admin-message-list {
    display: flex;
    flex-direction: column;
}

.admin-device-row {
    display: grid;
    grid-template-columns:
        10px
        minmax(130px, 1fr)
        130px
        75px
        90px;
    gap: 10px;
    align-items: center;
    padding: 10px 0;
    border-bottom:
        1px solid #eef1f5;
    font-size: 8px;
}

.admin-device-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #16a36a;
}

.admin-device-main strong,
.admin-device-main span {
    display: block;
}

.admin-device-main strong {
    font-size: 9px;
}

.admin-device-main span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 7px;
}

.admin-message-row {
    display: grid;
    grid-template-columns:
        minmax(140px, 1fr)
        75px
        105px;
    gap: 10px;
    align-items: center;
    padding: 10px 0;
    border-bottom:
        1px solid #eef1f5;
}

.admin-message-row strong,
.admin-message-row span {
    display: block;
}

.admin-message-row strong {
    font-size: 9px;
}

.admin-message-row span,
.admin-message-row small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 7px;
}

.admin-system-strip {
    margin-top: 18px;
    padding: 13px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 12px;
    background: #0d1726;
    color: white;
}

.admin-system-strip > div {
    display: flex;
    align-items: center;
    gap: 9px;
}

.admin-system-strip strong {
    font-size: 9px;
}

.admin-system-strip small {
    color: #8da0b9;
    font-size: 7px;
}

.admin-system-strip .button {
    color: white;
    border-color: #34445a;
    background: #17263b;
}

.admin-empty,
.admin-loading,
.admin-error {
    min-height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 9px;
}

.admin-error {
    flex-direction: column;
}

.admin-error > div {
    width: 42px;
    height: 42px;
    margin-bottom: 9px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: #fef3f2;
    color: #b42318;
}

.admin-error strong,
.admin-error span {
    display: block;
}

.admin-error strong {
    color: var(--text);
    font-size: 10px;
}

.admin-error span {
    margin-top: 4px;
    font-size: 8px;
}

@media (max-width: 950px) {

    .admin-overview-grid {
        grid-template-columns:
            repeat(2, 1fr);
    }

    .admin-two-columns {
        grid-template-columns:
            1fr;
    }

    .admin-table {
        overflow-x: auto;
    }

    .admin-table-row {
        min-width: 720px;
    }
}

@media (max-width: 620px) {

    .admin-overview-grid {
        grid-template-columns: 1fr;
    }

    .admin-section-head {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-search {
        width: 100%;
    }
}

/* =========================================================
   V1.014G TENANT MANAGEMENT
   ========================================================= */

.tenant-management-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.tenant-management-actions span {
    color: var(--muted);
    font-size: 8px;
}

.tenant-clickable {
    cursor: pointer;
}

.tenant-clickable:hover {
    background: #f7faff;
}

.tenant-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    border-bottom:
        1px solid var(--border);
}

.tenant-detail-header h3 {
    margin: 5px 0 3px;
}

.tenant-detail-header p {
    margin: 0;
    color: var(--muted);
    font-size: 9px;
}

.tenant-metric-grid {
    display: grid;
    grid-template-columns:
        repeat(4, 1fr);
    gap: 10px;
    margin-top: 16px;
}

.tenant-metric-grid > div {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #f8fafc;
}

.tenant-metric-grid span,
.tenant-metric-grid strong {
    display: block;
}

.tenant-metric-grid span {
    color: var(--muted);
    font-size: 7px;
    letter-spacing: .08em;
}

.tenant-metric-grid strong {
    margin-top: 6px;
    font-size: 18px;
}

.tenant-token-row {
    display: grid;
    grid-template-columns:
        minmax(150px, 1fr)
        80px
        150px
        80px;
    gap: 10px;
    align-items: center;
    padding: 10px 0;
    border-bottom:
        1px solid #eef1f5;
}

.tenant-token-row strong,
.tenant-token-row small {
    display: block;
    font-size: 8px;
}

.tenant-token-row small {
    color: var(--muted);
}

.tenant-device-row {
    display: grid;
    grid-template-columns:
        minmax(150px, 1fr)
        90px
        90px;
    gap: 10px;
    align-items: center;
    padding: 10px 0;
    border-bottom:
        1px solid #eef1f5;
}

.tenant-device-row strong,
.tenant-device-row small {
    display: block;
}

.tenant-device-row strong {
    font-size: 9px;
}

.tenant-device-row small {
    color: var(--muted);
    font-size: 8px;
}

.tenant-danger-zone {
    margin-top: 18px;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    border: 1px solid #fecdca;
    border-radius: 12px;
    background: #fff8f7;
}

.tenant-danger-zone strong,
.tenant-danger-zone span {
    display: block;
}

.tenant-danger-zone strong {
    font-size: 10px;
}

.tenant-danger-zone span {
    margin-top: 3px;
    color: #7a5960;
    font-size: 8px;
}

.tenant-suspend {
    color: #b42318;
    border-color: #fecdca;
}

.token-created {
    text-align: center;
    padding: 20px;
}

.token-created p {
    color: var(--muted);
    font-size: 9px;
}

.token-secret {
    margin: 18px 0;
    padding: 15px;
    border: 1px dashed #96a8bf;
    border-radius: 10px;
    background: #f7f9fc;
    font-family: monospace;
    font-size: 9px;
    overflow-wrap: anywhere;
    text-align: left;
}

.audit-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.audit-toolbar span {
    color: var(--muted);
    font-size: 8px;
}

.audit-table {
    border: 1px solid var(--border);
    border-radius: 11px;
    overflow: hidden;
}

.audit-row {
    display: grid;
    grid-template-columns:
        minmax(160px, 1.3fr)
        130px
        80px
        120px
        145px;
    gap: 10px;
    align-items: center;
    padding: 11px;
    border-bottom:
        1px solid #eef1f5;
    font-size: 8px;
}

.audit-row:last-child {
    border-bottom: 0;
}

.audit-row strong,
.audit-row small {
    display: block;
}

.audit-row small {
    color: var(--muted);
    font-size: 7px;
}

@media (max-width: 720px) {

    .tenant-metric-grid {
        grid-template-columns:
            repeat(2, 1fr);
    }

    .tenant-token-row,
    .tenant-device-row {
        grid-template-columns: 1fr;
    }

    .tenant-danger-zone {
        align-items: stretch;
        flex-direction: column;
    }

    .audit-table {
        overflow-x: auto;
    }

    .audit-row {
        min-width: 700px;
    }
}

/* V1.015B3 LOGIN */

.dse-login-page {
    margin: 0;
    min-height: 100vh;
    display: grid;
    place-items: center;
    font-family: Arial, sans-serif;
    background: #f5f7fb;
}

.dse-login-shell {
    width: min(1000px, 92vw);
    min-height: 600px;
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    overflow: hidden;
    border-radius: 24px;
    background: #fff;
    box-shadow:
        0 25px 70px
        rgba(15,23,42,.15);
}

.dse-login-brand {
    padding: 65px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: white;
    background:
        linear-gradient(
            145deg,
            #07182d,
            #123c70
        );
}

.dse-login-logo {
    width: 55px;
    height: 55px;
    display: grid;
    place-items: center;
    margin-bottom: 35px;
    border-radius: 15px;
    background: #2875f5;
    font-weight: 900;
}

.dse-login-eyebrow {
    color: #80b0ff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .15em;
}

.dse-login-brand h1 {
    max-width: 450px;
    margin: 14px 0;
    font-size: 42px;
    line-height: 1.08;
}

.dse-login-brand p {
    max-width: 430px;
    color: #bdcce0;
    line-height: 1.7;
}

.dse-login-features {
    margin-top: 30px;
    display: grid;
    grid-template-columns:
        1fr 1fr;
    gap: 12px;
    color: #dce8f7;
}

.dse-login-card {
    padding: 65px 55px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.dse-login-title span {
    color: #2563eb;
    font-size: 11px;
    font-weight: 900;
}

.dse-login-title h2 {
    margin: 8px 0;
}

.dse-login-title p {
    margin: 0 0 30px;
    color: #7b8799;
}

.dse-login-card form {
    display: grid;
    gap: 18px;
}

.dse-login-card label {
    display: grid;
    gap: 7px;
    font-size: 12px;
    font-weight: 700;
}

.dse-login-card input {
    padding: 13px;
    border: 1px solid #d7dee8;
    border-radius: 9px;
    outline: none;
}

.dse-login-card input:focus {
    border-color: #2875f5;
}

.dse-login-card button {
    padding: 13px;
    border: 0;
    border-radius: 9px;
    background: #2563eb;
    color: white;
    font-weight: 800;
    cursor: pointer;
}

.dse-login-error {
    padding: 10px;
    border-radius: 8px;
    color: #b42318;
    background: #fef3f2;
    font-size: 12px;
}

.dse-login-security {
    margin-top: 25px;
    padding-top: 18px;
    border-top: 1px solid #edf0f4;
    color: #8490a2;
    font-size: 11px;
}

@media(max-width:760px) {

    .dse-login-shell {
        width: 100%;
        min-height: 100vh;
        grid-template-columns: 1fr;
        border-radius: 0;
    }

    .dse-login-brand {
        padding: 35px 28px;
    }

    .dse-login-brand h1 {
        font-size: 30px;
    }

    .dse-login-card {
        padding: 38px 28px;
    }
}

/* V1.015B3C LOGOUT */

.logout-button {
    margin: auto 16px 16px;
    padding: 10px 13px;

    display: flex;
    align-items: center;
    gap: 9px;

    border: 1px solid rgba(255,255,255,.12);
    border-radius: 9px;

    background: rgba(255,255,255,.05);
    color: #b9c8dc;

    cursor: pointer;
    font-size: 10px;
}

.logout-button:hover {
    background: rgba(255,255,255,.1);
    color: white;
}

.logout-button:disabled {
    opacity: .6;
    cursor: wait;
}


/* =========================================================
   V1015B5D1 BRANDING CMS
   ========================================================= */

.admin-branding-view {
    padding: 28px;
}


.branding-cms-grid {
    margin-top: 22px;

    display: grid;
    grid-template-columns:
        repeat(
            3,
            minmax(0, 1fr)
        );

    gap: 18px;
}


.branding-cms-card {
    padding: 22px;

    border:
        1px solid #e3e8ef;

    border-radius:
        12px;

    background:
        #fff;
}


.branding-cms-card h3 {
    margin:
        0 0 20px;

    font-size:
        15px;
}


.branding-cms-card label {
    margin-bottom:
        15px;

    display: grid;
    gap: 7px;

    color:
        #475467;

    font-size:
        12px;

    font-weight:
        700;
}


.branding-cms-card input[type="text"] {
    width: 100%;
    box-sizing: border-box;

    padding:
        11px 12px;

    border:
        1px solid #d6dde6;

    border-radius:
        8px;

    outline: none;
}


.branding-cms-card input[type="text"]:focus {
    border-color:
        #087cff;
}


.branding-color-grid {
    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap:
        14px 16px;
}


.branding-color-grid input[type="color"] {
    width:
        100%;

    height:
        42px;

    padding:
        3px;

    border:
        1px solid #d6dde6;

    border-radius:
        8px;

    background:
        #fff;

    cursor:
        pointer;
}


.branding-menu-list {
    display: grid;
    gap: 13px;
}


.branding-menu-list label {
    margin: 0;

    padding: 11px 13px;

    display: flex;
    align-items: center;
    grid-template-columns: none;
    gap: 10px;

    border:
        1px solid #e4e8ee;

    border-radius:
        8px;

    background:
        #f8fafc;
}


.branding-logo-preview {
    min-height:
        100px;

    margin-top:
        14px;

    padding:
        16px;

    display: flex;
    align-items: center;
    justify-content: center;

    border:
        1px dashed #cbd5e1;

    border-radius:
        10px;

    background:
        #071a33;
}


.branding-logo-preview img {
    max-width:
        100%;

    max-height:
        90px;

    object-fit:
        contain;
}


.branding-cms-status {
    margin-top:
        15px;

    padding:
        10px 13px;

    border-radius:
        8px;

    font-size:
        12px;
}


.branding-cms-status.success {
    background:
        #ecfdf3;

    color:
        #027a48;
}


.branding-cms-status.error {
    background:
        #fef3f2;

    color:
        #b42318;
}


.branding-cms-status.info {
    background:
        #eff6ff;

    color:
        #175cd3;
}


@media(max-width:1100px) {

    .branding-cms-grid {
        grid-template-columns:
            1fr 1fr;
    }
}


@media(max-width:760px) {

    .branding-cms-grid {
        grid-template-columns:
            1fr;
    }
}



/* =========================================================
   V1015B5D2 LOGO UPLOAD
   ========================================================= */

.branding-upload-box {
    margin-top:
        16px;

    padding-top:
        16px;

    border-top:
        1px solid #e5e9ef;
}


.branding-upload-label {
    margin-bottom:
        8px !important;
}


.branding-upload-box
input[type="file"] {

    width:
        100%;

    box-sizing:
        border-box;

    margin-bottom:
        12px;

    padding:
        10px;

    border:
        1px solid #d7dee7;

    border-radius:
        8px;

    background:
        #f8fafc;

    font-size:
        12px;
}


.branding-upload-box
#brandingUploadButton {

    width:
        100%;

    margin:
        5px 0 10px;

    padding:
        11px 14px;

    border:
        1px solid #087cff;

    background:
        #087cff;

    color:
        #fff;

    cursor:
        pointer;
}


.branding-upload-box
#brandingUploadButton:hover {

    filter:
        brightness(.95);
}


.branding-upload-box
#brandingUploadButton:disabled {

    opacity:
        .6;

    cursor:
        wait;
}


.branding-local-preview {
    margin:
        12px 0;

    padding:
        14px;

    min-height:
        80px;

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    border:
        1px dashed #b8c4d3;

    border-radius:
        9px;

    background:
        #071a33;
}


.branding-local-preview[hidden] {
    display:
        none;
}


.branding-local-preview img {

    max-width:
        100%;

    max-height:
        90px;

    object-fit:
        contain;
}



/* =========================================================
   V1015B5D3 GLOBAL ADMIN BRANDING
   ========================================================= */

:root {
    --admin-primary:
        #087cff;

    --admin-sidebar-start:
        #031426;

    --admin-sidebar-end:
        #08294d;

    --admin-accent:
        #00c8ff;

    --admin-success:
        #00d96f;

    --admin-hero-start:
        #073c70;

    --admin-hero-end:
        #087cff;
}


body[data-dashboard-role="super_admin"]
.sidebar {

    background:
        linear-gradient(
            180deg,
            var(--admin-sidebar-start)
                0%,
            var(--admin-sidebar-end)
                100%
        );
}


body[data-dashboard-role="super_admin"]
.admin-brand {

    min-height:
        105px;

    padding:
        18px 20px;

    display:
        flex;

    align-items:
        center;

    gap:
        13px;

    border-bottom:
        1px solid
        rgba(
            255,
            255,
            255,
            .08
        );
}


body[data-dashboard-role="super_admin"]
.admin-brand-logo {

    width:
        120px;

    max-height:
        58px;

    object-fit:
        contain;

    flex-shrink:
        0;
}


body[data-dashboard-role="super_admin"]
.admin-brand-copy {

    display:
        none;
}


/*
 * Logo already contains DSE WA text,
 * so duplicated copy stays hidden.
 */


body[data-dashboard-role="super_admin"]
.nav-item.active {

    box-shadow:
        inset 3px 0 0
        var(--admin-accent);
}


body[data-dashboard-role="super_admin"]
.btn-primary {

    background:
        var(--admin-primary);

    border-color:
        var(--admin-primary);
}


body[data-dashboard-role="super_admin"]
.welcome {

    background:
        linear-gradient(
            135deg,
            var(--admin-hero-start),
            var(--admin-hero-end)
        );
}


body[data-dashboard-role="super_admin"]
.system-dot {

    background:
        var(--admin-success);
}



/* =========================================================
   V1015B5D4 LOGO BACKGROUND UI
   ========================================================= */

.branding-logo-bg-control {
    display: grid;
    grid-template-columns:
        70px 1fr auto;
    gap: 9px;
    align-items: center;
}


.branding-logo-bg-control
input[type="color"] {
    width: 70px;
    height: 42px;
}


.branding-logo-bg-control
input[type="text"] {
    height: 42px;
}


.branding-logo-bg-control
button {
    height: 42px;
    padding: 0 13px;
}


.branding-logo-preview {
    transition:
        background .2s ease;
}



/* =========================================================
   V1015B5D5 ADMIN LOGO SYNC
   Same dimensions as Customer Sidebar
   ========================================================= */

body[data-dashboard-role="super_admin"]
.admin-brand {

    min-height:
        122px;

    padding:
        18px 22px 17px;

    display:
        flex;

    flex-direction:
        column;

    justify-content:
        center;

    align-items:
        flex-start;

    box-sizing:
        border-box;
}


body[data-dashboard-role="super_admin"]
.admin-brand-logo {

    display:
        block;

    width:
        205px;

    max-width:
        100%;

    height:
        auto;

    max-height:
        none;

    object-fit:
        contain;

    flex-shrink:
        0;
}


@media(max-width:900px) {

    body[data-dashboard-role="super_admin"]
    .admin-brand-logo {

        width:
            180px;
    }
}


.branding-theme-help {

    margin:
        0 0 16px;

    padding:
        10px 12px;

    border:
        1px solid #dbeafe;

    border-radius:
        8px;

    background:
        #eff6ff;

    color:
        #315b8a;

    font-size:
        12px;

    line-height:
        1.5;
}



/* =========================================================
   V1015B5D5 ADMIN GLOBAL SIDEBAR
   ========================================================= */

body[data-dashboard-role="super_admin"]
.sidebar {

    background:
        linear-gradient(
            180deg,
            var(--admin-sidebar-start)
                0%,
            var(--admin-sidebar-end)
                100%
        );
}



/* =========================================================
   V1015B5D5A SIDEBAR SETTINGS PANEL
   ========================================================= */

.sidebar-settings-panel {

    margin-bottom:
        22px;

    padding:
        18px;

    border:
        1px solid #dce4ee;

    border-radius:
        12px;

    background:
        #f8fbff;
}


.sidebar-settings-title {

    margin-bottom:
        16px;
}


.sidebar-settings-title h4 {

    margin:
        0 0 4px;

    font-size:
        15px;

    color:
        #162033;
}


.sidebar-settings-title p {

    margin:
        0;

    color:
        #667085;

    font-size:
        12px;
}


.sidebar-settings-controls {

    display:
        grid;

    grid-template-columns:
        1fr 1fr;

    gap:
        16px;

    margin-bottom:
        18px;
}


.sidebar-preview-label {

    display:
        block;

    margin-bottom:
        8px;

    color:
        #475467;

    font-size:
        12px;

    font-weight:
        700;
}


.sidebar-theme-preview {

    min-height:
        190px;

    padding:
        18px;

    border-radius:
        12px;

    background:
        linear-gradient(
            180deg,
            #031426,
            #08294d
        );

    box-shadow:
        inset 0 0 0 1px
        rgba(255,255,255,.08);

    transition:
        background .18s ease;
}


.sidebar-preview-logo {

    margin-bottom:
        20px;

    color:
        #fff;

    font-size:
        18px;

    font-weight:
        800;
}


.sidebar-preview-menu {

    margin-bottom:
        8px;

    padding:
        10px 12px;

    border-radius:
        8px;

    color:
        rgba(255,255,255,.82);

    font-size:
        12px;
}


.sidebar-preview-menu.active {

    background:
        rgba(0,200,255,.14);

    box-shadow:
        inset 3px 0 0
        #00c8ff;

    color:
        #fff;
}


@media(max-width:760px) {

    .sidebar-settings-controls {
        grid-template-columns:
            1fr;
    }
}



/* =========================================================
   V1015B5D6 ADMIN SIDEBAR POLISH
   ========================================================= */

body[data-dashboard-role="super_admin"]
.sidebar {

    color:
        #ffffff;
}


/* NAVIGATION TEXT */

body[data-dashboard-role="super_admin"]
.sidebar
.nav-item {

    color:
        rgba(
            255,
            255,
            255,
            .92
        );

    font-weight:
        650;

    transition:
        background .18s ease,
        color .18s ease,
        border-color .18s ease;
}


body[data-dashboard-role="super_admin"]
.sidebar
.nav-item span {

    color:
        #ffffff;
}


body[data-dashboard-role="super_admin"]
.sidebar
.nav-item:hover {

    color:
        #ffffff;

    background:
        rgba(
            255,
            255,
            255,
            .09
        );
}


body[data-dashboard-role="super_admin"]
.sidebar
.nav-item.active {

    color:
        #ffffff;

    font-weight:
        750;

    background:
        rgba(
            17,
            103,
            255,
            .22
        );

    border-color:
        rgba(
            0,
            200,
            255,
            .95
        );
}


/* SECTION LABEL */

body[data-dashboard-role="super_admin"]
.sidebar
.navigation-title,
body[data-dashboard-role="super_admin"]
.sidebar
.nav-section-title {

    color:
        rgba(
            255,
            255,
            255,
            .52
        );

    font-weight:
        800;

    letter-spacing:
        .09em;
}


/* SYSTEM STATUS */

body[data-dashboard-role="super_admin"]
.sidebar-footer strong {

    color:
        #ffffff;

    font-weight:
        750;
}


body[data-dashboard-role="super_admin"]
.sidebar-footer span {

    color:
        rgba(
            255,
            255,
            255,
            .64
        );
}


/* LOGOUT */

body[data-dashboard-role="super_admin"]
.logout-button {

    color:
        #ffffff;

    font-weight:
        750;

    border:
        1px solid
        rgba(
            255,
            255,
            255,
            .42
        );

    background:
        rgba(
            255,
            255,
            255,
            .055
        );

    box-shadow:
        inset 0 0 0 1px
        rgba(
            255,
            255,
            255,
            .035
        );

    transition:
        background .18s ease,
        border-color .18s ease,
        transform .18s ease;
}


body[data-dashboard-role="super_admin"]
.logout-button:hover {

    background:
        rgba(
            255,
            255,
            255,
            .14
        );

    border-color:
        rgba(
            255,
            255,
            255,
            .82
        );

    transform:
        translateY(-1px);
}


/* POWERED BY */

body[data-dashboard-role="super_admin"]
.dse-sidebar-powered {

    margin:
        16px 20px 0;

    padding:
        18px 4px 15px;

    border-top:
        1px solid
        rgba(
            255,
            255,
            255,
            .16
        );

    text-align:
        center;

    color:
        #ffffff;
}


body[data-dashboard-role="super_admin"]
.dse-powered-label {

    display:
        block;

    margin-bottom:
        7px;

    color:
        rgba(
            255,
            255,
            255,
            .58
        );

    font-size:
        9px;

    font-weight:
        800;

    letter-spacing:
        .12em;
}


body[data-dashboard-role="super_admin"]
.dse-powered-brand {

    display:
        block;

    color:
        #ffffff;

    font-size:
        13px;

    font-weight:
        800;

    letter-spacing:
        .035em;
}


body[data-dashboard-role="super_admin"]
.dse-powered-dse {

    color:
        #39a8ff;

    font-style:
        italic;

    margin-right:
        3px;
}


body[data-dashboard-role="super_admin"]
.dse-sidebar-powered small {

    display:
        block;

    margin-top:
        5px;

    color:
        rgba(
            255,
            255,
            255,
            .52
        );

    font-size:
        9px;
}



/* =========================================================
   V1015B7B SUPER ADMIN DEVICE FLEET
   ========================================================= */

.admin-device-fleet-view {

    padding:
        28px;
}


.admin-device-fleet-status {

    margin:
        16px 0;

    padding:
        11px 14px;

    border-radius:
        9px;

    font-size:
        12px;
}


.admin-device-fleet-status.info {

    background:
        #eff6ff;

    color:
        #175cd3;
}


.admin-device-fleet-status.success {

    background:
        #ecfdf3;

    color:
        #027a48;
}


.admin-device-fleet-status.error {

    background:
        #fef3f2;

    color:
        #b42318;
}


.admin-device-summary {

    display:
        grid;

    grid-template-columns:
        repeat(
            3,
            minmax(0,1fr)
        );

    gap:
        14px;

    margin:
        20px 0;
}


.admin-device-summary-card {

    padding:
        18px;

    border:
        1px solid #e3e8ef;

    border-radius:
        12px;

    background:
        #fff;
}


.admin-device-summary-card span {

    display:
        block;

    margin-bottom:
        6px;

    color:
        #667085;

    font-size:
        11px;
}


.admin-device-summary-card strong {

    color:
        #101828;

    font-size:
        28px;
}


.admin-device-fleet-grid {

    display:
        grid;

    grid-template-columns:
        repeat(
            3,
            minmax(0,1fr)
        );

    gap:
        16px;
}


.admin-device-card {

    padding:
        19px;

    border:
        1px solid #e2e8f0;

    border-radius:
        13px;

    background:
        #fff;

    box-shadow:
        0 5px 16px
        rgba(15,23,42,.04);
}


.admin-device-card-head {

    display:
        flex;

    align-items:
        center;

    justify-content:
        space-between;

    margin-bottom:
        16px;
}


.admin-device-icon {

    width:
        40px;

    height:
        40px;

    display:
        grid;

    place-items:
        center;

    border-radius:
        11px;

    background:
        #eef7ff;

    color:
        #087cff;

    font-size:
        19px;
}


.admin-device-status {

    display:
        inline-flex;

    align-items:
        center;

    gap:
        6px;

    padding:
        6px 8px;

    border-radius:
        999px;

    background:
        #f2f4f7;

    color:
        #475467;

    font-size:
        9px;

    font-weight:
        800;

    letter-spacing:
        .05em;
}


.admin-device-status span {

    width:
        6px;

    height:
        6px;

    border-radius:
        50%;

    background:
        #98a2b3;
}


.admin-device-status.connected {

    background:
        #ecfdf3;

    color:
        #027a48;
}


.admin-device-status.connected span {

    background:
        #12b76a;
}


.admin-device-status.disconnected,
.admin-device-status.failed {

    background:
        #fef3f2;

    color:
        #b42318;
}


.admin-device-status.disconnected span,
.admin-device-status.failed span {

    background:
        #f04438;
}


.admin-device-card-title {

    display:
        grid;

    gap:
        4px;

    margin-bottom:
        15px;
}


.admin-device-card-title strong {

    color:
        #101828;

    font-size:
        15px;
}


.admin-device-card-title span {

    color:
        #667085;

    font-size:
        12px;
}


.admin-device-tenant {

    margin-bottom:
        14px;

    padding:
        11px 12px;

    border-radius:
        9px;

    background:
        #f8fafc;
}


.admin-device-tenant span,
.admin-device-meta span {

    display:
        block;

    margin-bottom:
        3px;

    color:
        #98a2b3;

    font-size:
        9px;

    font-weight:
        750;

    text-transform:
        uppercase;
}


.admin-device-tenant strong,
.admin-device-meta strong {

    color:
        #344054;

    font-size:
        11px;
}


.admin-device-meta {

    display:
        grid;

    grid-template-columns:
        1fr 1fr;

    gap:
        10px;

    margin-bottom:
        16px;
}


.admin-device-manage {

    width:
        100%;

    padding:
        10px 12px;

    border:
        1px solid #dbeafe;

    border-radius:
        9px;

    background:
        #eff6ff;

    color:
        #175cd3;

    font-size:
        11px;

    font-weight:
        750;

    cursor:
        pointer;
}


.admin-device-manage:hover {

    background:
        #dbeafe;
}


.admin-device-empty {

    grid-column:
        1 / -1;

    padding:
        35px;

    border:
        1px dashed #d0d5dd;

    border-radius:
        12px;

    text-align:
        center;

    color:
        #667085;

    background:
        #fff;
}


/* MODAL */

.admin-device-modal {

    position:
        fixed;

    inset:
        0;

    z-index:
        9000;
}


.admin-device-modal[hidden] {

    display:
        none;
}


.admin-device-modal-backdrop {

    position:
        absolute;

    inset:
        0;

    background:
        rgba(15,23,42,.56);

    backdrop-filter:
        blur(3px);
}


.admin-device-modal-card {

    position:
        absolute;

    top:
        50%;

    left:
        50%;

    width:
        min(
            620px,
            calc(100vw - 32px)
        );

    max-height:
        calc(100vh - 40px);

    overflow:
        auto;

    transform:
        translate(
            -50%,
            -50%
        );

    border-radius:
        15px;

    background:
        #fff;

    box-shadow:
        0 30px 80px
        rgba(15,23,42,.28);
}


.admin-device-modal-head {

    display:
        flex;

    justify-content:
        space-between;

    align-items:
        flex-start;

    padding:
        20px 22px;

    border-bottom:
        1px solid #eaecf0;
}


.admin-device-modal-label {

    color:
        #667085;

    font-size:
        9px;

    font-weight:
        800;

    letter-spacing:
        .1em;
}


.admin-device-modal-head h3 {

    margin:
        5px 0 0;

    color:
        #101828;
}


.admin-device-modal-close {

    width:
        34px;

    height:
        34px;

    border:
        0;

    border-radius:
        8px;

    background:
        #f2f4f7;

    color:
        #344054;

    font-size:
        22px;

    cursor:
        pointer;
}


.admin-device-detail-body {

    padding:
        22px;
}


.admin-device-detail-status {

    margin-bottom:
        18px;
}


.admin-device-detail-grid {

    display:
        grid;

    grid-template-columns:
        1fr 1fr;

    gap:
        12px;
}


.admin-device-detail-grid > div {

    padding:
        13px;

    border:
        1px solid #eaecf0;

    border-radius:
        9px;
}


.admin-device-detail-grid span {

    display:
        block;

    margin-bottom:
        4px;

    color:
        #98a2b3;

    font-size:
        9px;

    font-weight:
        750;

    text-transform:
        uppercase;
}


.admin-device-detail-grid strong {

    display:
        block;

    color:
        #344054;

    font-size:
        12px;
}


.admin-device-detail-grid small {

    display:
        block;

    margin-top:
        3px;

    color:
        #667085;
}


.admin-device-detail-note {

    margin-top:
        18px;

    padding:
        12px 14px;

    border:
        1px solid #dbeafe;

    border-radius:
        9px;

    background:
        #eff6ff;

    color:
        #315b8a;

    font-size:
        11px;

    line-height:
        1.5;
}


body.admin-device-modal-open {

    overflow:
        hidden;
}


@media(max-width:1100px) {

    .admin-device-fleet-grid {
        grid-template-columns:
            1fr 1fr;
    }
}


@media(max-width:720px) {

    .admin-device-summary,
    .admin-device-fleet-grid,
    .admin-device-detail-grid {

        grid-template-columns:
            1fr;
    }

    .admin-device-fleet-view {
        padding:
            18px;
    }
}

