/* =====================================================
   SIG UT ITALCO - Estilos Frontend
   ===================================================== */

@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;
    --accent: #16a34a;
    --accent-dark: #15803d;
    --bg: #f0f4f8;
    --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-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; }
}

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

.sig-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.92rem;
    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: 28px;
    height: 28px;
    object-fit: contain;
}

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

.nav-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.nav-select-wrap {
    flex: 1;
    min-width: 200px;
}

.nav-select-wrap select.form-control {
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 0.9rem;
    color: var(--text-main);
    background-color: #fff;
    transition: border-color 0.2s;
    height: auto;
}

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

/* ---- INFO BAR ---- */
.info-bar {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 16px 0;
}

.info-bar .badge-count {
    background: rgba(255,255,255,0.25);
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1rem;
}

/* ---- CARDS (categorias / subcategorias) ---- */
.item-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    color: inherit;
}

.item-card:hover {
    box-shadow: var(--shadow-md);
    border-left-color: var(--accent);
    transform: translateX(3px);
    text-decoration: none;
    color: inherit;
}

.item-card .item-icon img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    flex-shrink: 0;
}

.item-card .item-info {
    flex: 1;
}

.item-card .item-name {
    font-weight: 600;
    font-size: 0.97rem;
    color: var(--text-main);
    margin-bottom: 2px;
}

.item-card .item-meta {
    font-size: 0.82rem;
    color: var(--text-muted);
    display: flex;
    gap: 16px;
}

.item-card .item-badge {
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 20px;
    padding: 3px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.item-card .item-badge.accent {
    background: #dcfce7;
    color: var(--accent-dark);
}

/* ---- FILE CARDS ---- */
.file-card {
    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:hover {
    box-shadow: var(--shadow-md);
    border-left-color: var(--primary);
}

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

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

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

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

.file-card .file-downloads {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 3px;
}

.file-card .file-actions {
    flex-shrink: 0;
}

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

.file-card .file-actions a:hover {
    background: var(--primary);
    color: #fff;
}

.btn-download {
    background: var(--primary-light);
    color: var(--primary);
    font-size: 1.25rem;
}

.btn-download:hover {
    background: var(--primary) !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(22,101,52,0.3);
    transform: translateY(-1px);
}

/* ---- LOGIN ---- */
.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(--primary);
}

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

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

.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(--primary);
    box-shadow: 0 0 0 3px rgba(22,101,52,0.12);
    outline: none;
}

.btn-login {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 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:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #052e16 100%);
    box-shadow: 0 4px 12px rgba(22,101,52,0.3);
    transform: translateY(-1px);
}

/* ---- SEARCH ---- */
.search-box {
    background: #fff;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    box-shadow: var(--shadow-sm);
    margin: 16px 0;
}

.search-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.search-input-group {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.search-input-group .form-control {
    flex: 1;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    font-size: 0.93rem;
    transition: border-color 0.2s;
}

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

.btn-search {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 22px;
    font-size: 0.93rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.btn-search:hover {
    background: var(--primary-dark);
}

/* ---- TABLE SECTION ---- */
.results-section {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin: 16px 0;
}

.results-section .results-header {
    background: var(--primary);
    color: #fff;
    padding: 12px 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.results-section .results-body {
    padding: 0;
}

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

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

.oculto {
    display: none;
}

.visible {
    display: block;
}

.section-container {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 0;
    margin: 16px 0;
    overflow: hidden;
    border: 1px solid var(--border);
}

.section-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    padding: 12px 20px;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-body {
    padding: 20px;
}

/* Responsive */
@media (max-width: 576px) {
    .sig-nav .container {
        flex-direction: column;
        align-items: stretch;
    }
    .login-card {
        padding: 28px 20px;
    }
    .search-input-group {
        flex-direction: column;
    }
    .item-card .item-meta {
        flex-direction: column;
        gap: 4px;
    }
}
