:root {
    --dae-blue: #164e9a;
    --dae-blue-2: #2168bd;
    --dae-red: #c9363e;
    --dae-yellow: #f2c94c;
    --ink: #172b46;
    --muted: #728198;
    --line: #e5ebf3;
    --bg: #f5f7fb;
    --surface: #fff;
    --green: #238a67;
    --radius: 17px
}
* {
    box-sizing: border-box
}
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif
}
a {
    color: inherit;
    text-decoration: none
}
button, input {
    font: inherit
}
.login-shell {
    min-height: 100svh;
    display: grid;
    place-items: center;
    padding: 22px;
    background: radial-gradient(ellipse at 8% 10%, #dceafe 0, transparent 42%), radial-gradient(ellipse at 92% 88%, #fff0d8 0, transparent 30%), var(--bg)
}
.login-card {
    width: min(100%, 430px);
    padding: clamp(24px, 6vw, 42px);
    background: #fff;
    border: 1px solid #e8edf5;
    border-radius: 24px;
    box-shadow: 0 24px 70px #15335b12
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px
}
.brand img {
    width: 76px;
    height: 52px;
    object-fit: contain
}
.brand strong {
    display: block;
    font-size: 21px;
    letter-spacing: -.7px;
    color: var(--dae-blue)
}
.brand span {
    display: block;
    color: var(--muted);
    font-size: 12px
}
.eyebrow {
    font-size: 10px;
    letter-spacing: 1.8px;
    font-weight: 800;
    color: var(--dae-blue);
    margin: 30px 0 7px
}
.login-card h1 {
    font-size: 32px;
    letter-spacing: -1.2px;
    margin: 0
}
.muted {
    color: var(--muted);
    margin: 7px 0 26px
}
.login-card label {
    display: block;
    font-weight: 650;
    font-size: 13px;
    margin: 17px 0 7px
}
.login-card input {
    width: 100%;
    border: 1px solid #dce4ef;
    border-radius: 10px;
    padding: 13px 14px;
    outline: none;
    background: #fbfcfe
}
.login-card input:focus {
    border-color: var(--dae-blue-2);
    box-shadow: 0 0 0 3px #2168bd1b
}
.btn {
    border: 0;
    border-radius: 10px;
    padding: 13px 16px;
    font-weight: 700;
    cursor: pointer
}
.primary {
    background: var(--dae-blue);
    color: white
}
.primary:hover {
    background: var(--dae-blue-2)
}
.full {
    width: 100%;
    margin-top: 24px;
    display: flex;
    justify-content: space-between
}
.alert {
    background: #fff0f0;
    color: #a5242c;
    padding: 11px 13px;
    border-radius: 9px;
    font-size: 13px
}
.login-card footer {
    text-align: center;
    border-top: 1px solid var(--line);
    margin-top: 30px;
    padding-top: 19px;
    color: var(--muted);
    font-size: 12px
}
.app-shell {
    min-height: 100vh
}
.sidebar {
    width: 252px;
    position: fixed;
    inset: 0 auto 0 0;
    background: #fff;
    border-right: 1px solid var(--line);
    padding: 23px 15px;
    display: flex;
    flex-direction: column;
    z-index: 5
}
.side-brand {
    padding: 0 8px 28px;
    border-bottom: 1px solid var(--line)
}
.side-brand img {
    width: 59px;
    height: 45px
}
.side-brand strong {
    font-size: 20px
}
.side-brand small {
    display: block;
    color: var(--muted);
    font-size: 11px
}
.nav-caption {
    font-size: 10px;
    letter-spacing: 1.4px;
    color: #9aa7b9;
    font-weight: 800;
    padding: 25px 12px 10px
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    color: #64758b;
    font-weight: 600;
    font-size: 13px;
    margin: 2px 0
}
.nav-item>span {
    font-size: 18px;
    width: 21px;
    text-align: center
}
.nav-item.active {
    background: #eaf2ff;
    color: var(--dae-blue)
}
.nav-item.disabled {
    opacity: .52;
    cursor:not-allowed
}
.nav-item small {
    margin-left: auto;
    font-size: 9px;
    background: #f1f3f7;
    padding: 3px 5px;
    border-radius: 5px
}
.sidebar-bottom {
    margin-top: auto;
    border-top: 1px solid var(--line);
    padding: 18px 4px 0;
    display: flex;
    align-items: center;
    gap: 9px
}
.tenant-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--dae-blue);
    color: white;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 11px
}
.tenant-info {
    min-width: 0;
    flex: 1
}
.tenant-info strong, .tenant-info small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}
.tenant-info strong {
    font-size: 12px
}
.tenant-info small {
    color: var(--muted);
    font-size: 11px
}
.logout {
    font-size: 21px;
    color: var(--muted);
    padding: 4px
}
.main {
    margin-left: 252px;
    padding: 0 34px 20px;
    min-width: 0
}
.topbar {
    height: 86px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px
}
.crumb {
    font-size: 11px;
    color: var(--muted)
}
.topbar h1 {
    font-size: 20px;
    margin: 2px 0 0;
    letter-spacing: -.5px
}
.top-user {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 12px;
    color: #62738a
}
.status-dot {
    width: 7px;
    height: 7px;
    background: #29a879;
    border-radius: 50%
}
.avatar {
    width: 34px;
    height: 34px;
    background: #e3edfb;
    color: var(--dae-blue);
    font-weight: 800;
    border-radius: 50%;
    display: grid;
    place-items: center;
    margin-left: 8px
}
.menu-toggle {
    display: none;
    border: 0;
    background: #eaf2ff;
    color: var(--dae-blue);
    border-radius: 8px;
    padding: 8px
}
.welcome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 26px 0 24px;
    padding: 24px 27px;
    background: linear-gradient(112deg, #fff 0%, #edf4ff 100%);
    border: 1px solid #e2ebf8;
    border-radius: var(--radius);
    overflow: hidden
}
.welcome .eyebrow {
    margin: 0 0 8px
}
.welcome h2 {
    font-size: clamp(22px, 3vw, 29px);
    letter-spacing: -1px;
    margin: 0
}
.welcome p:not(.eyebrow) {
    color: var(--muted);
    font-size: 13px;
    margin: 7px 0 0
}
.welcome-mark {
    font-size: 56px;
    font-weight: 900;
    letter-spacing: -5px;
    color: #164e9a12;
    position: relative;
    padding-right: 10px
}
.welcome-mark span {
    font-size: 24px;
    color: var(--dae-yellow);
    vertical-align: top
}
.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px
}
.stat-card, .panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 19px;
    min-width: 0
}
.stat-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: 12px
}
.stat-icon {
    width: 35px;
    height: 35px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 17px
}
.blue {
    background: #e8f1ff;
    color: var(--dae-blue)
}
.violet {
    background: #f0eaff;
    color: #7951bc
}
.amber {
    background: #fff5dc;
    color: #a97900
}
.green {
    background: #e5f7ef;
    color: var(--green)
}
.stat-card>strong {
    display: block;
    font-size: 32px;
    letter-spacing: -1px;
    margin: 12px 0 0
}
.stat-card>small {
    display: block;
    color: #93a0b2;
    font-size: 11px;
    margin-top: 1px
}
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 17px;
    margin-top: 18px
}
.panel {
    padding: 22px
}
.panel-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start
}
.panel-heading h3 {
    font-size: 15px;
    margin: 0
}
.panel-heading p {
    color: var(--muted);
    font-size: 11px;
    margin: 5px 0 0
}
.panel-symbol {
    font-size: 21px;
    color: var(--dae-blue);
    background: #edf4ff;
    border-radius: 9px;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center
}
.empty {
    min-height: 190px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center
}
.empty>span {
    font-size: 28px;
    color: #9bb8e2;
    background: #eff5ff;
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: grid;
    place-items: center
}
.empty strong {
    font-size: 13px;
    margin-top: 12px
}
.empty p {
    color: var(--muted);
    font-size: 11px;
    margin: 4px 0
}
.state-list, .recent-list {
    margin-top: 22px
}
.state-row {
    margin-bottom: 18px
}
.state-row>div:first-child {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
    margin-bottom: 7px
}
.state-row>div:first-child span {
    color: #63738a
}
.progress {
    height: 6px;
    border-radius: 9px;
    background: #edf1f7;
    overflow: hidden
}
.progress span {
    display: block;
    height: 100%;
    border-radius: 9px;
    background: linear-gradient(90deg, var(--dae-blue), #5b9ce8)
}
.recent-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 0;
    border-bottom: 1px solid #f0f2f6
}
.recent-item:last-child {
    border-bottom: 0
}
.device-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: #edf4ff;
    color: var(--dae-blue)
}
.recent-info {
    flex: 1;
    min-width: 0
}
.recent-info strong, .recent-info span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}
.recent-info strong {
    font-size: 12px
}
.recent-info span {
    font-size: 11px;
    color: var(--muted)
}
.pill {
    font-size: 10px;
    background: #edf4ff;
    color: var(--dae-blue);
    border-radius: 20px;
    padding: 5px 8px;
    white-space: nowrap
}
.notice {
    display: flex;
    gap: 13px;
    align-items: flex-start;
    margin-top: 18px;
    padding: 17px 19px;
    border-radius: 13px;
    background: #edf4ff;
    border: 1px solid #dce9fb
}
.notice>span {
    font-size: 20px;
    color: var(--dae-blue)
}
.notice strong {
    font-size: 12px
}
.notice p {
    font-size: 11px;
    color: #64758b;
    margin: 3px 0 0
}
.page-footer {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: #9aa5b5;
    font-size: 10px;
    padding: 22px 2px 0
}
.page-footer span {
    text-align: right
}
@media(max-width: 1150px) {
    .main {
        padding: 0 22px 18px
    }
    .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }
    .content-grid {
        grid-template-columns: 1fr
    }
}
@media(max-width: 760px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .2s ease;
        box-shadow: none
    }
    .menu-open .sidebar {
        transform: translateX(0);
        box-shadow: 15px 0 40px #12274625
    }
    .main {
        margin-left: 0;
        padding: 0 15px 18px
    }
    .topbar {
        height: 72px
    }
    .menu-toggle {
        display: block
    }
    .topbar>div:nth-child(2) {
        margin-right: auto
    }
    .top-user>span:not(.status-dot) {
        display: none
    }
    .welcome {
        padding: 20px;
        margin: 19px 0
    }
    .welcome-mark {
        font-size: 40px
    }
    .stats {
        gap: 10px
    }
    .stat-card {
        padding: 15px
    }
    .stat-card>strong {
        font-size: 27px
    }
    .stat-top {
        font-size: 11px
    }
    .stat-icon {
        width: 30px;
        height: 30px
    }
    .panel {
        padding: 17px
    }
    .page-footer {
        flex-direction: column
    }
    .page-footer span {
        text-align: left
    }
}
@media(max-width: 380px) {
    .stats {
        grid-template-columns: 1fr
    }
    .welcome-mark {
        display: none
    }
    .stat-card {
        padding: 16px
    }
}

/* Login: logo DAE destacado */
.login-card .brand {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    margin-bottom: 22px;
}

.login-card .brand img {
    width: 120px;
    height: 88px;
    object-fit: contain;
}

.login-card .brand strong {
    font-size: 25px;
    letter-spacing: -0.6px;
}

.login-card .brand span {
    font-size: 13px;
}

.login-card .eyebrow {
    margin-top: 20px;
}

@media (max-width: 480px) {
    .login-card .brand img {
        width: 108px;
        height: 80px;
    }
}
