/* public/assets/css/style.css */

/* import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --bg-sidebar: #0f172a;
    
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-white: #ffffff;
    
    --teal-50: #f0fdfa;
    --teal-100: #ccfbf1;
    --teal-500: #14b8a6;
    --teal-600: #0d9488;
    --teal-700: #0f766e;
    --teal-800: #115e59;
    
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-700: #334155;
    
    --success: #10b981;
    --success-light: #ecfdf5;
    --warning: #f59e0b;
    --warning-light: #fffbeb;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --info: #3b82f6;
    --info-light: #eff6ff;

    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-premium: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --transition-all: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-light);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--teal-600);
    text-decoration: none;
    transition: var(--transition-all);
}

a:hover {
    color: var(--teal-800);
}

/* --- TELA DE LOGIN --- */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 10% 20%, rgb(15, 23, 42) 0%, rgb(30, 41, 59) 90.1%);
    padding: 20px;
}

.login-card {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 440px;
    padding: 40px 32px;
    box-shadow: var(--shadow-lg);
    color: var(--text-white);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-white);
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.login-header h1 span {
    color: var(--teal-500);
}

.login-header p {
    color: var(--slate-300);
    font-size: 14px;
}

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

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--slate-700);
}

.login-card .form-group label {
    color: var(--slate-300);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    font-family: var(--font-sans);
    background-color: var(--bg-white);
    border: 1px solid var(--slate-200);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    transition: var(--transition-all);
}

.login-card .form-control {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-white);
}

.form-control:focus {
    outline: none;
    border-color: var(--teal-500);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.25);
}

.login-card .form-control:focus {
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.35);
    background-color: rgba(255, 255, 255, 0.08);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-sans);
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition-all);
    gap: 8px;
}

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

.btn-primary:hover {
    background-color: var(--teal-500);
    transform: translateY(-1px);
}

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

.btn-secondary:hover {
    background-color: var(--slate-300);
    color: var(--text-primary);
}

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

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-block {
    width: 100%;
}

/* --- ESTRUTURA PRINCIPAL --- */
/* ===== Layout com barra lateral (sidebar) ===== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: 250px;
    background-color: var(--bg-sidebar);
    color: var(--text-white);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 200;
    box-shadow: var(--shadow-md);
}

.sidebar-logo {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.sidebar-logo a {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-white);
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-logo a span,
.sidebar-logo a i {
    color: var(--teal-500);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    /* Barra de rolagem fina e discreta (Firefox) */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

/* Barra de rolagem fina e discreta (Chrome/Edge/Safari) */
.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}
.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.18);
    border-radius: 3px;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.30);
}

.sidebar-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--slate-300);
    border-radius: var(--radius-sm);
}

.sidebar-nav a i {
    width: 20px;
    text-align: center;
    font-size: 15px;
}

.sidebar-nav a:hover {
    color: var(--text-white);
    background-color: rgba(255, 255, 255, 0.06);
}

.sidebar-nav li.active a {
    color: var(--text-white);
    background-color: var(--teal-600);
}

.sidebar-section {
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: rgba(148, 163, 184, 0.75);
    padding: 14px 16px 4px;
}

.sidebar-user {
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}

.sidebar-user .user-name {
    font-weight: 600;
    font-size: 14px;
    display: block;
    color: var(--text-white);
}

.sidebar-user .user-role {
    font-size: 11px;
    color: var(--teal-400);
    display: block;
    margin-top: 2px;
}

.sidebar-user .btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: rgba(239, 68, 68, 0.15);
    color: #f87171;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
}

.sidebar-user .btn-logout:hover {
    background-color: var(--danger);
    color: var(--text-white);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 150;
}

.app-content {
    flex: 1;
    min-width: 0;
    margin-left: 250px;
}

