/* =========================================================
   RESET
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    padding: 0;

    min-width: 320px;

    font-family:
        Inter,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;

    background:
        linear-gradient(
            135deg,
            #f4f7fb 0%,
            #eef2f7 100%
        );

    color: #172033;
}


/* =========================================================
   TOPBAR
   ========================================================= */

.topbar {
    width: 100%;

    background:
        linear-gradient(
            135deg,
            #111827,
            #1e293b
        );

    color: #ffffff;

    box-shadow:
        0 4px 18px
        rgba(15, 23, 42, 0.18);
}

.topbar-inner {
    width: 100%;
    max-width: 1450px;

    margin: 0 auto;

    padding: 18px 26px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;
}

.brand {
    display: inline-flex;

    align-items: center;

    gap: 10px;

    color: #ffffff;

    text-decoration: none;

    font-size: 21px;

    font-weight: 800;

    letter-spacing: -0.3px;
}

.brand::before {
    content: "DS";

    display: inline-flex;

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

    width: 34px;
    height: 34px;

    border-radius: 9px;

    background:
        linear-gradient(
            135deg,
            #3b82f6,
            #6366f1
        );

    font-size: 11px;

    font-weight: 900;

    box-shadow:
        0 4px 10px
        rgba(59, 130, 246, 0.35);
}

.topbar-subtitle {
    color: #94a3b8;

    font-size: 13px;

    font-weight: 500;
}


/* =========================================================
   PAGE
   ========================================================= */

.page-container {
    width: 100%;

    max-width: 1450px;

    margin: 0 auto;

    padding: 30px 26px 40px;
}


/* =========================================================
   PAGE HEADER
   ========================================================= */

.page-header {
    margin-bottom: 24px;
}

.page-header-row {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 18px;

    flex-wrap: wrap;
}

.page-title {
    margin: 0;

    font-size: 30px;

    line-height: 1.2;

    font-weight: 800;

    letter-spacing: -0.7px;

    color: #111827;
}

.page-description {
    margin: 7px 0 0;

    color: #64748b;

    font-size: 14px;
}


/* =========================================================
   GRID
   ========================================================= */

.grid {
    display: grid;

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

    gap: 18px;
}

.device-grid {
    display: grid;

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

    gap: 18px;
}


/* =========================================================
   CARD
   ========================================================= */

.card {
    position: relative;

    background: rgba(255, 255, 255, 0.96);

    border: 1px solid #e2e8f0;

    border-radius: 15px;

    padding: 21px;

    min-width: 0;

    box-shadow:
        0 5px 20px
        rgba(15, 23, 42, 0.06);

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        border-color 0.15s ease;
}

.card:hover {
    transform: translateY(-2px);

    border-color: #cbd5e1;

    box-shadow:
        0 10px 28px
        rgba(15, 23, 42, 0.10);
}

.card-title {
    margin: 0 0 16px;

    font-size: 16px;

    font-weight: 750;

    color: #1e293b;
}

.card-label {
    color: #94a3b8;

    font-size: 11px;

    font-weight: 700;

    text-transform: uppercase;

    letter-spacing: 0.06em;

    margin-bottom: 5px;
}

.card-value {
    color: #1e293b;

    font-size: 15px;

    font-weight: 600;

    word-break: break-word;
}


/* =========================================================
   DEVICE CARD
   ========================================================= */

.device-card {
    display: flex;

    flex-direction: column;

    gap: 15px;
}

.device-name {
    color: #111827;

    font-size: 18px;

    font-weight: 800;

    letter-spacing: -0.2px;

    word-break: break-word;
}

.device-model {
    margin-top: 5px;

    color: #64748b;

    font-size: 13px;

    word-break: break-word;
}

.device-uuid {
    color: #64748b;

    font-family:
        Consolas,
        "Courier New",
        monospace;

    font-size: 12px;

    line-height: 1.5;

    word-break: break-all;
}


/* =========================================================
   DEVICE STATUS
   ========================================================= */

.status {
    display: inline-flex;

    align-items: center;

    gap: 7px;

    width: fit-content;

    padding: 6px 10px;

    border-radius: 999px;

    font-size: 11px;

    font-weight: 800;

    letter-spacing: 0.04em;
}

.status::before {
    content: "";

    width: 7px;
    height: 7px;

    border-radius: 50%;
}

.status-online {
    color: #15803d;

    background: #dcfce7;
}

.status-online::before {
    background: #22c55e;

    box-shadow:
        0 0 0 3px
        rgba(34, 197, 94, 0.15);
}

