/* Variáveis CSS para cores e temas */
:root {
    --primary: #1a365d;
    --primary-dark: #153060;
    --secondary: #2d3748;
    --accent: #4299e1;
    --success: #48bb78;
    --danger: #f56565;
    --warning: #ecc94b;
    --info: #4299e1;
    --light: #f7fafc;
    --dark: #2d3748;
    --gray: #a0aec0;
    --gray-light: #e2e8f0;
    --text: #2d3748;
    --text-light: #718096;
    --border: #e2e8f0;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 8px;
    --transition: all 0.3s ease;
}

/* Reset e estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: var(--text);
    line-height: 1.6;
}

/* Layout de login */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 30px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: var(--primary);
    margin-bottom: 10px;
}

.login-header p {
    color: var(--text-light);
}

.login-form {
    margin-top: 20px;
}

/* Dashboard Layout */
.dashboard {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: var(--primary);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.logo {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.menu {
    padding: 20px 0;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
}

.menu-item:hover, .menu-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.menu-item span {
    margin-right: 10px;
    font-size: 18px;
}

.main-content {
    flex: 1;
    margin-left: 250px;
}

.header {
    background: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    font-weight: 500;
}

.user-badge {
    background: var(--accent);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    text-transform: capitalize;
}

.content {
    padding: 30px;
}

/* Cards e Grids */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
}

.stat-icon {
    font-size: 40px;
    margin-right: 15px;
    opacity: 0.8;
}

.stat-info h3 {
    font-size: 24px;
    margin-bottom: 5px;
}

.stat-info p {
    color: var(--text-light);
    font-size: 14px;
}

.section {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    overflow: hidden;
}

.section-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-header h2 {
    font-size: 18px;
}

.last-update {
    font-size: 12px;
    color: var(--text-light);
}

.equipamentos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
}

.equipamento-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: var(--transition);
    position: relative;
}

.equipamento-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.equipamento-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.equipamento-icon {
    font-size: 32px;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.status-indicator.online {
    background: var(--success);
}

.status-indicator.offline {
    background: var(--danger);
}

.equipamento-info h3 {
    margin-bottom: 10px;
    font-size: 18px;
}

.equipamento-info p {
    margin-bottom: 5px;
    font-size: 14px;
    color: var(--text-light);
}

.equipamento-status {
    margin-top: 15px;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.online {
    background: rgba(72, 187, 120, 0.1);
    color: var(--success);
}

.status-badge.offline {
    background: rgba(245, 101, 101, 0.1);
    color: var(--danger);
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

/* Tabelas */
.usuarios-table {
    padding: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th, table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

table th {
    background: #f8f9fa;
    font-weight: 600;
}

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    text-transform: capitalize;
}

.badge.cliente {
    background: rgba(66, 153, 225, 0.1);
    color: var(--info);
}

.badge.superadmin {
    background: rgba(245, 158, 11, 0.1);
    color: #ed8936;
}

/* Formulários */
.form-container {
    max-width: 600px;
    margin: 0 auto;
}

.form-cadastro {
    background: white;
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.input-group input, .input-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 16px;
    transition: var(--transition);
}

.input-group input:focus, .input-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

/* Alertas */
.alert {
    padding: 12px 15px;
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.alert.sucesso {
    background: rgba(72, 187, 120, 0.1);
    color: var(--success);
    border: 1px solid rgba(72, 187, 120, 0.2);
}

.alert.erro {
    background: rgba(245, 101, 101, 0.1);
    color: var(--danger);
    border: 1px solid rgba(245, 101, 101, 0.2);
}

/* Responsividade */
@media (max-width: 992px) {
    .sidebar {
        width: 70px;
    }
    
    .sidebar .logo h2, .sidebar .menu-item span:last-child {
        display: none;
    }
    
    .main-content {
        margin-left: 70px;
    }
    
    .equipamentos-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .equipamentos-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .content {
        padding: 15px;
    }
}