﻿/* =========================================================
   MOB365 CONTROL CENTER — DEVICES
   ========================================================= */

.devices-page {
    width: 100%;
    max-width: 1700px;
    margin: 0 auto;
    padding-bottom: 48px;
    color: #0f172a;
}

/* HEADER */

.devices-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.devices-eyebrow,
.devices-panel-kicker {
    display: block;
    color: #2563eb;
    font-size: 10px;
    font-weight: 950;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.devices-header h1 {
    margin: 8px 0 0;
    color: #0f172a;
    font-size: clamp(30px, 3vw, 43px);
    line-height: 1.1;
    font-weight: 950;
    letter-spacing: -.045em;
}

.devices-header p {
    max-width: 720px;
    margin: 10px 0 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.7;
}

.devices-refresh-button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    border: 1px solid #dbe4ef;
    border-radius: 12px;
    color: #334155;
    background: #fff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .055);
    cursor: pointer;
    font-family: inherit;
    font-size: 11px;
    font-weight: 850;
    white-space: nowrap;
}

    .devices-refresh-button:hover:not(:disabled) {
        color: #1d4ed8;
        border-color: #bfdbfe;
        background: #eff6ff;
    }

    .devices-refresh-button:disabled {
        opacity: .65;
        cursor: not-allowed;
    }

/* ALERTS */

.devices-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
    padding: 15px 17px;
    border: 1px solid;
    border-radius: 15px;
}

.devices-alert-icon {
    display: grid;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    place-items: center;
    border-radius: 9px;
    color: #fff;
    font-weight: 950;
}

.devices-alert strong {
    display: block;
    font-size: 13px;
}

.devices-alert p {
    margin: 4px 0 0;
    font-size: 12px;
}

.devices-alert.success {
    color: #166534;
    border-color: #bbf7d0;
    background: #f0fdf4;
}

    .devices-alert.success .devices-alert-icon {
        background: #16a34a;
    }

.devices-alert.danger {
    color: #991b1b;
    border-color: #fecaca;
    background: #fff1f2;
}

    .devices-alert.danger .devices-alert-icon {
        background: #dc2626;
    }

/* STATISTICS */

.devices-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.devices-stat-card {
    display: flex;
    min-height: 110px;
    align-items: center;
    gap: 15px;
    padding: 19px;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .055);
}

.devices-stat-icon {
    display: grid;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    place-items: center;
    border-radius: 14px;
    font-size: 20px;
}

.devices-stat-card.total .devices-stat-icon {
    color: #1d4ed8;
    background: #dbeafe;
}

.devices-stat-card.pending .devices-stat-icon {
    color: #92400e;
    background: #fef3c7;
}

.devices-stat-card.approved .devices-stat-icon {
    color: #047857;
    background: #d1fae5;
}

.devices-stat-card.blocked .devices-stat-icon {
    color: #b91c1c;
    background: #fee2e2;
}

.devices-stat-card strong,
.devices-stat-card span {
    display: block;
}

.devices-stat-card strong {
    color: #0f172a;
    font-size: 28px;
    line-height: 1;
    font-weight: 950;
}

.devices-stat-card span {
    margin-top: 7px;
    color: #64748b;
    font-size: 11px;
    font-weight: 750;
}

/* PANEL */

.devices-panel {
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 21px;
    background: #fff;
    box-shadow: 0 14px 38px rgba(15, 23, 42, .065);
}

.devices-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 24px;
    border-bottom: 1px solid #edf2f7;
}

    .devices-panel-header h2 {
        margin: 6px 0 0;
        color: #0f172a;
        font-size: 20px;
        font-weight: 900;
    }

    .devices-panel-header p {
        margin: 7px 0 0;
        color: #64748b;
        font-size: 11px;
    }

.devices-filters {
    display: flex;
    align-items: center;
    gap: 10px;
}

.devices-search {
    display: flex;
    width: min(420px, 100%);
    min-height: 43px;
    align-items: center;
    gap: 9px;
    padding: 0 13px;
    border: 1px solid #dbe4ef;
    border-radius: 12px;
    background: #f8fafc;
}

    .devices-search span {
        color: #64748b;
        font-size: 18px;
    }

    .devices-search input {
        width: 100%;
        border: 0;
        color: #0f172a;
        background: transparent;
        outline: none;
        font-family: inherit;
        font-size: 12px;
    }

.devices-status-filter {
    min-height: 43px;
    padding: 0 12px;
    border: 1px solid #dbe4ef;
    border-radius: 12px;
    color: #334155;
    background: #fff;
    outline: none;
    font-family: inherit;
    font-size: 11px;
    font-weight: 750;
}

/* LOADING */

.devices-loading,
.devices-empty {
    display: flex;
    min-height: 260px;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 32px;
    text-align: center;
}

