:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #16a34a;
    --warning: #ea580c;
    --danger: #dc2626;
    --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;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--gray-50); color: var(--gray-800); }

/* Layout */
.app-layout { display: flex; min-height: 100vh; }
.sidebar { width: 260px; background: var(--gray-900); color: white; display: flex; flex-direction: column; position: fixed; top: 0; left: 0; height: 100vh; z-index: 50; }
.sidebar-header { padding: 1.25rem; border-bottom: 1px solid var(--gray-700); }
.sidebar-header h1 { font-size: 1.1rem; font-weight: 700; }
.sidebar-header span { font-size: .75rem; color: var(--gray-400); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: .5rem 0; }
.sidebar-nav a { display: flex; align-items: center; gap: .75rem; padding: .625rem 1.25rem; color: var(--gray-300); text-decoration: none; font-size: .875rem; transition: all .15s; }
.sidebar-nav a:hover { background: var(--gray-800); color: white; }
.sidebar-nav a.active { background: var(--primary); color: white; }
.sidebar-nav .nav-label { padding: .5rem 1.25rem .25rem; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--gray-500); }
.main-content { flex: 1; margin-left: 260px; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { background: white; border-bottom: 1px solid var(--gray-200); padding: .75rem 1.5rem; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 40; }
.content { padding: 1.5rem; flex: 1; }

/* Dashboard grid */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: white; border-radius: .75rem; padding: 1.25rem; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.stat-card .stat-label { font-size: .8rem; color: var(--gray-500); margin-bottom: .25rem; }
.stat-card .stat-value { font-size: 1.75rem; font-weight: 700; }
.stat-card .stat-sub { font-size: .8rem; color: var(--gray-400); margin-top: .25rem; }

/* Tables */
.table-container { background: white; border-radius: .75rem; box-shadow: 0 1px 3px rgba(0,0,0,.08); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: .75rem 1rem; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--gray-500); background: var(--gray-50); border-bottom: 2px solid var(--gray-200); }
td { padding: .75rem 1rem; font-size: .875rem; border-bottom: 1px solid var(--gray-100); }
tr:hover td { background: var(--gray-50); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: .5rem; padding: .5rem 1rem; border-radius: .5rem; font-size: .875rem; font-weight: 500; border: none; cursor: pointer; transition: all .15s; text-decoration: none; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-secondary { background: var(--gray-200); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-300); }
.btn-sm { padding: .375rem .75rem; font-size: .8rem; }
.btn-icon { padding: .375rem; border-radius: .375rem; background: none; color: var(--gray-500); border: 1px solid var(--gray-200); }
.btn-icon:hover { background: var(--gray-100); }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .875rem; font-weight: 500; color: var(--gray-700); margin-bottom: .375rem; }
.form-control { width: 100%; padding: .5rem .75rem; border: 1px solid var(--gray-300); border-radius: .5rem; font-size: .875rem; transition: border-color .15s; }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
select.form-control { appearance: auto; }

/* Cards */
.card { background: white; border-radius: .75rem; box-shadow: 0 1px 3px rgba(0,0,0,.08); padding: 1.25rem; margin-bottom: 1rem; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; padding-bottom: .75rem; border-bottom: 1px solid var(--gray-100); }
.card-title { font-size: 1rem; font-weight: 600; }

/* Modal */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.5); display: none; align-items: center; justify-content: center; z-index: 100; }
.modal-overlay.active { display: flex; }
.modal { background: white; border-radius: .75rem; padding: 1.5rem; width: 90%; max-width: 560px; max-height: 85vh; overflow-y: auto; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.modal-title { font-size: 1.1rem; font-weight: 600; }

/* Badges */
.badge { display: inline-block; padding: .125rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 500; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fed7aa; color: #9a3412; }
.badge-danger { background: #fecaca; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-orange { background: #fed7aa; color: #c2410c; }

/* Pending sidebar */
.content-wrapper { display: flex; gap: 1.5rem; }
.content-main { flex: 1; min-width: 0; }
.pending-sidebar { width: 320px; flex-shrink: 0; }
.pending-card { background: white; border-radius: .75rem; box-shadow: 0 1px 3px rgba(0,0,0,.08); position: sticky; top: 5rem; max-height: calc(100vh - 8rem); overflow-y: auto; }
.pending-card-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--gray-100); font-weight: 600; font-size: .9rem; display: flex; align-items: center; gap: .5rem; position: sticky; top: 0; background: white; }
.pending-item { padding: .75rem 1.25rem; border-bottom: 1px solid var(--gray-50); font-size: .85rem; }
.pending-item:last-child { border-bottom: none; }
.pending-item .tipo { font-size: .7rem; text-transform: uppercase; letter-spacing: .03em; color: var(--gray-500); }
.pending-item .desc { margin: .25rem 0; color: var(--gray-700); }
.pending-item .actions { display: flex; gap: .5rem; margin-top: .375rem; }

/* Login page */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%); }
.login-card { background: white; border-radius: 1rem; padding: 2.5rem; width: 100%; max-width: 420px; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.login-card h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: .25rem; }
.login-card p { color: var(--gray-500); margin-bottom: 1.5rem; font-size: .875rem; }

/* Calendar */
.calendar-weekly { display: grid; grid-template-columns: repeat(7, 1fr); gap: .5rem; }
.calendar-day { background: white; border-radius: .5rem; padding: .75rem; min-height: 180px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.calendar-day .day-header { font-size: .85rem; font-weight: 600; margin-bottom: .5rem; padding-bottom: .375rem; border-bottom: 2px solid var(--gray-100); }
.calendar-day.today .day-header { color: var(--primary); border-bottom-color: var(--primary); }
.calendar-item { font-size: .75rem; padding: .25rem .375rem; margin-bottom: .25rem; border-radius: .25rem; background: var(--gray-100); cursor: pointer; }
.calendar-item:hover { background: var(--gray-200); }

/* Discrepancy highlight */
.discrepancy { background: #fff7ed; border-left: 3px solid var(--warning); padding: .5rem .75rem; margin-bottom: .5rem; border-radius: 0 .375rem .375rem 0; font-size: .85rem; }
.discrepancy .label { font-weight: 600; color: var(--warning); }

/* Responsive */
@media (max-width: 768px) {
    .sidebar { width: 100%; height: auto; position: relative; }
    .main-content { margin-left: 0; }
    .content-wrapper { flex-direction: column; }
    .pending-sidebar { width: 100%; }
    .calendar-weekly { grid-template-columns: repeat(1, 1fr); }
    .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Utility */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: .25rem; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: .75rem; }
.gap-4 { gap: 1rem; }
.mb-2 { margin-bottom: .5rem; }
.mb-3 { margin-bottom: .75rem; }
.mb-4 { margin-bottom: 1rem; }
.mt-2 { margin-top: .5rem; }
.mt-4 { margin-top: 1rem; }
.text-sm { font-size: .875rem; }
.text-xs { font-size: .75rem; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
.text-gray-500 { color: var(--gray-500); }
.text-primary { color: var(--primary); }
.hidden { display: none; }
.w-full { width: 100%; }