.mobile-topbar {
    display: none;
    align-items: center;
    gap: 14px;
    background-color: var(--bg-sidebar);
    padding: 0 18px;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.mobile-topbar .menu-toggle {
    background: none;
    border: none;
    color: var(--text-white);
    font-size: 22px;
    cursor: pointer;
    padding: 4px 8px;
}

.mobile-topbar .logo a {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-white);
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-topbar .logo a span {
    color: var(--teal-500);
}

.main-content {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 24px;
}

/* Alert Boxes / Flash Messages */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background-color: var(--success-light);
    border-color: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.alert-error {
    background-color: var(--danger-light);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

/* --- TOAST NOTIFICATIONS --- */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    width: calc(100% - 48px);
}

.toast {
    background-color: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 5px solid transparent;
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55), opacity 0.4s;
    opacity: 0;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-success {
    border-left-color: var(--success);
}
.toast-success i {
    color: var(--success);
    font-size: 20px;
}

.toast-error {
    border-left-color: var(--danger);
}
.toast-error i {
    color: var(--danger);
    font-size: 20px;
}

.toast-message {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    flex: 1;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: var(--transition-all);
}

.toast-close:hover {
    color: var(--text-primary);
}

/* --- DASHBOARD --- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.page-title h2 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.page-title p {
    font-size: 14px;
    color: var(--text-muted);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background-color: var(--bg-white);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition-all);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-details h3 {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.stat-details .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-icon.teal {
    background-color: var(--teal-50);
    color: var(--teal-600);
}

.stat-icon.blue {
    background-color: var(--info-light);
    color: var(--info);
}

.stat-icon.orange {
    background-color: var(--warning-light);
    color: var(--warning);
}

.stat-icon.red {
    background-color: var(--danger-light);
    color: var(--danger);
}

.dashboard-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.card {
    background-color: var(--bg-white);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--slate-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 24px;
}

/* --- TABELAS --- */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

.table th {
    background-color: var(--slate-50);
    padding: 14px 18px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--slate-200);
}

.table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--slate-100);
    color: var(--text-primary);
    vertical-align: middle;
}

.table tr:last-child td {
    border-bottom: none;
}

.table tbody tr:hover {
    background-color: var(--slate-50);
}

/* Badges de Status e Perfil */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
}

.badge-success {
    background-color: var(--success-light);
    color: var(--success);
}

.badge-danger {
    background-color: var(--danger-light);
    color: var(--danger);
}

.badge-warning {
    background-color: var(--warning-light);
    color: var(--warning);
}

.badge-info {
    background-color: var(--info-light);
    color: var(--info);
}

.badge-teal {
    background-color: var(--teal-50);
    color: var(--teal-700);
}

/* Ações nas Tabelas */
.actions-cell {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--slate-100);
    color: var(--slate-700);
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition-all);
}

.btn-icon:hover {
    background-color: var(--teal-600);
    color: var(--text-white);
}

.btn-icon-danger:hover {
    background-color: var(--danger);
    color: var(--text-white);
}

/* --- FORMULÁRIOS COMUNS --- */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid var(--slate-200);
}

.form-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Filtros rápidos */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-white);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 200px;
}

.filter-group .form-control {
    padding: 8px 12px;
    font-size: 14px;
}

/* --- TELA DE ASSINATURA --- */
.signature-wrapper {
    border: 2px dashed var(--slate-300);
    border-radius: var(--radius-md);
    background-color: var(--slate-50);
    position: relative;
    margin-bottom: 12px;
    overflow: hidden;
    touch-action: none; /* impede rolagem da tela no mobile ao assinar */
}

.signature-canvas {
    display: block;
    width: 100%;
    height: 200px;
    background-color: #ffffff;
    cursor: crosshair;
}

.signature-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.signature-label {
    font-size: 13px;
    color: var(--text-muted);
}

/* Histórico do Colaborador */
.colab-profile {
    display: flex;
    gap: 24px;
    background-color: var(--bg-white);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 32px;
    align-items: center;
}

.colab-avatar {
    width: 64px;
    height: 64px;
    background-color: var(--teal-50);
    color: var(--teal-700);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
}

.colab-details h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.colab-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.colab-meta span strong {
    color: var(--text-primary);
}

/* Imagens de Assinatura na Tabela */
.signature-thumbnail {
    max-height: 40px;
    max-width: 120px;
    border: 1px solid var(--slate-200);
    border-radius: 4px;
    background-color: #fff;
    padding: 2px;
}

.mobile-only {
    display: none !important;
}

/* --- RESPONSIVIDADE --- */

/* Barra lateral vira gaveta (off-canvas) em telas médias e pequenas */
@media (max-width: 1024px) {
    .app-sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        width: 260px;
    }

    .app-sidebar.active {
        transform: translateX(0);
    }

    .app-content {
        margin-left: 0;
    }

    .mobile-topbar {
        display: flex;
    }

    .sidebar-overlay.active {
        display: block;
    }
}

@media (max-width: 768px) {
    .main-content {
        margin: 20px auto;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        margin-bottom: 24px;
    }
    
    .page-header .btn {
        width: 100%;
    }
    
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
    
    .colab-profile {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        text-align: left;
    }
}