.devices-loader {
    width: 36px;
    height: 36px;
    border: 4px solid #dbeafe;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: devices-spin .8s linear infinite;
}

.devices-button-spinner,
.devices-small-spinner {
    width: 15px;
    height: 15px;
    border: 2px solid rgba(37, 99, 235, .25);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: devices-spin .8s linear infinite;
}

@keyframes devices-spin {
    to {
        transform: rotate(360deg);
    }
}

.devices-loading strong,
.devices-empty strong {
    display: block;
    color: #0f172a;
    font-size: 14px;
}

.devices-loading p,
.devices-empty p {
    margin: 5px 0 0;
    color: #94a3b8;
    font-size: 11px;
}

.devices-empty {
    flex-direction: column;
}

.devices-empty-icon {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border-radius: 16px;
    background: #eef2ff;
    font-size: 22px;
}

/* TABLE */

.devices-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.devices-table {
    width: 100%;
    border-collapse: collapse;
}

    .devices-table th {
        padding: 13px 16px;
        color: #64748b;
        background: #f8fafc;
        text-align: left;
        font-size: 10px;
        font-weight: 900;
        letter-spacing: .06em;
        text-transform: uppercase;
        white-space: nowrap;
    }

    .devices-table td {
        padding: 15px 16px;
        border-top: 1px solid #f1f5f9;
        color: #334155;
        font-size: 12px;
        vertical-align: middle;
    }

    .devices-table tbody tr {
        transition: opacity .15s ease, background .15s ease;
    }

        .devices-table tbody tr:hover {
            background: #fafcff;
        }

.device-row-updating {
    opacity: .65;
    pointer-events: none;
}

.devices-company-cell,
.devices-name-cell,
.devices-app-cell,
.devices-last-seen {
    min-width: 0;
}

.devices-company-cell {
    display: flex;
    min-width: 180px;
    align-items: center;
    gap: 10px;
}

.devices-company-avatar {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border-radius: 12px;
    color: #1d4ed8;
    background: #dbeafe;
    font-size: 10px;
    font-weight: 950;
}

.devices-company-cell strong,
.devices-name-cell strong,
.devices-app-cell strong,
.devices-last-seen strong {
    display: block;
    color: #0f172a;
    font-size: 11px;
}

.devices-name-cell {
    min-width: 210px;
}

    .devices-name-cell span,
    .devices-app-cell span,
    .devices-last-seen span {
        display: block;
        margin-top: 4px;
        color: #94a3b8;
        font-size: 9px;
    }

    .devices-name-cell span {
        max-width: 260px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.devices-agent-code {
    display: inline-flex;
    padding: 5px 8px;
    border-radius: 8px;
    color: #4338ca;
    background: #eef2ff;
    font-size: 10px;
    font-weight: 900;
}

.devices-empty-value {
    color: #94a3b8;
    font-size: 10px;
}

/* STATUS */

.devices-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
    white-space: nowrap;
}

    .devices-status > span {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: currentColor;
    }

    .devices-status.approved {
        color: #047857;
        background: #d1fae5;
    }

    .devices-status.pending {
        color: #92400e;
        background: #fef3c7;
    }

    .devices-status.blocked {
        color: #b91c1c;
        background: #fee2e2;
    }

/* ACTIONS */

.devices-actions {
    display: flex;
    min-width: 190px;
    align-items: center;
    gap: 7px;
}

.devices-action-button {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 10px;
    border: 1px solid;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 9px;
    font-weight: 900;
    white-space: nowrap;
}

    .devices-action-button.approve {
        color: #047857;
        border-color: #a7f3d0;
        background: #ecfdf5;
    }

        .devices-action-button.approve:hover:not(:disabled) {
            border-color: #6ee7b7;
            background: #d1fae5;
        }

    .devices-action-button.block {
        color: #b91c1c;
        border-color: #fecaca;
        background: #fff1f2;
    }

        .devices-action-button.block:hover:not(:disabled) {
            border-color: #fca5a5;
            background: #fee2e2;
        }

    .devices-action-button:disabled {
        opacity: .6;
        cursor: not-allowed;
    }

/* RESPONSIVE */

@media (max-width: 1200px) {
    .devices-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .devices-panel-header {
        flex-direction: column;
    }

    .devices-filters {
        width: 100%;
    }

    .devices-search {
        flex: 1;
    }
}

@media (max-width: 760px) {
    .devices-header {
        flex-direction: column;
    }

    .devices-refresh-button {
        width: 100%;
    }

    .devices-stats-grid {
        grid-template-columns: 1fr;
    }

    .devices-filters {
        align-items: stretch;
        flex-direction: column;
    }

    .devices-search,
    .devices-status-filter {
        width: 100%;
    }
}
