:root {
    --ink: #17233d;
    --muted: #78869e;
    --blue: #2863f6;
    --line: #e4e9f2;
    --bg: #f6f8fc
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: var(--bg);
    font: 14px/1.5 'DM Sans', Inter, system-ui, sans-serif;
    color: var(--ink)
}

a {
    color: inherit;
    text-decoration: none
}

button,
input,
select {
    font: inherit
}

.top {
    height: 64px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px
}

.brand {
    font-size: 19px;
    font-weight: 850;
    letter-spacing: -.6px
}

.brand>span {
    display: inline-grid;
    place-items: center;
    background: var(--blue);
    color: white;
    border-radius: 9px;
    width: 29px;
    height: 29px;
    margin-right: 7px
}

.brand em {
    font-style: normal;
    color: #8591a7;
    font-weight: 500
}

.top-right {
    display: flex;
    gap: 18px;
    align-items: center;
    font-size: 12px;
    color: #65728a
}

.top-right form {
    display: inline
}

.link-btn {
    border: 0;
    background: none;
    color: #3268ee;
    cursor: pointer
}

.layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    min-height: calc(100vh - 64px)
}

.sidebar {
    background: white;
    border-right: 1px solid var(--line);
    padding: 27px 15px;
    display: flex;
    flex-direction: column;
    gap: 8px
}

.sidebar small {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .13em;
    color: #8d99ad;
    padding: 0 11px 8px
}

.sidebar>a {
    padding: 11px;
    border-radius: 8px;
    color: #65738b;
    font-size: 12px;
    font-weight: 650
}

.sidebar>a.selected {
    background: #edf3ff;
    color: #2863f6
}

.sidebar .back {
    margin-bottom: 12px
}

.side-note {
    padding: 13px 11px;
    color: #8490a5;
    font-size: 11px;
    line-height: 1.7
}

.user-card {
    margin-top: auto;
    border-top: 1px solid #edf0f5;
    padding: 20px 4px 0;
    display: flex;
    gap: 10px;
    align-items: center
}

.user-card>span {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    background: #eaf0ff;
    color: #2863f6;
    border-radius: 50%;
    font-weight: 800;
    font-size: 11px
}

.user-card b,
.user-card small {
    display: block;
    padding: 0;
    letter-spacing: 0
}

.user-card b {
    color: #35435c;
    font-size: 11px
}

.user-card small {
    font-size: 10px;
    margin-top: 3px
}

.content {
    min-width: 0;
    max-width: 1500px;
    width: 100%;
    padding: 25px clamp(20px, 3.5vw, 46px) 48px;
    margin: 0 auto
}

.breadcrumbs {
    font-size: 11px;
    color: #8b96aa;
    display: flex;
    gap: 10px;
    margin-bottom: 27px
}

.breadcrumbs a {
    color: #64728a
}

.breadcrumbs span {
    color: #b4bdcc
}

.breadcrumbs b {
    color: #36445d
}

.heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px
}

.heading label {
    font-size: 10px;
    letter-spacing: .14em;
    color: #5278ce;
    font-weight: 800
}

.heading h1 {
    font-size: 31px;
    line-height: 1.2;
    letter-spacing: -1.2px;
    margin: 7px 0;
    color: #16223a
}

.heading p {
    font-size: 12px;
    color: #7a879d;
    margin: 0
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 750;
    cursor: pointer;
    border: 1px solid transparent
}

.btn.primary {
    background: var(--blue);
    color: #fff;
    box-shadow: 0 4px 10px #2863f622
}

.btn.primary:hover {
    background: #174fdf
}

.btn.outline {
    background: white;
    border-color: #dfe5ef;
    color: #52617b
}

.btn.outline:hover {
    border-color: #b8c8e6
}

.banner {
    padding: 13px 16px;
    border-radius: 9px;
    display: flex;
    gap: 8px;
    flex-direction: column;
    margin-bottom: 18px;
    font-size: 12px
}

.banner span {
    font-size: 11px
}

.banner.demo {
    background: #fff8e7;
    border: 1px solid #f1e3b9;
    color: #8d691d
}

.banner.demo span {
    color: #947c49
}

.banner.live {
    background: #ebfaf3;
    border: 1px solid #c8efdc;
    color: #147b51
}

.banner.live span {
    color: #51876e
}

.alert {
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 12px;
    margin: 12px 0
}

.alert.error {
    background: #fff0ef;
    border: 1px solid #f6d0cc;
    color: #a53e38
}

.alert.success {
    background: #eafaf2;
    border: 1px solid #c7efd9;
    color: #16784f
}

.alert a {
    font-weight: 800;
    text-decoration: underline
}

.alert ul {
    margin: 7px 0 0;
    padding-left: 20px
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 21px
}

