/* REP-P - Design System */
:root {
    --primary: #4F46E5;
    --primary-dark: #4338CA;
    --primary-light: #EEF2FF;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;
    --bg: #F8FAFC;
    --surface: #FFFFFF;
    --text: #0F172A;
    --text-muted: #64748B;
    --border: #E2E8F0;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.04);
    --shadow-lg: 0 4px 24px rgba(0,0,0,.1);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --sidebar-w: 260px;
    --transition: .2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .625rem 1.25rem;
    font-size: .875rem;
    font-weight: 600;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); background: var(--bg); }
.btn-block { width: 100%; }
.btn-lg { padding: .875rem 1.5rem; font-size: 1rem; border-radius: var(--radius-lg); }
.btn-sm { padding: .375rem .75rem; font-size: .8125rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .8125rem; font-weight: 600; color: var(--text-muted); margin-bottom: .375rem; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: .625rem .875rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: .9375rem;
    font-family: inherit;
    background: var(--surface);
    transition: var(--transition);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }

/* Cards */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    overflow: hidden;
}
.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-header h2 { font-size: 1rem; font-weight: 600; }
.card-body { padding: 1.5rem; }

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow);
}
.stat-label { display: block; font-size: .75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: .5rem; }
.stat-value { font-size: 1.75rem; font-weight: 700; color: var(--text); }
.stat-card.stat-warning .stat-value { color: var(--warning); }
.stat-card.stat-success .stat-value { color: var(--success); }
.stat-card.stat-danger .stat-value { color: var(--danger); }
.stat-card.stat-info .stat-value { color: var(--info); }

/* Badges */
.badge {
    display: inline-block;
    padding: .25rem .625rem;
    font-size: .75rem;
    font-weight: 600;
    border-radius: 999px;
}
.badge-success { background: #D1FAE5; color: #065F46; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-danger { background: #FEE2E2; color: #991B1B; }
.badge-info { background: #DBEAFE; color: #1E40AF; }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table th { text-align: left; padding: .75rem 1rem; font-weight: 600; color: var(--text-muted); border-bottom: 1px solid var(--border); font-size: .75rem; text-transform: uppercase; }
.table td { padding: .875rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table-responsive { overflow-x: auto; }
.thumb-selfie { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; }
.hash-small { font-size: .75rem; color: var(--text-muted); }

/* Layout Admin */
.app-layout { display: flex; min-height: 100vh; }
.sidebar {
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: transform var(--transition);
}
.sidebar-brand {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: .75rem;
    border-bottom: 1px solid var(--border);
}
.brand-icon { font-size: 1.5rem; }
.brand-text { font-size: 1.125rem; font-weight: 700; }
.sidebar-nav { flex: 1; padding: 1rem .75rem; overflow-y: auto; }
.nav-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1rem;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-weight: 500;
    font-size: .875rem;
    margin-bottom: .25rem;
    transition: var(--transition);
}
.nav-item:hover { background: var(--bg); color: var(--text); }
.nav-item.active { background: var(--primary-light); color: var(--primary); }
.sidebar-footer { padding: 1rem .75rem; border-top: 1px solid var(--border); }
.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    padding: 1.5rem;
    max-width: 1400px;
}
.page-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.page-header h1 { font-size: 1.5rem; font-weight: 700; }
.page-header p { color: var(--text-muted); font-size: .875rem; }
.btn-menu { display: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .5rem .75rem; cursor: pointer; font-size: 1.25rem; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }

.activity-list { list-style: none; }
.activity-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .875rem 0;
    border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-info span { display: block; font-size: .8125rem; color: var(--text-muted); }
.activity-time { font-size: .8125rem; color: var(--text-muted); }

.filters-bar { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.5rem; align-items: center; }
.filters-bar select, .filters-bar input { padding: .5rem .75rem; border: 1.5px solid var(--border); border-radius: var(--radius); font-family: inherit; }

.horario-dia { margin-bottom: 1.25rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--border); }
.horario-dia h4 { font-size: .875rem; margin-bottom: .5rem; }
.horario-campos { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin-top: .5rem; }
.checkbox-label { font-size: .875rem; display: flex; align-items: center; gap: .5rem; cursor: pointer; }

