:root {
    --sidebar-width: 240px;
    --bg-dark: #000000;
    --bg-sidebar: #0d0d0d;
    --bg-card: #ffffff;
    --primary: #D4AF37;
    --primary-hover: #C9A84C;
    --text-light: #a2a3b7;
    --text-white: #ffffff;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --border: #e5e7eb;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f1f5f9;
    color: #1e293b;
}

/* LOGIN */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
}
.login-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    border: 1px solid var(--primary);
}
.login-card h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
    color: #1e293b;
}
.login-card p {
    color: #64748b;
    margin-bottom: 24px;
    font-size: 14px;
}

/* LAYOUT */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform 0.3s;
}
.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.sidebar-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-white);
}
.sidebar-header small {
    font-size: 11px;
    color: var(--text-light);
}
.sidebar-nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}
.nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-white);
}
.nav-item.active {
    background: rgba(212,175,55,0.12);
    color: var(--primary);
    border-right: 3px solid var(--primary);
}
.nav-item i { width: 20px; text-align: center; font-size: 16px; }

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.user-info {
    font-size: 13px;
    margin-bottom: 8px;
    color: var(--text-white);
}
.user-info small { color: var(--text-light); display: block; }
.btn-logout {
    background: rgba(239,68,68,0.1);
    color: var(--danger);
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    width: 100%;
    transition: background 0.2s;
}
.btn-logout:hover { background: rgba(239,68,68,0.2); }

/* CONTENT */
.content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 24px;
    min-height: 100vh;
}
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.page-header h1 { font-size: 22px; font-weight: 700; }
.page-header p { color: #64748b; font-size: 14px; margin: 0; }

/* CARDS */
.stat-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    gap: 16px;
}
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.stat-icon.blue { background: #eff6ff; color: #3b82f6; }
.stat-icon.green { background: #ecfdf5; color: #10b981; }
.stat-icon.yellow { background: #fef3c7; color: #f59e0b; }
.stat-icon.red { background: #fef2f2; color: #ef4444; }
.stat-icon.gold { background: #fef9e7; color: #D4AF37; }
.stat-info h3 { font-size: 24px; font-weight: 700; margin: 0; }
.stat-info p { color: #64748b; font-size: 13px; margin: 2px 0 0; }

/* TABLE */
.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    overflow: hidden;
}
.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 12px;
}
.table-toolbar .search-box {
    display: flex;
    align-items: center;
    gap: 8px;
}
.table-toolbar input[type="text"] {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    outline: none;
    width: 200px;
}
.table-toolbar input[type="text"]:focus { border-color: var(--primary); }
table {
    width: 100%;
    border-collapse: collapse;
}
th {
    background: #f8fafc;
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}
td {
    padding: 12px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}
tr:hover td { background: #f8fafc; }
tr.row-vencida td { background: #fef2f2; }
tr.row-vencida td:first-child { border-left: 3px solid var(--danger); }

/* BADGES */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}
.badge-success { background: #ecfdf5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fef2f2; color: #991b1b; }
.badge-info { background: #eff6ff; color: #1e40af; }
.badge-secondary { background: #f1f5f9; color: #475569; }

/* BUTTONS */
.btn { font-size: 13px; padding: 8px 16px; border-radius: 8px; border: none; cursor: pointer; transition: all 0.2s; display: inline-flex; align-items: center; gap: 6px; }
.btn-primary { background: var(--primary); color: #1a1a1a; }
.btn-primary:hover { background: var(--primary-hover); color: #000; }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-warning { background: var(--warning); color: white; }
.btn-warning:hover { background: #d97706; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: #475569; }
.btn-outline:hover { background: #f8fafc; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* MODAL */
.mo-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.mo-overlay.show { display: flex; }
.mo-card {
    background: white;
    border-radius: 16px;
    padding: 0;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.mo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}
.mo-header h2 { font-size: 18px; font-weight: 600; }
.mo-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #64748b;
}
.mo-body { padding: 24px; }
.mo-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

/* FORM */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: #374151; margin-bottom: 4px; }
.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border 0.2s;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
select.form-control { appearance: auto; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-check { display: flex; align-items: center; gap: 8px; }
.form-check input[type="checkbox"] { width: 16px; height: 16px; }

/* AUTOCOMPLETE */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1100;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    max-height: 220px;
    overflow-y: auto;
    display: none;
    margin-top: 4px;
}
.autocomplete-dropdown.show { display: block; }
.autocomplete-item {
    padding: 10px 14px;
    font-size: 13px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    line-height: 1.4;
    color: #1e293b;
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover { background: #f8fafc; }

/* LOADING */
.loading {
    text-align: center;
    padding: 40px;
    color: #64748b;
}
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* TOAST */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast:not(.show),
.toast {
    display: block;
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: slideIn 0.3s ease;
    max-width: 350px;
}
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-warning { background: var(--warning); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* HAMBURGER MENU */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: #1e293b;
    cursor: pointer;
    padding: 4px;
}

/* EMPTY STATE */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}
.empty-state i { font-size: 48px; color: #cbd5e1; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* RESPONSIVE */
@media (max-width: 768px) {
    .menu-toggle { display: block; }
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open { transform: translateX(0); }
    .content { margin-left: 0; padding: 16px; }
    .form-row { grid-template-columns: 1fr; }
    .table-toolbar { flex-direction: column; align-items: stretch; }
    .table-toolbar input[type="text"] { width: 100%; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .modal { margin: 16px; max-width: 100%; }
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 99;
    }
    .sidebar-overlay.show { display: block; }
}