.stats article {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 17px 19px;
    box-shadow: 0 2px 7px #23375a05
}

.stats small,
.stats span {
    display: block;
    color: #8591a5;
    font-size: 11px
}

.stats strong {
    display: block;
    font-size: 27px;
    letter-spacing: -.8px;
    margin: 10px 0 4px
}

.stats strong.small-strong {
    font-size: 20px
}

.panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 11px;
    overflow: visible;
    margin-bottom: 20px;
    box-shadow: 0 3px 10px #1d315008
}

.panel-heading {
    padding: 21px 21px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px
}

.panel-heading h2 {
    font-size: 15px;
    margin: 0
}

.panel-heading p {
    font-size: 11px;
    color: #8591a5;
    margin: 5px 0 0
}

.pill {
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 5px 10px;
    color: #718099;
    font-size: 10px;
    white-space: nowrap
}

.filters {
    display: flex;
    gap: 9px;
    padding: 0 21px 16px;
    align-items: center
}

.search {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #dfe5ef;
    border-radius: 8px;
    height: 38px;
    padding: 0 11px;
    flex: 1;
    max-width: 460px;
    color: #8492a8;
    font-size: 20px
}

.search input {
    border: 0;
    outline: 0;
    min-width: 0;
    width: 100%;
    font-size: 12px;
    color: #273650
}

.search input:focus-visible {
    outline: 2px solid #9bb9ff
}

.filters select {
    height: 38px;
    border: 1px solid #dfe5ef;
    border-radius: 8px;
    padding: 0 28px 0 10px;
    background: white;
    color: #52617b;
    font-size: 11px
}

.table-scroll {
    width: 100%;
    overflow-x: auto
}

table {
    border-collapse: collapse;
    width: 100%;
    text-align: left;
    font-size: 12px
}

thead {
    background: #f8faff
}

th {
    font-size: 9px;
    letter-spacing: .08em;
    color: #919db0;
    font-weight: 800;
    padding: 13px 16px;
    border-block: 1px solid #edf0f6;
    white-space: nowrap
}

td {
    padding: 14px 16px;
    border-bottom: 1px solid #f0f2f7;
    color: #607089;
    white-space: nowrap
}

tbody tr:last-child td {
    border-bottom: 0
}

tbody tr:hover {
    background: #fbfcff
}

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

.zone-icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    background: #edf3ff;
    border-radius: 8px;
    color: #3971f4;
    font-size: 16px
}

.zone-link b,
.zone-link small {
    display: block
}

.zone-link b {
    color: #2c3a53;
    font-size: 12px
}

.zone-link small {
    font-size: 10px;
    color: #9aa4b5;
    margin-top: 3px
}

.kind {
    background: #f2f5fa;
    border-radius: 5px;
    padding: 5px 8px;
    font-size: 10px
}

.status {
    font-size: 10px;
    padding: 5px 8px;
    border-radius: 15px
}

.status.on {
    background: #eafaf2;
    color: #16865a
}

.status.off {
    background: #f3f5f9;
    color: #718099
}

.arrow {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--line);
    border-radius: 7px;
    color: #6f7d95
}

.empty {
    text-align: center;
    padding: 27px !important;
    color: #8995a8 !important
}

.table-foot {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 13px 20px;
    border-top: 1px solid #edf0f6;
    font-size: 10px;
    color: #8b96a9
}

.tip,
.setup {
    background: white;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 17px 19px;
    margin-top: 16px
}

.tip b,
.setup b {
    font-size: 12px
}

.tip p,
.setup p {
    font-size: 11px;
    color: #78869d;
    line-height: 1.7;
    margin: 6px 0 0
}

.setup {
    background: #f0f4fb
}

.setup code {
    background: #e1e9f6;
    padding: 2px 4px;
    border-radius: 4px
}

.zone-meta {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    margin-bottom: 20px
}

.zone-meta>div {
    padding: 15px 17px;
    border-right: 1px solid #edf0f6;
    min-width: 0
}

.zone-meta>div:last-child {
    border: 0
}

.zone-meta small,
.zone-meta b {
    display: block
}

.zone-meta small {
    font-size: 10px;
    color: #8591a5;
    margin-bottom: 7px
}

.zone-meta b {
    font-size: 12px;
    overflow-wrap: anywhere
}

.record-type {
    background: #edf3ff;
    color: #3869df;
    padding: 5px 7px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 800
}

.record-name {
    color: #2c3a53
}

.record-content {
    display: block;
    max-width: 430px;
    overflow: hidden;
    text-overflow: ellipsis;
    font: 11px ui-monospace, monospace;
    color: #586780
}

.actions {
    position: relative
}

