:root {
    --portal-base: #287b5c;
    --portal-base-dark: #1b4e48;
    --portal-base-light: #e5f0ec;
    --portal-ink: #17353e;
    --portal-green: #176f59;
    --portal-blue: #155b89;
    --portal-gold: #e5a83b;
    --portal-line: #d8e3e9;
    --portal-muted: #566b77;
    --portal-bg: #f7fafb;
}

html { scroll-behavior: smooth; }
body { margin: 0; color: var(--portal-ink); background: var(--portal-bg); font-family: Arial, Helvetica, sans-serif; letter-spacing: 0; }
[hidden] { display: none !important; }
a { color: var(--portal-blue); }
a:hover { color: #0a4469; }
:focus-visible { outline: 3px solid var(--portal-gold); outline-offset: 3px; }
.skip-link { position: absolute; top: -60px; left: 16px; z-index: 50; padding: 10px 14px; background: #fff; color: var(--portal-ink); }
.skip-link:focus { top: 12px; }

.site-header { position: relative; z-index: 20; background: var(--portal-base-dark); border-bottom: 3px solid var(--portal-gold); }
.site-header .navbar { min-height: 76px; padding: 10px 15px; visibility: visible; }
.site-header .navbar-brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; margin-right: 24px; color: #fff; white-space: normal; }
.site-header .navbar-brand:hover { color: #fff; }
.site-header .navbar-brand img { flex: 0 0 42px; object-fit: contain; background: #fff; border-radius: 4px; padding: 2px; }
.site-header .navbar-brand strong { display: block; font-size: 17px; line-height: 1.2; }
.site-header .navbar-brand small { display: block; color: #d4e7e3; font-size: 12px; line-height: 1.2; }
.brand-mark { display: inline-grid; flex: 0 0 42px; width: 42px; height: 42px; place-items: center; border-radius: 4px; color: var(--portal-base-dark); background: #fff; }
.site-header .navbar-toggler { width: 42px; height: 42px; padding: 0; color: #fff; border: 1px solid #c8dad9; }
.site-header .nav-link { padding: 10px 11px !important; color: #fff; font-weight: 600; font-size: 14px; }
.site-header .nav-link:hover { color: #f4d895; }
.btn-login { display: inline-flex; align-items: center; gap: 8px; margin-left: 12px; padding: 9px 15px; border: 1px solid #fff; color: #fff; font-size: 14px; font-weight: 700; }
.btn-login:hover { color: var(--portal-base-dark); background: #fff; }

.masthead { min-height: 260px; color: #fff; background-color: var(--portal-base-dark); background-image: linear-gradient(90deg, var(--portal-base-dark), rgba(15, 44, 49, .84) 62%, rgba(15, 44, 49, .54)), url('../img/imgsistema/bannerfs.png'); background-position: center; background-size: cover; background-repeat: no-repeat; }
.masthead-inner { padding-top: 43px; padding-bottom: 42px; }
.masthead-label { margin: 0 0 10px; color: #f3da9c; font-size: 13px; font-weight: 700; text-transform: uppercase; }
.masthead h1 { max-width: 900px; margin: 0; color: #fff; font-size: 34px; font-weight: 700; line-height: 1.22; overflow-wrap: anywhere; }
.masthead-subtitle { max-width: 700px; margin: 12px 0 22px; color: #e2edef; font-size: 16px; }
.masthead-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.masthead-actions .btn { display: inline-flex; align-items: center; gap: 9px; padding: 9px 16px; font-size: 14px; font-weight: 700; }
.masthead-actions .btn-light { color: var(--portal-ink); background: #fff; }
.masthead-actions .btn-outline-light { color: #fff; border-color: #d9e9e7; }
.masthead-actions .btn-outline-light:hover { color: var(--portal-ink); background: #fff; }

.quick-nav-wrap { background: #fff; border-bottom: 1px solid var(--portal-line); }
.quick-nav { display: flex; gap: 3px; overflow-x: auto; scrollbar-width: thin; }
.quick-nav a { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; padding: 17px 12px; border-bottom: 3px solid transparent; color: var(--portal-ink); font-size: 13px; font-weight: 700; text-decoration: none; }
.quick-nav a:hover, .quick-nav a:focus { border-bottom-color: var(--portal-green); color: var(--portal-green); }
.quick-nav i { color: var(--portal-blue); }

.portal-content { padding-top: 38px; padding-bottom: 70px; }
.directory-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.overline { margin: 0 0 5px; color: var(--portal-green); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.directory-heading h2 { margin: 0; color: var(--portal-ink); font-size: 25px; font-weight: 700; }
.search-group { position: relative; width: min(100%, 390px); flex: 0 1 390px; }
.search-group > i { position: absolute; top: 14px; left: 14px; color: var(--portal-blue); }
.search-group .form-control { height: 44px; padding-left: 40px; padding-right: 38px; border: 1px solid #bacbd4; border-radius: 4px; background: #fff; color: var(--portal-ink); }
.search-group .form-control:focus { border-color: var(--portal-green); box-shadow: 0 0 0 3px var(--portal-base-light); }
.search-group button { position: absolute; top: 4px; right: 4px; width: 36px; height: 36px; padding: 0; border: 0; background: transparent; color: var(--portal-muted); }
.result-count { margin: 8px 0 0; color: var(--portal-muted); font-size: 13px; }
.no-results { margin: 28px 0; padding: 25px 0; border-top: 1px solid var(--portal-line); color: var(--portal-muted); }

.directory-section { padding-top: 34px; scroll-margin-top: 20px; }
.section-heading { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 16px; }
.section-icon { display: grid; flex: 0 0 38px; width: 38px; height: 38px; place-items: center; border-radius: 4px; background: var(--portal-base-light); color: var(--portal-green); }
.directory-section:nth-of-type(3n + 2) .section-icon { background: #e2eff9; color: var(--portal-blue); }
.directory-section:nth-of-type(3n) .section-icon { background: #fcf0d9; color: #986914; }
.section-heading h3 { margin: 0 0 3px; color: var(--portal-ink); font-size: 19px; font-weight: 700; }
.section-heading p { margin: 0; color: var(--portal-muted); font-size: 14px; }
.service-list { margin-right: -8px; margin-left: -8px; }
.service-item { padding-right: 8px; padding-left: 8px; }
.service-card { min-width: 0; min-height: 124px; overflow: hidden; border: 1px solid var(--portal-line); border-radius: 6px; color: var(--portal-ink); background: #fff; box-shadow: 0 3px 10px rgba(23, 53, 62, .07); transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.service-card::before { position: absolute; top: 0; bottom: 0; left: 0; width: 4px; content: ''; background: var(--portal-green); }
.service-item:nth-child(3n + 2) .service-card::before { background: var(--portal-blue); }
.service-item:nth-child(3n) .service-card::before { background: var(--portal-gold); }
.service-card .card-body { gap: 14px; min-width: 0; padding: 20px 18px 18px 21px; }
.service-card:hover, .service-card:focus { border-color: var(--portal-green); color: var(--portal-ink); box-shadow: 0 7px 18px rgba(23, 53, 62, .13); transform: translateY(-2px); }
.service-icon { display: grid; flex: 0 0 40px; width: 40px; height: 40px; place-items: center; border-radius: 5px; color: var(--portal-green); background: var(--portal-base-light); font-size: 16px; }
.service-copy { display: block; min-width: 0; flex: 1 1 auto; }
.service-copy strong { display: block; font-size: 15px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.service-copy small { display: block; margin-top: 3px; color: var(--portal-muted); font-size: 13px; line-height: 1.4; }
.service-arrow { flex: 0 0 auto; margin-top: 4px; margin-left: 4px; color: var(--portal-green); font-size: 12px; }

.site-footer { padding: 26px 0; border-top: 1px solid var(--portal-line); background: var(--portal-base-light); }

.resource-heading { padding: 25px 0 28px; color: #fff; background: var(--portal-base-dark); }
.resource-breadcrumb { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; font-size: 13px; }
.resource-breadcrumb a { color: #e1efed; text-decoration: none; }
.resource-breadcrumb a:hover { color: #fff; text-decoration: underline; }
.resource-breadcrumb i { color: #f3da9c; font-size: 9px; }
.resource-heading-main { display: flex; align-items: center; gap: 15px; }
.resource-heading-icon { display: grid; flex: 0 0 50px; width: 50px; height: 50px; place-items: center; border: 1px solid #d2e5df; border-radius: 4px; color: #fff; font-size: 20px; }
.resource-heading h1 { margin: 0; color: #fff; font-size: 25px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.resource-heading p { margin: 4px 0 0; color: #dbeae7; font-size: 14px; }
.resource-area { padding: 0 16px 24px; background: #f2f6f7; }
.resource-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; max-width: 1600px; margin: 0 auto; }
.resource-toolbar .btn { display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px; font-size: 13px; font-weight: 700; }
.resource-back { color: var(--portal-base-dark); }
.resource-back:hover { color: var(--portal-green); }
.resource-open { color: var(--portal-blue); }
.resource-open:hover { color: var(--portal-base-dark); }
.resource-frame { display: block; width: 100%; height: max(680px, calc(100vh - 235px)); max-width: 1600px; margin: 0 auto; border: 1px solid var(--portal-line); background: #fff; }
.missing-page { min-height: 55vh; padding-top: 70px; padding-bottom: 70px; }
.missing-page h1 { font-size: 26px; font-weight: 700; }
.footer-inner { display: flex; justify-content: space-between; gap: 25px; }
.footer-inner strong, .footer-inner span { display: block; }
.footer-inner strong { max-width: 520px; font-size: 14px; line-height: 1.35; }
.footer-inner span { margin-top: 5px; color: var(--portal-muted); font-size: 13px; }
.footer-contact { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.footer-contact a { font-size: 13px; text-decoration: none; }
.footer-contact a:hover { text-decoration: underline; }

@media (max-width: 991.98px) {
    .site-header .navbar-collapse { padding: 12px 0 6px; border-top: 1px solid #759d93; }
    .site-header .navbar-nav { margin-bottom: 8px; }
    .site-header .nav-link { padding: 8px 0 !important; }
    .btn-login { margin-left: 0; }
}

@media (max-width: 767.98px) {
    .masthead { min-height: 0; }
    .masthead-inner { padding-top: 35px; padding-bottom: 36px; }
    .masthead h1 { font-size: 27px; }
    .masthead-subtitle { font-size: 15px; }
    .directory-heading { display: block; }
    .search-group { width: 100%; margin-top: 18px; }
    .footer-inner { display: block; }
    .footer-contact { align-items: flex-start; margin-top: 17px; }
    .resource-heading { padding: 20px 0; }
    .resource-heading h1 { font-size: 21px; }
    .resource-area { padding: 0 0 12px; }
    .resource-toolbar { padding: 0 10px; }
    .resource-open span { display: none; }
    .resource-frame { height: calc(100vh - 185px); min-height: 520px; border-left: 0; border-right: 0; }
}

@media (max-width: 360px) {
    .masthead-actions .btn { width: 100%; justify-content: center; }
    .service-card .card-body { gap: 10px; padding-right: 13px; padding-left: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}
