:root {
    color-scheme: light;
    --amazonas-blue: #032f6d;
    --amazonas-blue-light: #1052b7;
    --amazonas-yellow: #fccc00;
    --amazonas-green: #6ca838;
    --ink: #17243a;
    --muted: #718096;
    --line: #e5eaf1;
    --surface: #fff;
    --page: #f5f7fb;
    font-family: "Segoe UI", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-width: 320px;
    color: var(--ink);
    background: var(--page);
}

button,
input {
    font: inherit;
}

.top-accent {
    position: fixed;
    z-index: 5;
    inset: 0 0 auto;
    height: 5px;
    background: linear-gradient(90deg, var(--amazonas-yellow) 0 33%, var(--amazonas-green) 33% 100%);
}

.login-page {
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 10% 90%, rgba(16, 82, 183, .08), transparent 30%),
        radial-gradient(ellipse at 95% 10%, rgba(108, 168, 56, .12), transparent 30%),
        #f5f7fb;
}

.login-layout {
    width: min(1050px, calc(100% - 48px));
    min-height: 100vh;
    margin: auto;
    padding: 70px 0 30px;
    display: grid;
    grid-template-columns: 1fr .82fr;
    align-items: center;
    gap: clamp(36px, 7vw, 100px);
    position: relative;
}

.login-brand {
    min-height: 460px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    padding: 48px;
    border-radius: 28px;
    color: #fff;
    background: linear-gradient(145deg, #032f6d 0%, #08448f 70%, #1052b7 100%);
    box-shadow: 0 24px 60px rgba(3, 47, 109, .18);
}

.login-brand::before,
.login-brand::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.login-brand::before {
    width: 360px;
    height: 360px;
    right: -130px;
    bottom: -190px;
    border: 58px solid rgba(108, 168, 56, .8);
}

.login-brand::after {
    width: 180px;
    height: 180px;
    right: -55px;
    bottom: -92px;
    border: 16px solid rgba(252, 204, 0, .88);
}

.login-crest {
    width: 98px;
    height: 112px;
    object-fit: contain;
    object-position: center;
    margin-bottom: 35px;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .2));
}

.brand-copy,
.brand-decoration {
    position: relative;
    z-index: 1;
}

