/* =====================================================
   SIG UT ITALCO - Estilos Panel Administrativo
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
@import url('https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css');

:root {
    --primary: #166534;
    --primary-dark: #14532d;
    --primary-light: #dcfce7;
    --admin-accent: #059669;
    --admin-accent-light: #d1fae5;
    --accent: #16a34a;
    --accent-dark: #15803d;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --bg: #f1f5f9;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.10), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.06);
    --radius: 10px;
    --radius-sm: 6px;
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg);
    font-family: 'Inter', 'Arial Narrow', Arial, sans-serif;
    color: var(--text-main);
    margin: 0;
    padding: 0;
}

main {
    font-family: 'Inter', 'Arial Narrow', Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---- HEADER ---- */
.sig-header {
    background: linear-gradient(135deg, rgba(20,90,45,0.63) 0%, rgba(34,160,80,0.59) 60%, rgba(52,211,100,0.53) 100%);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(10,46,26,0.4);
}

.sig-header.sig-header-admin {
    background: linear-gradient(135deg, rgba(10,80,40,0.63) 0%, rgba(16,160,100,0.59) 45%, rgba(52,211,153,0.53) 100%);
}

.sig-header-logo-img {
    height: 65px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3)) brightness(1.05);
    margin-right: 14px;
}

.sig-header-img {
    margin-left: auto;
    height: 130px;
    width: auto;
    max-width: 520px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 10px rgba(0,0,0,0.35)) brightness(1.05);
    border-radius: 50px;
    background: transparent;
    mix-blend-mode: multiply;
}

.sig-header::before {
    content: '';
    position: absolute;
    top: -60%;
    right: -5%;
    width: 320px;
    height: 320px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    pointer-events: none;
}

.sig-header::after {
    content: '';
    position: absolute;
    bottom: -50%;
    right: 20%;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.03);
    border-radius: 50%;
    pointer-events: none;
}

.sig-header-content {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 22px 0;
    position: relative;
    z-index: 1;
}

.sig-header-logo {
    width: 56px;
    height: 56px;
    background: rgba(255,255,255,0.12);
    border: 2px solid rgba(255,255,255,0.22);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    flex-shrink: 0;
    backdrop-filter: blur(4px);
}

.sig-header-divider {
    width: 2px;
    height: 42px;
    background: rgba(255,255,255,0.25);
    border-radius: 2px;
    flex-shrink: 0;
}

.sig-header-title {
    font-size: clamp(1rem, 2.5vw, 1.45rem);
    font-weight: 800;
    color: #fff;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    line-height: 1.2;
    text-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.sig-header-subtitle {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.72);
    font-weight: 400;
    margin-top: 4px;
    letter-spacing: 0.3px;
}

.sig-header-badge {
    margin-left: auto;
    background: rgba(5,46,22,0.55);
    border: 2px solid rgba(5,46,22,0.75);
    color: #d1fae5;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 7px 18px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
    text-shadow: 0 1px 4px rgba(0,0,0,0.4);
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

@media (max-width: 480px) {
    .sig-header-badge { display: none; }
    .sig-header-title { font-size: 0.95rem; letter-spacing: 0.5px; }
}

/* ---- ADMIN TOP BAR ---- */
.admin-topbar {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #052e16 100%);
    color: rgba(255,255,255,0.9);
    padding: 8px 0;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-align: center;
}

.admin-topbar span {
    color: #fbbf24;
    font-weight: 700;
}

/* ---- ADMIN NAVBAR ---- */
.admin-nav {
    background: var(--bg-card);
    border-bottom: 3px solid var(--primary);
    padding: 10px 0;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-nav .container {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--primary);
    background: transparent;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
}

.nav-btn img {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

.nav-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary-light);
    color: var(--primary-dark);
}

/* ---- PAGE HEADER ---- */
.page-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.page-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-header h2::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 22px;
    background: var(--admin-accent);
    border-radius: 2px;
}

.page-header .actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ---- DASHBOARD CARDS ---- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.dash-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 28px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    border: 1px solid var(--border);
    border-top: 4px solid var(--primary);
    text-decoration: none;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.dash-card:nth-child(1) { border-top-color: var(--primary); }
.dash-card:nth-child(2) { border-top-color: var(--accent); }
.dash-card:nth-child(3) { border-top-color: var(--admin-accent); }
.dash-card:nth-child(4) { border-top-color: var(--warning); }

.dash-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    text-decoration: none;
    color: var(--text-main);
}

.dash-card .dash-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.dash-card .dash-label {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
}

.dash-card .dash-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ---- TABLE ---- */
.admin-table-wrap {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    margin-bottom: 24px;
}

