@import url('../fonts/outfit.css');
:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-soft: rgba(79, 70, 229, 0.08);
    --bg: #f5f7fb;
    --card: #ffffff;
    --text-main: #111827;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.08);
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
}
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg);
    color: var(--text-main);
    padding: 0;
    margin: 0;
    min-height: 100vh;
}
.container {
    width: 96%;
    max-width: 1600px;
    margin: 2rem auto;
    background: var(--card);
    padding: 2.5rem 3rem 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}
h1 {
    font-weight: 800;
    font-size: 2rem;
    margin-bottom: 2.5rem;
    letter-spacing: -0.02em;
}
.tabs {
    display: flex;
    gap: 28px;
    border-bottom: 1.5px solid var(--border);
    margin-bottom: 3rem;
}
.tab-btn {
    padding: 12px 6px;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
    position: relative;
    transition: 0.2s;
}
.tab-btn:hover {
    color: var(--primary);
}
.tab-btn.active {
    color: var(--primary);
}
.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1.5px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary);
    border-radius: 999px;
}
.tab-content {
    display: none;
    animation: fadeIn 0.25s ease;
}
.tab-content.active {
    display: block;
}
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.form-group {
    margin-bottom: 1.6rem;
}
label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
}
input,
select {
    width: 100%;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    background: #fafafa;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}
input:hover,
select:hover {
    border-color: #d1d5db;
}
input:focus,
select:focus {
    outline: none;
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}
button {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 13px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
button:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}
button:active {
    transform: scale(0.97);
}
.btn-cancel {
    background: #f3f4f6 !important;
    color: #374151 !important;
    border: 1px solid var(--border) !important;
}
.btn-cancel:hover {
    background: #e5e7eb !important;
}
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
table {
    width: 100%;
    border-collapse: collapse;
}
th {
    background: #f9fafb;
    padding: 13px;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}
td {
    padding: 12px;
    font-size: 0.9rem;
    border-bottom: 1px solid #f1f5f9;
}
tr:hover td {
    background: #fafafa;
}
td:nth-child(1),
td:nth-child(4),
td:nth-child(5),
td:nth-child(7),
td:nth-child(8) {
    white-space: nowrap;
}
td:nth-child(3) {
    min-width: 250px;
    white-space: normal;
    word-break: break-word;
    line-height: 1.4;
}
td:nth-child(2),
td:nth-child(3) {
    min-width: 180px;
}
.status-badge {
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
}
.status-Activo {
    background: #dcfce7;
    color: #166534;
}
.status-Inactivo {
    background: #fee2e2;
    color: #991b1b;
}
.status-Archivado {
    background: #fef3c7;
    color: #92400e;
}
.action-btns {
    display: flex;
    gap: 8px;
    justify-content: center;
}
.action-btns button {
    font-size: 1rem;
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}
hr {
    margin: 3rem 0;
    border: none;
    border-top: 1px solid var(--border);
}
.link-back {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
}
.link-back:hover {
    color: var(--primary);
}
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(6px);
    justify-content: center;
    align-items: center;
}
.modal-content {
    max-width: 90%;
    max-height: 85vh;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}
.close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    font-size: 2rem;
    color: #fff;
    cursor: pointer;
    opacity: 0.7;
}
.form-group { position: relative; }
.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white !important;
    border: 1px solid var(--border);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    max-height: 250px;
    overflow-y: auto;
    display: none;
    margin-top: -2px;
}
.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    font-size: 0.85rem;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.2s;
    color: var(--text-main);
    display: flex;
    align-items: start;
    gap: 10px;
    line-height: 1.4;
}
.autocomplete-item i { color: var(--primary); font-size: 0.8rem; }
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover {
    background: var(--primary-soft);
    color: var(--primary);
}