* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
}

body {
    background: #0a0c0f;
    color: #eef2f6;
    height: 100vh;
    overflow: hidden;
    font-size: 12px;
}

.container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 8px;
    gap: 8px;
}

/* Хедер */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: linear-gradient(145deg, #14181c, #0e1217);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    min-height: 44px;
    height: 44px;
    border: 1px solid rgba(66, 153, 225, 0.15);
}

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

h1 {
    font-size: 15px;
    background: linear-gradient(145deg, #60a5fa, #38bdf8);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    margin: 0;
    line-height: 1;
    letter-spacing: -0.3px;
}

.user-role {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-role.user {
    background: linear-gradient(145deg, #0f2a33, #0b2027);
    color: #7dd3fc;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.user-role.admin {
    background: linear-gradient(145deg, #1e1a3a, #16112b);
    color: #c4b5fd;
    border: 1px solid rgba(139, 92, 246, 0.4);
}

.logout-btn {
    background: linear-gradient(145deg, #3b3f4a, #2a2e38);
    color: #f1f5f9;
    border: none;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 11px;
    transition: all 0.2s ease;
    line-height: 1;
    height: 30px;
    min-width: 75px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.logout-btn:hover {
    background: linear-gradient(145deg, #dc2626, #b91c1c);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(220, 38, 38, 0.25);
    border-color: transparent;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    background: linear-gradient(145deg, #14181c, #0e1217);
    border-radius: 10px;
    height: 44px;
    border: 1px solid rgba(66, 153, 225, 0.1);
}

.devices-count {
    font-size: 12px;
    font-weight: 600;
    background: linear-gradient(145deg, #1e293b, #0f172a);
    padding: 6px 14px;
    border-radius: 20px;
    line-height: 1;
    color: #bae6fd;
    border: 1px solid rgba(56, 189, 248, 0.2);
}

.add-device-btn {
    background: linear-gradient(145deg, #0f766e, #0b5e57);
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 11px;
    transition: all 0.2s ease;
    line-height: 1;
    height: 32px;
    min-width: 140px;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.add-device-btn:hover {
    background: linear-gradient(145deg, #0b5e57, #084c46);
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(16, 185, 129, 0.3);
}

.panels-container {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: linear-gradient(145deg, #14181c, #0e1217);
    border-radius: 20px;
    margin-top: 6px;
    height: 30px;
    border: 1px solid rgba(56, 189, 248, 0.2);
}

.live-dot {
    width: 8px;
    height: 8px;
    background: linear-gradient(145deg, #10b981, #059669);
    border-radius: 50%;
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: linear-gradient(145deg, #1a1f24, #12171b);
    padding: 22px;
    border-radius: 16px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(66, 153, 225, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
    background: linear-gradient(145deg, #60a5fa, #38bdf8);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    letter-spacing: -0.3px;
}

.close-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.close-btn:hover {
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.05);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 8px 12px;
    background: #0a0c0f;
    border: 1px solid #2a3a4a;
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 13px;
    height: 38px;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
}

.cancel-btn {
    background: linear-gradient(145deg, #334155, #1e293b);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 11px;
    transition: all 0.2s;
    height: 36px;
    min-width: 80px;
}

.save-btn {
    background: linear-gradient(145deg, #0f766e, #0b5e57);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 11px;
    transition: all 0.2s;
    height: 36px;
    min-width: 80px;
}

.cancel-btn:hover,
.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
}

.save-btn:hover {
    background: linear-gradient(145deg, #0b5e57, #084c46);
}

.cancel-btn:hover {
    background: linear-gradient(145deg, #475569, #334155);
}

/* Скроллбар */
.panels-container::-webkit-scrollbar,
.logs-table-container::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.panels-container::-webkit-scrollbar-track,
.logs-table-container::-webkit-scrollbar-track {
    background: #0e1217;
    border-radius: 3px;
}

.panels-container::-webkit-scrollbar-thumb,
.logs-table-container::-webkit-scrollbar-thumb {
    background: linear-gradient(145deg, #475569, #334155);
    border-radius: 3px;
}

.panels-container::-webkit-scrollbar-thumb:hover,
.logs-table-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(145deg, #5b6b7e, #4a5a6c);
}

/* Telegram ссылки */
.telegram-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.telegram-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: linear-gradient(135deg, #1e3a5f, #0f2b4a);
    border-radius: 16px;
    color: #90d4ff;
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid rgba(56, 189, 248, 0.3);
    letter-spacing: 0.3px;
}

.telegram-link:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
    border-color: rgba(56, 189, 248, 0.8);
}

.telegram-icon {
    width: 12px;
    height: 12px;
    fill: currentColor;
    transition: transform 0.3s ease;
}

.telegram-link:hover .telegram-icon {
    transform: rotate(5deg) scale(1.1);
}

@media (max-width: 768px) {
    .telegram-links {
        gap: 4px;
    }
    
    .telegram-link {
        padding: 2px 8px;
        font-size: 9px;
    }
    
    .telegram-icon {
        width: 10px;
        height: 10px;
    }
}   