.actions summary {
    cursor: pointer;
    list-style: none;
    letter-spacing: 1px;
    color: #718099;
    padding: 5px
}

.actions summary::-webkit-details-marker {
    display: none
}

.action-menu {
    position: absolute;
    right: 0;
    top: 28px;
    z-index: 5;
    min-width: 160px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 5px;
    box-shadow: 0 10px 25px #1e2f501c
}

.action-menu button {
    display: block;
    width: 100%;
    border: 0;
    background: white;
    text-align: left;
    padding: 9px;
    border-radius: 5px;
    font-size: 11px;
    color: #52617b;
    cursor: pointer
}

.action-menu button:hover {
    background: #f4f7fc
}

.action-menu .danger {
    color: #bf4444
}

.action-menu form {
    margin: 0
}

.editor {
    padding-bottom: 20px
}

.close {
    border: 0;
    border-radius: 6px;
    background: #f1f4f9;
    color: #6d7a91;
    font-size: 20px;
    width: 30px;
    height: 30px;
    cursor: pointer
}

.record-form {
    padding: 0 21px
}

.form-grid {
    display: grid;
    grid-template-columns: 1.2fr .6fr 1.8fr .7fr;
    gap: 12px
}

.form-grid label,
.login-card label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 11px;
    font-weight: 750;
    color: #52617b
}

.form-grid label small {
    font-weight: 400;
    color: #8b97aa
}

.form-grid input,
.form-grid select,
.login-card input {
    width: 100%;
    min-width: 0;
    border: 1px solid #dfe5ef;
    border-radius: 7px;
    padding: 10px;
    background: #fff;
    color: #263650;
    font-size: 12px
}

.form-grid input:focus,
.form-grid select:focus,
.login-card input:focus {
    outline: 3px solid #c5d5ff;
    border-color: #7da0ff
}

.value-field {
    grid-column: auto
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 18px
}

.empty-panel {
    padding: 25px
}

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px
}

.login-card {
    background: white;
    border: 1px solid var(--line);
    border-radius: 15px;
    padding: 30px;
    width: min(430px, 100%);
    box-shadow: 0 18px 55px #23375a0d
}

.login-card h1 {
    font-size: 24px;
    margin: 25px 0 7px
}

.login-card p {
    font-size: 12px;
    color: #7c899e;
    line-height: 1.7;
    margin-bottom: 23px
}

.login-card label {
    margin: 14px 0
}

.login-card .btn {
    width: 100%;
    margin-top: 8px
}

.login-card .alert {
    margin: 12px 0
}

@media(max-width:900px) {
    .layout {
        grid-template-columns: 180px minmax(0, 1fr)
    }

    .content {
        padding: 22px 18px
    }

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

    .form-grid {
        grid-template-columns: 1fr 1fr
    }

    .value-field {
        grid-column: span 2
    }

    .zone-meta {
        grid-template-columns: 1fr 1fr
    }

    .zone-meta>div:nth-child(2) {
        border-right: 0
    }

    .zone-meta>div:nth-child(-n+2) {
        border-bottom: 1px solid #edf0f6
    }
}

@media(max-width:650px) {
    .top {
        padding: 0 15px
    }

    .layout {
        grid-template-columns: 1fr
    }

    .sidebar {
        padding: 12px 15px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
        display: block
    }

    .sidebar>small,
    .side-note,
    .user-card {
        display: none
    }

    .sidebar>a {
        display: inline-block;
        padding: 8px 10px
    }

    .content {
        padding: 19px 12px 35px
    }

    .heading h1 {
        font-size: 26px
    }

    .heading {
        align-items: flex-start
    }

    .heading .btn {
        padding: 9px;
        font-size: 11px
    }

    .stats {
        gap: 8px
    }

    .stats article {
        padding: 13px
    }

    .stats strong {
        font-size: 23px
    }

    .stats article:last-child {
        grid-column: 1/-1
    }

    .panel-heading {
        padding: 16px 14px
    }

    .filters {
        padding: 0 14px 14px;
        flex-wrap: wrap
    }

    .search {
        flex-basis: 100%;
        max-width: none
    }

    .filters select {
        flex: 1
    }

    .table-scroll table {
        min-width: 650px
    }

    .zone-meta>div {
        padding: 12px
    }

    .table-foot {
        padding: 12px 14px
    }

    .form-grid {
        grid-template-columns: 1fr
    }

    .value-field {
        grid-column: auto
    }

    .record-form {
        padding: 0 14px
    }

    .panel-heading p {
        line-height: 1.5
    }

    .breadcrumbs {
        margin-bottom: 19px
    }
}

@media(prefers-reduced-motion:reduce) {
    * {
        scroll-behavior: auto !important;
        transition: none !important
    }
}