.text-muted { color: var(--text-muted); font-size: .875rem; }
.instructions-list { padding-left: 1.25rem; color: var(--text-muted); font-size: .875rem; }
.instructions-list li { margin-bottom: .5rem; }
.result-box { margin-top: 1rem; padding: 1.25rem; background: var(--primary-light); border-radius: var(--radius); }
.result-box h3 { margin-bottom: .5rem; }

/* Banco de horas */
.saldo-positivo { color: #059669; font-weight: 700; }
.saldo-negativo { color: #DC2626; font-weight: 700; }
.saldo-neutro { color: var(--text-muted); font-weight: 600; }
.saldo-badge { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .75rem; border-radius: 999px; font-size: .875rem; font-weight: 600; }
.saldo-badge.badge-success { background: #D1FAE5; }
.saldo-badge.badge-danger { background: #FEE2E2; }
.saldo-badge.badge-info { background: #E2E8F0; color: var(--text-muted); }
.saldo-hint { display: block; font-size: .7rem; color: var(--text-muted); margin-top: .15rem; }
.text-small { display: block; font-size: .75rem; }
.text-center { text-align: center; }
.table-banco td { vertical-align: middle; }
.table-banco .row-active { background: var(--primary-light); }
.card-info { border: 1px dashed var(--border); box-shadow: none; }
.card-info .card-body { padding: 1rem 1.25rem; }
.text-small { font-size: .8125rem; line-height: 1.5; }
.stat-card .saldo-valor { font-size: 1.5rem; }
.check-list { list-style: none; padding: 0; }
.check-list li { padding: .5rem 0; border-bottom: 1px solid var(--border); font-size: .9375rem; }
.card-warning { border: 1px solid #FCD34D; background: #FFFBEB; }
.stat-link { display: block; font-size: .75rem; color: var(--primary); margin-top: .5rem; font-weight: 500; }
.stat-link:hover { text-decoration: underline; }

/* Login */
.page-login { background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.login-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}
.login-brand { text-align: center; margin-bottom: 2rem; }
.brand-icon-lg { font-size: 3rem; display: block; margin-bottom: .5rem; }
.login-brand h1 { font-size: 1.75rem; font-weight: 700; }
.login-brand p { color: var(--text-muted); font-size: .875rem; }
.login-footer { text-align: center; margin-top: 1.5rem; font-size: .875rem; display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; align-items: center; }
.login-sep { color: var(--text-muted); }

/* Colaborador */
.colab-app { max-width: 600px; margin: 0 auto; min-height: 100vh; }
.colab-header {
    background: var(--surface);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}
.colab-user { display: flex; align-items: center; gap: 1rem; }
.avatar {
    width: 48px; height: 48px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
}
.colab-main { padding: 1.5rem; }
.stats-colab .stat-card { text-align: center; }
.colab-hint {
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: .75rem 1rem;
    border-radius: var(--radius);
    font-size: .875rem;
    margin-bottom: 1rem;
    text-align: center;
}
.colab-header .badge { margin-left: .35rem; vertical-align: middle; font-size: .65rem; }
.registros-list { list-style: none; }
.registros-list li {
    display: flex;
    justify-content: space-between;
    padding: .875rem 0;
    border-bottom: 1px solid var(--border);
    font-size: .875rem;
}
.registros-list .reg-tipo { font-weight: 600; }
.registros-list .reg-data { color: var(--text-muted); }

/* Toast */
.toast-container { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: .5rem; width: calc(100% - 2rem); max-width: 400px; }
.toast {
    background: var(--text);
    color: #fff;
    padding: .875rem 1.25rem;
    border-radius: var(--radius);
    font-size: .875rem;
    box-shadow: var(--shadow-lg);
    animation: slideIn .3s ease;
    max-width: 320px;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
@keyframes slideIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.loading-spinner { text-align: center; padding: 2rem; color: var(--text-muted); }

/* Responsive */
@media (max-width: 1024px) {
    .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 1rem; }
    .btn-menu { display: block; }
    .horario-campos { grid-template-columns: 1fr 1fr; }
}