.eyebrow,
.section-kicker {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.eyebrow {
    color: var(--amazonas-yellow);
}

.brand-copy h1 {
    max-width: 360px;
    margin: 12px 0 14px;
    font: 800 clamp(34px, 4vw, 48px)/1.12 "Segoe UI", Arial, sans-serif;
    letter-spacing: -.04em;
}

.brand-copy p {
    max-width: 320px;
    margin: 0;
    color: rgba(255, 255, 255, .78);
    font-size: 16px;
    line-height: 1.65;
}

.login-panel {
    padding: 22px 0;
}

.login-heading {
    margin-bottom: 29px;
}

.section-kicker {
    color: var(--amazonas-green);
}

.login-heading h2 {
    margin: 9px 0 7px;
    font: 800 32px/1.2 "Segoe UI", Arial, sans-serif;
    letter-spacing: -.04em;
    color: var(--amazonas-blue);
}

.login-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.login-form {
    display: flex;
    flex-direction: column;
}

.login-form label,
.captcha-heading label {
    margin: 0 0 8px;
    color: #34435a;
    font-size: 13px;
    font-weight: 700;
}

.input-wrap {
    display: flex;
    align-items: center;
    height: 50px;
    margin-bottom: 19px;
    padding: 0 13px;
    border: 1px solid #dce3ed;
    border-radius: 10px;
    background: var(--surface);
    transition: border-color .2s, box-shadow .2s;
}

.input-wrap:focus-within,
.captcha-row:focus-within {
    border-color: var(--amazonas-blue-light);
    box-shadow: 0 0 0 3px rgba(16, 82, 183, .1);
}

.input-wrap input,
.captcha-row input {
    width: 100%;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: 0;
    color: var(--ink);
    background: transparent;
    font-size: 14px;
}

.input-wrap input::placeholder,
.captcha-row input::placeholder {
    color: #a0aaba;
}

.input-symbol {
    width: 22px;
    margin-right: 10px;
    color: var(--amazonas-blue-light);
    font-size: 17px;
    font-weight: 700;
    text-align: center;
}

.lock-symbol {
    position: relative;
    width: 17px;
    height: 13px;
    margin: 5px 15px 0 2px;
    border: 1.7px solid var(--amazonas-blue-light);
    border-radius: 3px;
}

.lock-symbol::before {
    content: "";
    position: absolute;
    width: 7px;
    height: 7px;
    left: 3.3px;
    top: -8px;
    border: 1.7px solid var(--amazonas-blue-light);
    border-bottom: 0;
    border-radius: 7px 7px 0 0;
}

.password-toggle,
.captcha-refresh {
    flex: none;
    padding: 5px;
    border: 0;
    color: var(--amazonas-blue-light);
    background: transparent;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.captcha-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.captcha-row {
    display: flex;
    height: 50px;
    overflow: hidden;
    border: 1px solid #dce3ed;
    border-radius: 10px;
    background: var(--surface);
    transition: border-color .2s, box-shadow .2s;
}

.captcha-question {
    display: grid;
    min-width: 115px;
    place-items: center;
    padding: 0 15px;
    color: var(--amazonas-blue);
    background: #eef4fc;
    font: 700 17px "Segoe UI", Arial, sans-serif;
}

.captcha-row input {
    padding: 0 14px;
}

.field-hint {
    margin: 8px 0 22px;
    color: var(--muted);
    font-size: 11px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 9px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, transform .2s, box-shadow .2s;
}

.button-primary {
    min-height: 50px;
    padding: 0 18px;
    color: #fff;
    background: var(--amazonas-blue);
    box-shadow: 0 8px 16px rgba(3, 47, 109, .16);
}

.button-primary span {
    margin-left: auto;
    font-size: 19px;
}

.button-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    background: var(--amazonas-blue-light);
    box-shadow: 0 11px 20px rgba(3, 47, 109, .2);
}

.button-primary:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.alert {
    margin: 0 0 17px;
    padding: 12px 14px;
    border-radius: 9px;
    font-size: 12px;
    line-height: 1.55;
}

.alert-warning {
    border: 1px solid #f0d47a;
    color: #765900;
    background: #fff8dc;
}

.alert-error {
    border: 1px solid #f2c7c7;
    color: #9d2929;
    background: #fff0f0;
}

.alert code {
    font-size: 11px;
}

.login-footnote {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 22px 0 0;
    color: #7b8797;
    font-size: 11px;
}

.secure-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--amazonas-green);
    box-shadow: 0 0 0 3px rgba(108, 168, 56, .13);
}

.login-footer {
    position: absolute;
    bottom: 19px;
    left: 0;
    color: #8290a2;
    font-size: 11px;
}

.login-footer span {
    padding: 0 5px;
    color: var(--amazonas-yellow);
}

.dashboard-page {
    min-height: 100vh;
    background: #f6f8fb;
}

.site-header {
    display: flex;
    min-height: 86px;
    align-items: center;
    justify-content: space-between;
    padding: 10px max(6vw, calc((100vw - 1180px) / 2));
    color: #fff;
    background: var(--amazonas-green);
    box-shadow: 0 3px 15px rgba(25, 58, 32, .11);
}

.header-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
}

.header-brand img {
    width: 48px;
    height: 61px;
    object-fit: contain;
}

