/* [WEB] assets/css/style.css — Estilos da aplicação
   SkyRom Social Web — Hostinger hPanel */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #dbeafe;
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --radius: 8px;
    --radius-sm: 4px;
    --transition: 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
    min-height: 100vh;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--gray-500);
    font-size: 0.95rem;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.alert-error {
    background: var(--danger-light);
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.alert-success {
    background: var(--success-light);
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
}

.form-group input {
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.btn-block {
    width: 100%;
}

.login-footer {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
    text-align: center;
    font-size: 0.8rem;
    color: var(--gray-500);
}

.login-footer code {
    background: var(--gray-100);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.75rem;
}

/* Dashboard Layout */
.header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info span {
    font-size: 0.9rem;
    color: var(--gray-600);
}

.tenant-badge {
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

.container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
}

.stat-card.pending { border-left: 4px solid var(--warning); }
.stat-card.processing { border-left: 4px solid var(--primary); }
.stat-card.done { border-left: 4px solid var(--success); }
.stat-card.failed { border-left: 4px solid var(--danger); }

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--gray-500);
}

section {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
}

section h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--gray-900);
}

.worker-status {
    margin-top: 0.5rem;
}

.worker-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.worker-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
}

.worker-item.online {
    background: var(--success-light);
    border: 1px solid #a7f3d0;
}

.worker-item.offline {
    background: var(--danger-light);
    border: 1px solid #fecaca;
}

.worker-name {
    font-weight: 500;
    flex: 1;
}

.worker-status {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-online {
    background: var(--success);
    color: white;
}

.status-offline {
    background: var(--danger);
    color: white;
}

.worker-heartbeat {
    font-size: 0.8rem;
    color: var(--gray-500);
}

.form-tarefa {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 120px;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-group small {
    display: block;
    margin-top: 0.5rem;
    color: var(--gray-500);
    font-size: 0.8rem;
    line-height: 1.5;
}

.tabela-tarefas {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.tabela-tarefas th,
.tabela-tarefas td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.tabela-tarefas th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
    white-space: nowrap;
}

.tabela-tarefas tbody tr:hover {
    background: var(--gray-50);
}

.tabela-tarefas tbody tr.status-pending td {
    background: var(--warning-light);
}

.tabela-tarefas tbody tr.status-processing td {
    background: var(--primary-light);
}

.tabela-tarefas tbody tr.status-done td {
    background: var(--success-light);
}

.tabela-tarefas tbody tr.status-failed td {
    background: var(--danger-light);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.status-pending { background: var(--warning-light); color: #92400e; }
.status-processing { background: var(--primary-light); color: var(--primary); }
.status-done { background: var(--success-light); color: var(--success); }
.status-failed { background: var(--danger-light); color: var(--danger); }

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray-500);
}

.empty-state p:first-child {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.footer {
    text-align: center;
    padding: 2rem 1.5rem;
    color: var(--gray-500);
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .user-info {
        flex-direction: column;
        gap: 0.5rem;
    }

    .tabela-tarefas {
        display: block;
        overflow-x: auto;
    }
}
/* Detalhes da tarefa */
.tarefa-detalhe {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}
.detalhe-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.detalhe-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.detalhe-item { background: #f8f9fa; padding: 12px; border-radius: 6px; }
.detalhe-section { margin-top: 20px; }
.detalhe-section h3 { margin-bottom: 8px; color: #333; }
.detalhe-section pre { background: #f4f4f4; padding: 16px; border-radius: 6px; overflow-x: auto; font-size: 13px; line-height: 1.5; }

/* Link no header */
.user-info a.btn-sm { margin-left: 8px; }