.admin-table-wrap .table-title {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    padding: 12px 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.table.table-striped {
    margin-bottom: 0;
    font-size: 0.9rem;
}

.table.table-striped thead th {
    background: #f8fafc;
    border-bottom: 2px solid var(--border);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
}

.table.table-striped tbody tr {
    transition: background 0.15s;
}

.table.table-striped tbody tr:hover {
    background: var(--primary-light) !important;
}

.table.table-striped tbody td {
    padding: 12px 16px;
    vertical-align: middle;
    border-color: var(--border);
    font-size: 0.88rem;
}

/* ---- ADMIN BUTTONS ---- */
.btn-accion {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
    text-decoration: none;
}

.btn-accion.borrar {
    background: var(--danger-light);
    color: var(--danger);
}
.btn-accion.borrar:hover {
    background: var(--danger);
    color: #fff;
}

.btn-accion.editar {
    background: var(--warning-light);
    color: var(--warning);
}
.btn-accion.editar:hover {
    background: var(--warning);
    color: #fff;
}

.btn-accion.agregar {
    background: var(--accent);
    color: #fff;
    padding: 8px 18px;
    font-size: 0.88rem;
}
.btn-accion.agregar:hover {
    background: var(--accent-dark);
    box-shadow: 0 2px 8px rgba(22,163,74,0.3);
    transform: translateY(-1px);
}

.btn-accion.info {
    background: var(--primary-light);
    color: var(--primary);
    padding: 8px 18px;
    font-size: 0.88rem;
}
.btn-accion.info:hover {
    background: var(--primary);
    color: #fff;
}

/* Bootstrap overrides */
.btn-success {
    background-color: var(--accent);
    border-color: var(--accent);
}
.btn-success:hover {
    background-color: var(--accent-dark);
    border-color: var(--accent-dark);
}

.btn-info {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.btn-info:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
}

.btn-danger {
    background-color: var(--danger);
    border-color: var(--danger);
}

/* ---- FILTERS BAR ---- */
.filters-bar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filters-bar .filter-group {
    flex: 1;
    min-width: 180px;
}

.filters-bar label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.filters-bar select.form-control {
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 0.88rem;
    transition: border-color 0.2s;
    height: auto;
}

.filters-bar select.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(22,101,52,0.12);
    outline: none;
}

/* ---- LOGIN ADMIN ---- */
.login-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 16px;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 40px 36px;
    width: 100%;
    max-width: 420px;
    border-top: 4px solid var(--admin-accent);
}

.login-card .login-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-dark);
    text-align: center;
    margin-bottom: 2px;
}

.login-card .login-subtitle {
    font-size: 0.88rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 28px;
}

.login-card .admin-badge {
    background: var(--admin-accent-light);
    color: var(--admin-accent);
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    text-align: center;
    margin-bottom: 20px;
}

.login-card .form-label {
    font-weight: 600;
    font-size: 0.87rem;
    color: var(--text-main);
    margin-bottom: 5px;
}

.login-card .form-control {
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 0.93rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-card .form-control:focus {
    border-color: var(--admin-accent);
    box-shadow: 0 0 0 3px rgba(5,150,105,0.12);
    outline: none;
}

.btn-login-admin {
    background: linear-gradient(135deg, var(--admin-accent) 0%, #047857 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 11px 28px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s;
    margin-top: 8px;
}

.btn-login-admin:hover {
    background: linear-gradient(135deg, #065f46 0%, #064e3b 100%);
    box-shadow: 0 4px 12px rgba(5,150,105,0.3);
    transform: translateY(-1px);
}

/* ---- FILE LIST (admin) ---- */
.file-card-admin {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid #94a3b8;
    border-radius: var(--radius);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 8px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.file-card-admin:hover {
    box-shadow: var(--shadow-md);
    border-left-color: var(--primary);
}

.file-card-admin .file-icon img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.file-card-admin .file-info {
    flex: 1;
}

.file-card-admin .file-name {
    font-weight: 600;
    font-size: 0.93rem;
    color: var(--text-main);
}

.file-card-admin .file-code {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    margin-right: 6px;
}

.file-card-admin .file-version {
    display: inline-block;
    background: #f1f5f9;
    color: var(--text-muted);
    font-size: 0.78rem;
    padding: 2px 8px;
    border-radius: 4px;
}

.file-card-admin .file-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.file-card-admin .file-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    font-size: 1.2rem;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-download-admin {
    background: var(--primary-light);
    color: var(--primary);
}

.btn-download-admin:hover {
    background: var(--primary) !important;
    color: #fff !important;
}

.btn-delete-admin {
    background: var(--danger-light);
    color: var(--danger);
}

.btn-delete-admin:hover {
    background: var(--danger) !important;
    color: #fff !important;
}

/* ---- FOOTER ---- */
.sig-footer {
    background: var(--primary-dark);
    color: rgba(255,255,255,0.6);
    text-align: center;
    font-size: 0.75rem;
    padding: 10px;
    margin-top: auto;
}

/* ---- UTILITIES ---- */
.milink {
    cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
    .page-header .container {
        flex-direction: column;
        align-items: flex-start;
    }
    .filters-bar {
        flex-direction: column;
    }
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .login-card {
        padding: 28px 20px;
    }
}