.status-offline {
    color: #64748b;

    background: #f1f5f9;
}

.status-offline::before {
    background: #94a3b8;
}


/* =========================================================
   COMMAND BADGES
   ========================================================= */

.status-badge {
    display: inline-flex;

    align-items: center;

    justify-content: center;

    min-width: 88px;

    padding: 6px 10px;

    border-radius: 999px;

    font-size: 10px;

    font-weight: 800;

    letter-spacing: 0.04em;
}

.badge-pending {
    color: #92400e;

    background: #fef3c7;
}

.badge-processing {
    color: #1d4ed8;

    background: #dbeafe;
}

.badge-completed {
    color: #15803d;

    background: #dcfce7;
}

.badge-failed {
    color: #b91c1c;

    background: #fee2e2;
}

.badge-default {
    color: #475569;

    background: #f1f5f9;
}


/* =========================================================
   BUTTONS
   ========================================================= */

.button-row {
    display: flex;

    flex-wrap: wrap;

    gap: 9px;
}

.button {
    display: inline-flex;

    align-items: center;

    justify-content: center;

    min-height: 42px;

    padding: 9px 16px;

    border-radius: 9px;

    border: 1px solid transparent;

    text-decoration: none;

    font-size: 13px;

    font-weight: 700;

    cursor: pointer;

    transition:
        transform 0.1s ease,
        box-shadow 0.15s ease,
        opacity 0.15s ease;
}

.button:hover {
    opacity: 0.93;

    transform: translateY(-1px);
}

.button:active {
    transform: translateY(0);
}

.button-primary {
    color: #ffffff;

    background:
        linear-gradient(
            135deg,
            #2563eb,
            #4f46e5
        );

    box-shadow:
        0 5px 12px
        rgba(37, 99, 235, 0.20);
}

.button-secondary {
    color: #334155;

    background: #ffffff;

    border-color: #dbe2ea;
}


/* =========================================================
   INFO LIST
   ========================================================= */

.info-list {
    display: grid;

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

    gap: 17px 25px;
}

.info-item {
    min-width: 0;
}

.info-label {
    margin-bottom: 5px;

    color: #94a3b8;

    font-size: 11px;

    font-weight: 700;

    text-transform: uppercase;

    letter-spacing: 0.05em;
}

.info-value {
    color: #334155;

    font-size: 14px;

    font-weight: 600;

    word-break: break-word;
}


/* =========================================================
   TABLE
   ========================================================= */

.table-wrap {
    width: 100%;

    overflow-x: auto;

    border-radius: 10px;

    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;

    min-width: 720px;

    border-collapse: separate;

    border-spacing: 0;

    overflow: hidden;
}

.table th {
    padding: 13px 12px;

    background: #f8fafc;

    color: #64748b;

    border-bottom: 1px solid #e2e8f0;

    font-size: 10px;

    font-weight: 800;

    text-transform: uppercase;

    letter-spacing: 0.06em;

    text-align: left;
}

.table td {
    padding: 14px 12px;

    border-bottom: 1px solid #eef2f7;

    color: #334155;

    font-size: 13px;

    vertical-align: middle;
}

.table tbody tr {
    transition:
        background 0.12s ease;
}

.table tbody tr:hover {
    background: #f8fafc;
}

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


/* =========================================================
   EMPTY
   ========================================================= */

.empty {
    padding: 50px 20px;

    text-align: center;

    color: #94a3b8;

    font-size: 14px;
}


/* =========================================================
   FOOTER
   ========================================================= */

.footer {
    width: 100%;

    padding: 26px 20px;

    text-align: center;

    color: #94a3b8;

    font-size: 11px;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1150px) {

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

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


@media (max-width: 720px) {

    .topbar-inner {
        padding: 15px 17px;

        align-items: flex-start;

        flex-direction: column;

        gap: 6px;
    }

    .topbar-subtitle {
        padding-left: 44px;

        font-size: 12px;
    }

    .page-container {
        padding: 21px 15px 30px;
    }

    .page-title {
        font-size: 25px;
    }

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

    .info-list {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 17px;

        border-radius: 13px;
    }

    .button-row {
        width: 100%;
    }

    .button {
        min-height: 44px;
    }
}


@media (max-width: 430px) {

    .brand {
        font-size: 19px;
    }

    .brand::before {
        width: 31px;
        height: 31px;
    }

    .page-container {
        padding-left: 12px;
        padding-right: 12px;
    }

    .page-title {
        font-size: 23px;
    }

    .card {
        padding: 15px;
    }

    .device-name {
        font-size: 17px;
    }
}