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

:root {
    --bg-deep: #f3f4f6;
    --bg-gradient-1: #ffffff;
    --bg-gradient-2: #e5e7eb;
    --surface: rgba(255,255,255,0.85);
    --surface-hover: rgba(255,255,255,1);
    --border-subtle: rgba(87,86,86,0.2);
    --border-highlight: rgba(87,86,86,0.4);
    --text-primary: #575656;
    --text-secondary: #374151;
    --text-muted: #8b929d;
    --accent-primary: #097137;
    --accent-primary-hover: #075c2d;
    --accent-secondary: #097137;
    --accent-danger: #ef4444;
    --accent-danger-hover: #dc2626;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --shadow-sm: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.15), 0 10px 10px -5px rgba(0,0,0,0.1);
    --shadow-glow: 0 0 15px rgba(9,113,55,0.3);
    --glass-blur: blur(12px);
    --transition-fast: 0.2s cubic-bezier(0.4,0,0.2,1);
    --transition-smooth: 0.3s cubic-bezier(0.4,0,0.2,1);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }

body {
    background: linear-gradient(135deg, var(--bg-gradient-1), var(--bg-gradient-2), var(--bg-deep));
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

h1,h2,h3,h4,h5,h6 { font-weight: 600; letter-spacing: -0.025em; color: var(--text-primary); }
a { color: var(--accent-primary); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--accent-primary-hover); }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; margin-bottom: 2rem; }

/* HEADER */
header {
    background: rgba(255,255,255,0.9);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.875rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-secondary);
}

/* MAIN */
main { flex: 1; padding: 2rem 1.5rem; }
main.container { padding-top: 2rem; }

/* GLASS PANEL */
.glass-panel {
    background: var(--surface);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-subtle);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: box-shadow var(--transition-smooth);
}

.glass-panel.hover-effect:hover {
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    border-color: var(--border-highlight);
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
    box-shadow: 0 2px 4px rgba(9,113,55,0.3);
}
.btn-primary:hover { background: var(--accent-primary-hover); transform: translateY(-1px); box-shadow: 0 4px 8px rgba(9,113,55,0.4); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-secondary {
    background: rgba(255,255,255,0.7);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}
.btn-secondary:hover { background: var(--surface-hover); border-color: var(--border-highlight); }
.btn-secondary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-danger { background: var(--accent-danger); color: white; }
.btn-danger:hover { background: var(--accent-danger-hover); transform: translateY(-1px); }

.btn-success { background: var(--accent-success); color: white; }
.btn-success:hover { background: #059669; transform: translateY(-1px); }

.btn-warning { background: var(--accent-warning); color: white; }
.btn-warning:hover { background: #d97706; transform: translateY(-1px); }

.btn-icon { padding: 0.5rem; border-radius: 0.4rem; }

.btn-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.25rem;
    border-radius: 0.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast), background var(--transition-fast);
    font-size: 1rem;
}
.btn-close:hover { color: var(--text-primary); background: rgba(0,0,0,0.05); }

/* FORMS */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: 0.875rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 0.5rem; }
.form-control {
    width: 100%;
    padding: 0.65rem 0.875rem;
    border: 1px solid var(--border-subtle);
    border-radius: 0.5rem;
    background: rgba(255,255,255,0.8);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.form-control:focus { outline: none; border-color: var(--accent-primary); box-shadow: 0 0 0 3px rgba(9,113,55,0.15); }

/* MESSAGES */
.error-msg {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.3);
    color: #dc2626;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: none;
}
.error-msg.active { display: block; }

.success-msg {
    background: rgba(16,185,129,0.1);
    border: 1px solid rgba(16,185,129,0.3);
    color: #059669;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: none;
}
.success-msg.active { display: block; }

/* AUTH */
.auth-container { width: 100%; max-width: 420px; padding: 1.5rem; }
.auth-header { text-align: center; margin-bottom: 2rem; }
.auth-header h2 { font-size: 1.5rem; margin-bottom: 0.5rem; }

/* DASHBOARD HEADER */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.dashboard-header h2 { font-size: 1.25rem; display: flex; align-items: center; gap: 0.5rem; }