.header-brand span {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.header-brand strong {
    font: 800 17px "Segoe UI", Arial, sans-serif;
    letter-spacing: .08em;
}

.header-brand small {
    color: rgba(255, 255, 255, .78);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .16em;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 21px;
}

.header-actions form {
    margin: 0;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13px;
    font-weight: 600;
}

.user-avatar {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: 50%;
    background: rgba(3, 47, 109, .18);
}

.button-logout {
    min-height: 36px;
    padding: 0 15px;
    border: 1px solid rgba(255, 255, 255, .46);
    color: #fff;
    background: rgba(3, 47, 109, .16);
    font-size: 12px;
}

.button-logout:hover {
    background: var(--amazonas-blue);
}

.dashboard-main {
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
}

.welcome-banner {
    display: flex;
    min-height: 214px;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
    position: relative;
    margin: 34px 0 46px;
    padding: 36px 50px;
    border-radius: 17px;
    color: #fff;
    background:
        linear-gradient(105deg, rgba(3, 47, 109, .98) 0%, rgba(16, 82, 183, .95) 70%, rgba(16, 82, 183, .86) 100%);
    box-shadow: 0 14px 32px rgba(3, 47, 109, .13);
}

.welcome-banner::after {
    content: "";
    position: absolute;
    width: 360px;
    height: 360px;
    top: -212px;
    right: -70px;
    border: 36px solid rgba(108, 168, 56, .55);
    border-radius: 50%;
    box-shadow: 0 0 0 14px rgba(252, 204, 0, .55);
}

.welcome-content {
    position: relative;
    z-index: 1;
}

.welcome-content .section-kicker {
    color: var(--amazonas-yellow);
}

.welcome-content h1 {
    margin: 10px 0 9px;
    font: 800 clamp(25px, 3vw, 36px)/1.18 "Segoe UI", Arial, sans-serif;
    letter-spacing: -.035em;
    text-transform: capitalize;
}

.welcome-content p {
    margin: 0;
    color: rgba(255, 255, 255, .8);
    font-size: 14px;
}

.welcome-seal {
    position: relative;
    z-index: 1;
    display: grid;
    width: 120px;
    height: 120px;
    place-items: center;
    margin-right: 35px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
}

.welcome-seal img {
    width: 72px;
    height: 94px;
    object-fit: contain;
}

.section-title-row {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.section-title-row h2 {
    margin: 6px 0 0;
    color: var(--amazonas-blue);
    font: 800 23px "Segoe UI", Arial, sans-serif;
    letter-spacing: -.03em;
}

.search-box {
    display: flex;
    width: min(290px, 42vw);
    height: 42px;
    align-items: center;
    gap: 9px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
}

.search-box:focus-within {
    border-color: var(--amazonas-blue-light);
    box-shadow: 0 0 0 3px rgba(16, 82, 183, .08);
}

.search-box svg {
    width: 17px;
    height: 17px;
    flex: none;
    fill: none;
    stroke: #8b98a9;
    stroke-linecap: round;
    stroke-width: 1.8;
}

.search-box input {
    width: 100%;
    border: 0;
    outline: 0;
    color: var(--ink);
    background: transparent;
    font-size: 12px;
}

.search-box input::placeholder {
    color: #9aa5b3;
}

.system-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
}

.system-card {
    position: relative;
    display: flex;
    min-height: 140px;
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 21px 15px;
    border: 1px solid #e8edf3;
    border-radius: 12px;
    color: inherit;
    background: var(--surface);
    box-shadow: 0 4px 14px rgba(21, 43, 75, .035);
    text-decoration: none;
    transition: border-color .2s, box-shadow .2s, transform .2s;
}

.system-card:hover,
.system-card:focus-visible {
    transform: translateY(-3px);
    border-color: rgba(16, 82, 183, .35);
    box-shadow: 0 12px 24px rgba(21, 43, 75, .1);
    outline: 0;
}

.card-icon {
    display: grid;
    width: 43px;
    height: 43px;
    place-items: center;
    margin-bottom: 9px;
    border-radius: 10px;
    color: var(--amazonas-blue-light);
    background: #eef4fc;
}

.card-icon svg {
    width: 31px;
    height: 31px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.card-category {
    margin-bottom: 5px;
    color: var(--amazonas-green);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.card-title {
    color: var(--amazonas-blue);
    font: 700 15px "Segoe UI", Arial, sans-serif;
}

.card-description {
    margin-top: 6px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
}

.card-link {
    position: absolute;
    top: 16px;
    right: 18px;
    color: var(--amazonas-blue-light);
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    transition: transform .2s;
}

.system-card:hover .card-link,
.system-card:focus-visible .card-link {
    transform: translate(2px, -2px);
}

.empty-state {
    padding: 34px 16px;
    color: var(--muted);
    text-align: center;
    font-size: 13px;
}

.dashboard-footer {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin: 31px 0 0;
    padding: 18px 0 24px;
    border-top: 1px solid #e4e9f0;
    color: #8390a0;
    font-size: 10px;
}

.dashboard-footer span:last-child {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.dashboard-footer i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--amazonas-green);
}

[hidden] {
    display: none !important;
}

@media (max-width: 820px) {
    .login-layout {
        grid-template-columns: 1fr;
        gap: 24px;
        max-width: 520px;
        padding-top: 45px;
        padding-bottom: 60px;
    }

    .login-brand {
        min-height: 280px;
        padding: 34px;
    }

    .login-crest {
        width: 65px;
        height: 75px;
        margin-bottom: 20px;
    }

    .brand-copy h1 {
        font-size: 36px;
    }

    .login-panel {
        padding: 10px 3px 25px;
    }

    .login-footer {
        bottom: 22px;
    }

    .system-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .welcome-seal {
        width: 94px;
        height: 94px;
        margin-right: 20px;
    }
}

@media (max-width: 560px) {
    .site-header {
        min-height: 70px;
        padding: 8px 18px;
    }

    .header-brand img {
        width: 36px;
        height: 48px;
    }

    .header-brand strong {
        font-size: 13px;
    }

    .header-brand small {
        font-size: 7px;
    }

    .header-actions {
        gap: 10px;
    }

    .user-badge {
        gap: 0;
    }

    .user-badge > span:last-child {
        display: none;
    }

    .button-logout {
        min-height: 33px;
        padding: 0 10px;
    }

    .dashboard-main {
        width: calc(100% - 32px);
    }

    .welcome-banner {
        min-height: 180px;
        margin: 22px 0 31px;
        padding: 27px 23px;
        border-radius: 13px;
    }

    .welcome-content h1 {
        max-width: 280px;
        font-size: 27px;
    }

    .welcome-content p {
        max-width: 270px;
        font-size: 12px;
        line-height: 1.5;
    }

    .welcome-seal {
        position: absolute;
        right: -35px;
        bottom: -38px;
        opacity: .48;
    }

    .section-title-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
    }

    .search-box {
        width: 100%;
    }

    .system-grid {
        grid-template-columns: 1fr;
        gap: 11px;
    }

    .system-card {
        min-height: 130px;
    }

    .dashboard-footer {
        flex-direction: column;
        gap: 8px;
    }

    .login-layout {
        width: calc(100% - 32px);
        gap: 17px;
        padding-top: 32px;
    }

    .login-brand {
        min-height: 246px;
        padding: 25px;
        border-radius: 20px;
    }

    .brand-copy h1 {
        max-width: 290px;
        font-size: 32px;
    }

    .brand-copy p {
        max-width: 255px;
        font-size: 13px;
    }

    .login-heading h2 {
        font-size: 28px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}

/* Administração */
a.button-logout {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.admin-main {
    padding: 28px 0 48px;
}

.admin-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.admin-tabs a {
    padding: 9px 16px;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--ink);
    background: var(--surface);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.admin-tabs a[aria-current="page"] {
    border-color: var(--amazonas-blue);
    color: #fff;
    background: var(--amazonas-blue);
}

.admin-card {
    margin-bottom: 20px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
}

.admin-card h2 {
    margin: 0 0 14px;
    font-size: 18px;
}

.admin-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
    align-items: end;
}

.admin-form label {
    display: grid;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
}

.admin-form input:not([type="checkbox"]),
.admin-form select {
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.admin-form label.check {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
}

.admin-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.admin-actions .button-primary {
    min-height: 42px;
}

.admin-link {
    color: var(--amazonas-blue-light);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.admin-link:hover {
    text-decoration: underline;
}

.table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.admin-table th,
.admin-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    white-space: nowrap;
}

.admin-table th {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
}

.admin-table .ua {
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-table .row-actions {
    display: flex;
    gap: 12px;
}

.empty-cell {
    color: var(--muted);
    text-align: center !important;
}

.badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 700;
}

.badge-ok {
    color: #2c6a0f;
    background: #e8f5dc;
}

.badge-off {
    color: #9d2929;
    background: #fff0f0;
}

.alert-success {
    border: 1px solid #c5e3ae;
    color: #2c6a0f;
    background: #f1fae9;
}

.admin-filter {
    margin-bottom: 12px;
}

.admin-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-top: 16px;
    font-size: 12px;
}

/* Personalização do painel */
.block-list {
    display: grid;
    gap: 12px;
    margin: 0 0 18px;
    padding: 0;
    list-style: none;
}

.block-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--page);
}

.block-move {
    display: grid;
    gap: 6px;
}

.icon-button {
    width: 32px;
    height: 32px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--amazonas-blue);
    background: var(--surface);
    font-weight: 700;
    cursor: pointer;
}

.icon-button:hover {
    background: #eef4fc;
}

.block-fields {
    flex: 1;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.block-fields input[readonly] {
    color: var(--muted);
    background: #eef1f6;
}

.block-flags {
    display: flex;
    gap: 18px;
}

.button-danger {
    color: #9d2929;
    border-color: #f2c7c7;
    background: #fff0f0;
}

.button-danger:hover {
    color: #fff;
    background: #9d2929;
}
