:root {
    --primary: #25D366;
    --primary-dark: #128C7E;
    --bg: #f0f2f5;
    --surface: #ffffff;
    --sidebar: #111b21;
    --sidebar-hover: #2a3942;
    --text: #333;
    --text-muted: #666;
}

* {
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, sans-serif;
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    display: flex;
    height: 100vh;
    overflow: hidden;
    color: var(--text);
}

/* Utils */
.btn {
    padding: 12px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(37, 211, 102, 0.3);
}

.btn-danger {
    background: #dc3545;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #5a6268;
}

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

/* Login */
.login-container {
    margin: auto;
    padding: 40px;
    background: var(--surface);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    width: 380px;
    text-align: center;
    animation: fadeIn 0.5s ease;
}

.login-container h2 {
    margin-bottom: 25px;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 28px;
}

.login-container input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fafafa;
    transition: border 0.3s;
}

.login-container input:focus {
    border-color: var(--primary);
    outline: none;
}

/* Layout & Menu */
.sidebar {
    width: 260px;
    background: var(--sidebar);
    color: white;
    display: flex;
    flex-direction: column;
    padding: 25px 0;
    z-index: 10;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar-brand {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    color: var(--primary);
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.sidebar a {
    color: #d1d7db;
    text-decoration: none;
    padding: 15px 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 16px;
    transition: all 0.3s ease;
    cursor: pointer;
    border-left: 4px solid transparent;
}

.sidebar a:hover,
.sidebar a.active {
    background: var(--sidebar-hover);
    color: white;
    border-left-color: var(--primary);
}

.main-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    scroll-behavior: smooth;
}

/* SPA Views */
.view {
    display: none;
    animation: slideUp 0.4s ease forwards;
}

.view.active {
    display: block;
}

/* Cards & Grids */
.card {
    background: var(--surface);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    margin-bottom: 25px;
}

.card h2 {
    margin-bottom: 20px;
    font-size: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* Multi-Device Status */
.device-card {
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    background: #fafafa;
    transition: transform 0.3s;
}

.device-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.device-icon {
    font-size: 40px;
    margin-bottom: 15px;
    color: var(--text-muted);
}

.device-icon.online {
    color: var(--primary);
}

.qr-box img {
    max-width: 100%;
    border-radius: 8px;
    margin: 15px 0;
    border: 1px solid #ddd;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-muted);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    background: #fafafa;
    transition: 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--primary);
    outline: none;
    background: white;
}

.form-group textarea {
    height: 120px;
    resize: vertical;
}

/* Progress Bar */
.progress-container {
    width: 100%;
    background: #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    height: 20px;
    margin-top: 10px;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.5s ease;
}

.progress-text {
    position: absolute;
    width: 100%;
    text-align: center;
    top: 0;
    left: 0;
    font-size: 12px;
    font-weight: bold;
    color: #333;
    line-height: 20px;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

th,
td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    color: var(--text-muted);
}

tr:hover td {
    background: #fcfcfc;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-concluido {
    background: #d4edda;
    color: #155724;
}

.status-processando {
    background: #fff3cd;
    color: #856404;
}

.status-cancelado {
    background: #f8d7da;
    color: #721c24;
}

.status-pausado {
    background: #e2e3e5;
    color: #383d41;
}

.status-agendado {
    background: #cce5ff;
    color: #004085;
}

/* Logs */
.log-item { padding: 10px; border-bottom: 1px solid #eee; font-family: monospace; font-size: 13px; }
.log-info { color: #17a2b8; }
.log-error { color: #dc3545; background: #fff8f8; font-weight: bold;}
.log-time { color: var(--text-muted); font-size: 11px; margin-right: 10px; }

/* Modal Detalhes do Disparo */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 1000; display: none; justify-content: center; align-items: center; }
.modal-overlay.active { display: flex; animation: fadeIn 0.3s; }
.modal-content { background: var(--surface); width: 85%; max-width: 1000px; height: 85vh; border-radius: 12px; padding: 25px; display: flex; flex-direction: column; box-shadow: 0 10px 30px rgba(0,0,0,0.2); }
.modal-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #eee; padding-bottom: 15px; margin-bottom: 15px; }
.modal-header h2 { font-size: 22px; display: flex; align-items: center; gap: 10px; margin: 0; }
.modal-close { cursor: pointer; background: none; border: none; font-size: 28px; color: var(--text-muted); transition: 0.3s; }
.modal-close:hover { color: #dc3545; }
.modal-body { flex: 1; overflow-y: auto; }
.badge-detalhe { padding: 4px 8px; border-radius: 12px; font-size: 11px; font-weight: bold; text-transform: uppercase; }
.badge-sucesso { background: #d4edda; color: #155724; }
.badge-invalido { background: #fff3cd; color: #856404; }
.badge-erro { background: #f8d7da; color: #721c24; }

/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.toast {
    min-width: 280px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    animation: slideInRight 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast.success { background-color: var(--primary-dark); }
.toast.error { background-color: #d32f2f; }
.toast.info { background-color: #0c5460; }

@keyframes fadeOutToast {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(20px); }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}