/* TABLE */
.table-responsive { overflow-x: auto; padding: 0; }

table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
thead tr { background: rgba(9,113,55,0.06); }
th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
}
td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid rgba(87,86,86,0.08);
    color: var(--text-primary);
    vertical-align: middle;
}
tbody tr { transition: background var(--transition-fast); }
tbody tr:hover { background: rgba(9,113,55,0.03); }
tbody tr:last-child td { border-bottom: none; }

.actions-cell { display: flex; gap: 0.35rem; align-items: center; }

/* BADGES DE ESTADO */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.65rem;
    border-radius: 2rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.badge-pendiente  { background: rgba(245,158,11,0.15); color: #b45309; border: 1px solid rgba(245,158,11,0.3); }
.badge-revisado   { background: rgba(59,130,246,0.15); color: #1d4ed8; border: 1px solid rgba(59,130,246,0.3); }
.badge-subido     { background: rgba(16,185,129,0.15); color: #059669; border: 1px solid rgba(16,185,129,0.3); }

/* FILTROS */
.filters-bar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.filter-chip {
    padding: 0.4rem 1rem;
    border-radius: 2rem;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border-subtle);
    background: rgba(255,255,255,0.6);
    color: var(--text-muted);
    transition: all var(--transition-fast);
}
.filter-chip:hover { border-color: var(--accent-primary); color: var(--accent-primary); }
.filter-chip.active { background: var(--accent-primary); color: white; border-color: var(--accent-primary); }

/* SEARCH */
.search-input-wrapper { position: relative; flex: 1; min-width: 200px; max-width: 320px; }
.search-input-wrapper i { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 0.85rem; pointer-events: none; }
.search-input-wrapper input { padding-left: 2.25rem; }

/* MODAL */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-smooth);
}
.modal-overlay.active { opacity: 1; pointer-events: all; }

.modal {
    background: white;
    border-radius: 1rem;
    padding: 1.75rem;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
    transform: translateY(10px);
    transition: transform var(--transition-smooth);
}
.modal-overlay.active .modal { transform: translateY(0); }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-subtle);
}
.modal-header h3 { font-size: 1.1rem; display: flex; align-items: center; gap: 0.5rem; }

/* STATS CARDS */
.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: 1px solid var(--border-subtle);
    border-radius: 0.875rem;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-smooth);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.stat-card .stat-value { font-size: 2rem; font-weight: 700; line-height: 1; }
.stat-card .stat-label { font-size: 0.78rem; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }
.stat-card .stat-icon { font-size: 1.25rem; margin-bottom: 0.25rem; }

.stat-total   .stat-value { color: var(--text-secondary); }
.stat-total   .stat-icon  { color: var(--text-muted); }
.stat-pending .stat-value { color: #b45309; }
.stat-pending .stat-icon  { color: var(--accent-warning); }
.stat-reviewed .stat-value { color: #1d4ed8; }
.stat-reviewed .stat-icon  { color: #3b82f6; }
.stat-uploaded .stat-value { color: #059669; }
.stat-uploaded .stat-icon  { color: var(--accent-success); }

/* LOADER */
.loader {
    display: inline-block;
    width: 18px; height: 18px;
    border: 2px solid rgba(9,113,55,0.2);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* EMPTY STATE */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}
.empty-state i { font-size: 2.5rem; opacity: 0.3; margin-bottom: 1rem; display: block; }
.empty-state p { font-size: 0.9rem; }

/* ROLE TAG */
.role-tag {
    font-size: 0.75rem;
    background: var(--accent-primary);
    color: white;
    padding: 0.15rem 0.55rem;
    border-radius: 1rem;
    margin-left: 0.5rem;
    font-weight: 500;
}
.role-tag.documentacion { background: #3b82f6; }

/* HIDDEN */
.hidden { display: none !important; }

/* FOOTER */
footer {
    text-align: center;
    padding: 1.25rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-subtle);
    background: rgba(255,255,255,0.5);
    margin-top: auto;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-header { flex-direction: column; align-items: flex-start; }
    .filters-bar { gap: 0.5rem; }
    th, td { padding: 0.65rem 0.75rem; }
}

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