:root {
    --blue: #0b5cad;
    --blue-dark: #083f82;
    --green: #1faa7a;
    --yellow: #f5b842;
    --red: #d94645;
    --ink: #132236;
    --muted: #667085;
    --line: #d9e2ec;
    --surface: #ffffff;
    --surface-soft: #f4f8fb;
    --shadow: 0 14px 34px rgba(19, 34, 54, 0.12);
    --radius: 8px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    -webkit-text-size-adjust: 100%;
    touch-action: manipulation;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--surface-soft);
    letter-spacing: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
    letter-spacing: 0;
}

button {
    cursor: pointer;
}

.icon {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
}

.flash {
    position: relative;
    z-index: 50;
    margin: 12px;
    padding: 12px 14px;
    border-radius: var(--radius);
    font-weight: 800;
    line-height: 1.35;
}

.flash-success {
    color: #0d5d44;
    border: 1px solid #a9e6cc;
    background: #dff8ed;
}

.flash-error {
    color: #8a1f1f;
    border: 1px solid #f0b9b9;
    background: #fff0f0;
}

.citizen-body {
    display: flex;
    justify-content: center;
    min-height: 100vh;
    background:
        linear-gradient(180deg, #eff6fb 0%, #f7fafc 48%, #eef7f2 100%);
}

.app-shell {
    width: min(100%, 540px);
    min-height: 100vh;
    padding-bottom: 96px;
    background: var(--surface-soft);
}

.app-hero {
    position: relative;
    display: grid;
    min-height: var(--header-height, 300px);
    padding: max(20px, env(safe-area-inset-top)) 24px 28px;
    place-items: center;
    color: white;
    background: var(--hero-bg);
    overflow: hidden;
}

.app-hero::after {
    position: absolute;
    inset: auto 0 0 0;
    height: 76px;
    content: "";
    background-image: url("../img/banner-cidade.svg");
    background-size: cover;
    background-position: bottom center;
    opacity: 0.26;
}

.notification-trigger {
    position: absolute;
    top: max(16px, env(safe-area-inset-top));
    right: 16px;
    z-index: 2;
}

.icon-button {
    display: inline-grid;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    place-items: center;
    color: inherit;
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(10px);
}

.notification-dot {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 9px;
    height: 9px;
    border: 2px solid white;
    border-radius: 50%;
    background: var(--yellow);
}

.brand-lockup {
    position: relative;
    z-index: 1;
    display: grid;
    justify-items: center;
    gap: 12px;
    text-align: center;
}

.brand-emblem {
    display: grid;
    width: 82px;
    height: 82px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    place-items: center;
    background: rgba(255, 255, 255, 0.18);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.14);
}

.brand-emblem .icon {
    width: 40px;
    height: 40px;
}

.brand-emblem img {
    max-width: 70%;
    max-height: 70%;
}

.brand-lockup h1,
.simple-top h1,
.admin-header h1 {
    margin: 0;
    font-size: clamp(2rem, 9vw, 3.1rem);
    line-height: 1;
    font-weight: 850;
}

.brand-lockup p,
.simple-top p,
.admin-header p {
    max-width: 34rem;
    margin: 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 1rem;
    line-height: 1.45;
}

.home-section {
    padding: 18px;
}

.quick-actions {
    margin-top: -22px;
}

.quick-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.service-card {
    display: grid;
    min-height: 104px;
    padding: 12px 8px;
    border-radius: var(--radius);
    align-content: center;
    justify-items: center;
    gap: 10px;
    color: white;
    text-align: center;
    background: var(--card-color);
    background: linear-gradient(160deg, var(--card-color), color-mix(in srgb, var(--card-color), #000 18%));
    box-shadow: var(--shadow);
}

.service-card span:last-child {
    min-height: 34px;
    display: grid;
    align-items: center;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.service-icon {
    display: grid;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    place-items: center;
    background: rgba(255, 255, 255, 0.2);
}

.wide-action,
.primary-button,
.secondary-action {
    display: inline-flex;
    min-height: 52px;
    border: 0;
    border-radius: var(--radius);
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 800;
}

.wide-action {
    width: 100%;
    margin-top: 12px;
    padding: 0 16px;
    color: white;
    background: #132236;
    box-shadow: var(--shadow);
}

.wide-action .icon:last-child {
    margin-left: auto;
}

.banner-strip {
    padding-top: 0;
}

.city-banner {
    position: relative;
    display: block;
    height: 100px;
    border-radius: var(--radius);
    overflow: hidden;
    color: white;
    background: #0b5cad;
    box-shadow: var(--shadow);
}

.city-banner img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.city-banner span {
    position: absolute;
    left: 16px;
    bottom: 14px;
    z-index: 1;
    font-size: 1.05rem;
    font-weight: 850;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.22);
}

.city-pulse {
    display: flex;
    margin: 0 18px 10px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--surface);
}

.city-pulse h2,
.status-list h2 {
    margin: 0 0 6px;
    font-size: 1.15rem;
    line-height: 1.2;
}

.city-pulse p {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.4;
}

.secondary-action {
    flex: 0 0 auto;
    padding: 0 14px;
    color: var(--blue);
    background: #e8f2ff;
}

.status-list {
    display: grid;
    gap: 10px;
}

.status-row {
    display: grid;
    grid-template-columns: 42px 1fr 24px;
    min-height: 70px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    align-items: center;
    gap: 12px;
    background: var(--surface);
}

.status-row > span:first-child {
    display: grid;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    place-items: center;
    color: var(--blue);
    background: #e8f2ff;
}

.status-row strong {
    display: block;
    margin-bottom: 2px;
    font-size: 0.98rem;
}

.status-row small {
    color: var(--muted);
    line-height: 1.35;
}

.bottom-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    max-width: 540px;
    min-height: 72px;
    margin: 0 auto;
    padding: 8px 10px max(8px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -16px 30px rgba(19, 34, 54, 0.08);
    backdrop-filter: blur(16px);
}

.bottom-nav a {
    display: grid;
    min-width: 0;
    border-radius: var(--radius);
    place-items: center;
    gap: 3px;
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
}

.bottom-nav a.is-active {
    color: var(--blue);
    background: #e8f2ff;
}

.bottom-nav .icon {
    width: 21px;
    height: 21px;
}

.sheet,
.modal {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: none;
    align-items: flex-end;
    justify-content: center;
    padding: 18px;
    background: rgba(19, 34, 54, 0.38);
}

.sheet.is-open,
.modal.is-open {
    display: flex;
}

.sheet-panel,
.modal-panel {
    width: min(100%, 520px);
    max-height: 82vh;
    overflow: auto;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.sheet-header {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 16px;
    border-bottom: 1px solid var(--line);
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
}

.sheet-header h2 {
    margin: 0;
    font-size: 1.15rem;
}

.sheet-header .icon-button {
    color: var(--ink);
    border-color: var(--line);
    background: var(--surface-soft);
}

.function-list,
.notification-list {
    display: grid;
    gap: 8px;
    padding: 12px;
}

.function-list a {
    display: grid;
    grid-template-columns: 42px 1fr 24px;
    min-height: 58px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    align-items: center;
    gap: 12px;
}

.function-list a > span:first-child {
    display: grid;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    place-items: center;
    color: white;
    background: var(--card-color);
}

.notification-item,
.notification-card,
.detail-panel,
.form-panel,
.content-page,
.admin-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 10px 24px rgba(19, 34, 54, 0.06);
}

.notification-item {
    padding: 14px;
}

.notification-item p,
.notification-card p,
.content-page p {
    color: var(--muted);
    line-height: 1.5;
}

.simple-top {
    display: grid;
    gap: 10px;
    padding: max(24px, env(safe-area-inset-top)) 18px 18px;
    color: white;
    background: linear-gradient(145deg, var(--blue) 0%, #0f7d79 62%, var(--green) 100%);
}

.simple-top h1 {
    font-size: clamp(2rem, 8vw, 2.7rem);
}

.back-link {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    font-weight: 800;
}

.form-panel,
.detail-panel,
.content-page {
    display: grid;
    gap: 14px;
    margin: 18px;
    padding: 16px;
}

.form-panel label,
.admin-form label {
    display: grid;
    gap: 7px;
    color: var(--ink);
    font-size: 0.86rem;
    font-weight: 800;
}

.form-panel input,
.form-panel select,
.form-panel textarea,
.admin-form input,
.admin-form select,
.admin-form textarea {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    background: white;
    outline: none;
}

.form-panel textarea,
.admin-form textarea {
    resize: vertical;
}

.form-panel input:focus,
.form-panel select:focus,
.form-panel textarea:focus,
.admin-form input:focus,
.admin-form textarea:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(11, 92, 173, 0.14);
}

.primary-button {
    width: 100%;
    padding: 0 18px;
    color: white;
    background: var(--blue);
}

.ghost-button {
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: var(--radius);
    color: white;
    background: rgba(255, 255, 255, 0.14);
    font-weight: 800;
}

.inline-action {
    display: block;
    color: var(--blue);
    text-align: center;
    font-weight: 800;
}

.grid-form,
.two-cols {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-form .primary-button {
    grid-column: 1 / -1;
}

.profile-top {
    place-items: center;
    text-align: center;
}

.avatar-ring {
    display: grid;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    place-items: center;
    background: rgba(255, 255, 255, 0.18);
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 18px;
}

.metric-tile {
    display: grid;
    min-height: 86px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    place-items: center;
    background: white;
}

.metric-tile strong {
    font-size: 1.45rem;
    color: var(--blue);
}

.metric-tile span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.status-badge {
    width: fit-content;
    padding: 8px 10px;
    border-radius: var(--radius);
    color: #0d5d44;
    background: #dff8ed;
    font-weight: 850;
}

.detail-panel dl {
    display: grid;
    gap: 12px;
    margin: 0;
}

.detail-panel dt {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.detail-panel dd {
    margin: 3px 0 0;
    line-height: 1.45;
}

.notification-page-list {
    display: grid;
    gap: 12px;
    padding: 18px;
}

.notification-card {
    display: grid;
    gap: 8px;
    padding: 14px;
}

.notification-card a {
    color: var(--blue);
    font-weight: 800;
}

.chat-top {
    padding-bottom: 14px;
}

.agent-strip {
    display: flex;
    gap: 8px;
    padding: 12px 18px 0;
    overflow-x: auto;
}

.agent-chip {
    display: inline-flex;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    align-items: center;
    gap: 8px;
    color: var(--blue);
    background: white;
    white-space: nowrap;
    font-size: 0.84rem;
    font-weight: 850;
}

.agent-chip.is-active {
    color: white;
    background: var(--blue);
}

.chat-panel {
    display: grid;
    grid-template-rows: 1fr auto;
    min-height: 520px;
    margin: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: white;
    overflow: hidden;
}

.chat-stream {
    display: grid;
    align-content: end;
    gap: 10px;
    padding: 14px;
    overflow: auto;
}

.chat-message {
    max-width: 82%;
    padding: 12px;
    border-radius: var(--radius);
    line-height: 1.45;
}

.chat-message p {
    margin: 4px 0 0;
}

.chat-message.assistant {
    justify-self: start;
    color: var(--ink);
    background: #eef6ff;
}

.chat-message.user {
    justify-self: end;
    color: white;
    background: var(--blue);
}

.chat-form {
    display: grid;
    grid-template-columns: 1fr 52px;
    border-top: 1px solid var(--line);
}

.chat-form input {
    min-width: 0;
    min-height: 58px;
    padding: 0 14px;
    border: 0;
    outline: none;
}

.chat-form button {
    border: 0;
    color: white;
    background: var(--green);
}

.content-page {
    line-height: 1.55;
}

.content-page img {
    width: 100%;
    border-radius: var(--radius);
}

.admin-body {
    min-height: 100vh;
    background: #edf3f8;
}

.admin-shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

.admin-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 18px;
    color: white;
    background: #102b46;
}

.admin-brand {
    display: flex;
    min-height: 52px;
    align-items: center;
    gap: 10px;
    font-weight: 850;
}

.admin-session {
    display: grid;
    gap: 8px;
    margin-top: 12px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.08);
}

.admin-session strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-session button {
    min-height: 34px;
    width: 100%;
    border: 0;
    border-radius: var(--radius);
    color: #102b46;
    background: white;
    font-weight: 850;
}

.admin-brand-mark {
    display: grid;
    width: 38px;
    height: 38px;
    border-radius: var(--radius);
    place-items: center;
    color: #102b46;
    background: var(--yellow);
}

.admin-nav {
    display: grid;
    gap: 5px;
    margin-top: 18px;
}

.admin-nav a {
    display: flex;
    min-height: 42px;
    padding: 0 10px;
    border-radius: var(--radius);
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.9rem;
    font-weight: 750;
}

.admin-nav a.is-active,
.admin-nav a:hover {
    color: white;
    background: rgba(255, 255, 255, 0.12);
}

.admin-main {
    min-width: 0;
    padding: 28px;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.admin-header h1 {
    color: var(--ink);
    font-size: clamp(2rem, 5vw, 3rem);
}

.admin-header p {
    margin-top: 6px;
    color: var(--muted);
}

.admin-alert {
    display: grid;
    gap: 4px;
    margin-bottom: 18px;
    padding: 14px;
    border: 1px solid #f1cc74;
    border-radius: var(--radius);
    background: #fff6df;
}

.admin-stats,
.admin-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.admin-stats article,
.admin-module-card,
.admin-row-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: white;
}

.admin-stats article {
    display: grid;
    min-height: 102px;
    padding: 16px;
    align-content: center;
}

.admin-stats strong {
    color: var(--blue);
    font-size: 2rem;
    line-height: 1;
}

.admin-stats span {
    margin-top: 8px;
    color: var(--muted);
    font-weight: 800;
}

.admin-grid {
    margin-top: 18px;
}

.admin-grid.compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-module-card {
    display: grid;
    min-height: 112px;
    padding: 16px;
    align-content: space-between;
    color: var(--ink);
}

.admin-module-card .icon {
    color: var(--card-color, var(--blue));
}

.admin-card {
    display: grid;
    gap: 16px;
    padding: 18px;
}

.admin-card.narrow {
    max-width: 420px;
    margin: 10vh auto;
}

.admin-card h1,
.admin-card h2 {
    margin: 0;
}

.admin-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.admin-form .full-field,
.admin-form .check-line {
    grid-column: 1 / -1;
}

.check-line {
    display: inline-flex !important;
    min-height: 42px;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.check-line input {
    width: 18px;
    min-height: 18px;
}

.inline-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.inline-form select {
    min-height: 36px;
    min-width: 110px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.inline-form button {
    min-height: 36px;
    border: 0;
    border-radius: var(--radius);
    color: white;
    background: var(--blue);
    font-weight: 800;
}

.admin-form .primary-button {
    grid-column: 1 / -1;
}

.admin-table {
    display: grid;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.admin-table > div {
    display: grid;
    grid-template-columns: 1.2fr 1fr 0.6fr;
    min-height: 48px;
    padding: 10px 12px;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--line);
    background: white;
}

.admin-table > div:last-child {
    border-bottom: 0;
}

.admin-table span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-row-card {
    display: grid;
    gap: 4px;
    padding: 12px;
}

.admin-row-card span {
    color: var(--muted);
}

.admin-card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.admin-card-heading > div {
    display: grid;
    gap: 5px;
}

.admin-card-heading span {
    width: fit-content;
    padding: 5px 8px;
    border-radius: var(--radius);
    color: #0d5d44;
    background: #dff8ed;
    font-size: 0.74rem;
    font-weight: 900;
    text-transform: uppercase;
}

.admin-card-heading p {
    margin: 0;
    color: var(--muted);
    line-height: 1.4;
}

.admin-card-heading > strong {
    flex: 0 0 auto;
    padding: 8px 10px;
    border-radius: var(--radius);
    color: var(--blue);
    background: #e8f2ff;
    font-size: 0.86rem;
}

.admin-protocol-panel {
    box-shadow: 0 14px 30px rgba(19, 34, 54, 0.07);
}

.admin-protocol-tabs {
    display: grid;
    gap: 16px;
}

.admin-tab-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.admin-tab-list {
    display: inline-grid;
    width: fit-content;
    max-width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: white;
    box-shadow: 0 10px 24px rgba(19, 34, 54, 0.06);
}

.admin-tab-list label {
    display: inline-flex;
    min-height: 44px;
    padding: 0 14px;
    border-radius: calc(var(--radius) - 2px);
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--muted);
    cursor: pointer;
    font-weight: 900;
    white-space: nowrap;
}

.admin-tab-list span {
    display: inline-grid;
    min-width: 26px;
    min-height: 24px;
    padding: 0 7px;
    border-radius: 999px;
    place-items: center;
    color: var(--blue);
    background: #e8f2ff;
    font-size: 0.78rem;
}

.admin-tab-panel {
    display: none;
}

#admin-protocol-tab-queue:checked ~ .admin-tab-list label[for="admin-protocol-tab-queue"],
#admin-protocol-tab-categories:checked ~ .admin-tab-list label[for="admin-protocol-tab-categories"] {
    color: white;
    background: var(--blue);
}

#admin-protocol-tab-queue:checked ~ .admin-tab-list label[for="admin-protocol-tab-queue"] span,
#admin-protocol-tab-categories:checked ~ .admin-tab-list label[for="admin-protocol-tab-categories"] span {
    color: white;
    background: rgba(255, 255, 255, 0.2);
}

#admin-protocol-tab-queue:checked ~ .admin-tab-panel-queue,
#admin-protocol-tab-categories:checked ~ .admin-tab-panel-categories {
    display: grid;
}

.admin-create-form {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #f8fbfd;
}

.admin-edit-row label,
.protocol-admin-card label {
    display: grid;
    gap: 6px;
    color: var(--ink);
    font-size: 0.82rem;
    font-weight: 850;
}

.admin-edit-row input,
.admin-edit-row select,
.admin-edit-row textarea,
.protocol-admin-card input,
.protocol-admin-card select,
.protocol-admin-card textarea {
    width: 100%;
    min-height: 42px;
    padding: 0 11px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    background: white;
    outline: none;
}

.admin-edit-row textarea,
.protocol-admin-card textarea {
    min-height: 92px;
    padding: 10px 11px;
    resize: vertical;
}

.admin-edit-row input:focus,
.admin-edit-row select:focus,
.admin-edit-row textarea:focus,
.protocol-admin-card input:focus,
.protocol-admin-card select:focus,
.protocol-admin-card textarea:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(11, 92, 173, 0.12);
}

.admin-edit-row .check-line input,
.protocol-admin-card .check-line input {
    width: 18px;
    min-height: 18px;
    padding: 0;
}

.category-admin-list {
    gap: 10px;
}

.category-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: end;
    box-shadow: 0 8px 18px rgba(19, 34, 54, 0.05);
}

.category-accordion-item .category-row {
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
}

.notification-admin-list,
.user-admin-list {
    gap: 10px;
}

.notification-accordion-item .notification-row,
.user-accordion-item .user-row {
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
}

.category-row .check-line {
    min-height: 42px;
}

.category-row .row-actions {
    grid-column: span 2;
    justify-content: flex-end;
}

.admin-empty-state {
    margin: 0;
    padding: 16px;
    border: 1px dashed #b8c8d9;
    border-radius: var(--radius);
    color: var(--muted);
    background: #f8fbfd;
}

.admin-accordion-item {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: white;
    overflow: hidden;
}

.admin-accordion-item > summary {
    display: flex;
    min-height: 68px;
    padding: 14px 16px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    cursor: pointer;
    list-style: none;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%);
}

.admin-accordion-item > summary::-webkit-details-marker {
    display: none;
}

.admin-accordion-item > summary::after {
    content: "+";
    display: grid;
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    border-radius: 50%;
    place-items: center;
    color: var(--blue);
    background: #e8f2ff;
    font-weight: 900;
}

.admin-accordion-item[open] > summary::after {
    content: "−";
}

.accordion-title {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.accordion-title strong,
.protocol-accordion-summary strong {
    color: var(--ink);
    font-size: 1rem;
    line-height: 1.2;
}

.accordion-title small,
.protocol-accordion-summary small {
    color: var(--muted);
    line-height: 1.35;
}

.accordion-action {
    margin-left: auto;
    padding: 7px 9px;
    border-radius: var(--radius);
    color: var(--blue);
    background: #e8f2ff;
    font-size: 0.8rem;
    font-weight: 900;
}

.form-result {
    min-height: 22px;
    margin: 0;
    color: var(--blue);
    font-weight: 800;
}

.protocol-page {
    min-height: 100vh;
    background: linear-gradient(180deg, #f5f9fc 0%, #eef7f2 100%);
}

.protocol-top {
    display: grid;
    gap: 8px;
    padding: max(18px, env(safe-area-inset-top)) 18px 20px;
    color: white;
    background: linear-gradient(145deg, #0b5cad 0%, #0f7d79 62%, #1faa7a 100%);
}

.protocol-home-link {
    width: fit-content;
    margin-bottom: 4px;
}

.protocol-eyebrow,
.protocol-step-heading span,
.wizard-heading > span {
    width: fit-content;
    padding: 5px 8px;
    border-radius: var(--radius);
    color: #0d5d44;
    background: #dff8ed;
    font-size: 0.74rem;
    font-weight: 900;
    text-transform: uppercase;
}

.protocol-top .protocol-eyebrow {
    color: white;
    background: rgba(255, 255, 255, 0.17);
}

.protocol-top h1 {
    margin: 0;
    font-size: 2.1rem;
    line-height: 1;
}

.protocol-top p,
.protocol-step-heading p,
.wizard-heading p {
    margin: 0;
    line-height: 1.45;
}

.protocol-top p {
    max-width: 38rem;
    color: rgba(255, 255, 255, 0.88);
}

.protocol-wizard {
    display: grid;
    gap: 16px;
    padding: 16px;
}

.wizard-step {
    display: none;
}

.wizard-step.is-active {
    display: grid;
    gap: 14px;
}

.protocol-step-heading,
.wizard-heading {
    display: grid;
    gap: 7px;
}

.protocol-step-heading h2,
.wizard-heading h2 {
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.15;
}

.protocol-step-heading p,
.wizard-heading p {
    color: var(--muted);
    font-size: 0.93rem;
}

.category-card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.category-card {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 22px;
    min-height: 82px;
    padding: 12px;
    border: 1px solid var(--line);
    border-left: 5px solid var(--card-color);
    border-radius: var(--radius);
    align-items: center;
    gap: 12px;
    color: var(--ink);
    text-align: left;
    background: white;
    box-shadow: 0 10px 24px rgba(19, 34, 54, 0.08);
}

.category-card:hover,
.category-card.is-selected {
    border-color: var(--card-color);
    box-shadow: 0 16px 30px rgba(19, 34, 54, 0.12);
    transform: translateY(-1px);
}

.category-card-icon {
    display: grid;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    place-items: center;
    color: white;
    background: var(--card-color);
}

.category-card-copy {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.category-card strong {
    color: var(--ink);
    font-size: 0.98rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.category-card small {
    color: var(--muted);
    line-height: 1.25;
}

.category-card-arrow {
    width: 20px;
    height: 20px;
    color: var(--card-color);
}

.protocol-back-button {
    display: inline-flex;
    width: fit-content;
    min-height: 40px;
    padding: 0 12px;
    border: 0;
    border-radius: var(--radius);
    align-items: center;
    gap: 8px;
    color: var(--blue);
    background: #e8f2ff;
    font-weight: 850;
}

.protocol-back-button .icon {
    width: 18px;
    height: 18px;
    transform: rotate(180deg);
}

.protocol-details-grid {
    display: grid;
    gap: 14px;
}

.map-panel {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: white;
    box-shadow: 0 10px 24px rgba(19, 34, 54, 0.08);
}

.map-panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.map-panel-heading strong,
.map-panel-heading small {
    display: block;
}

.map-panel-heading small {
    margin-top: 2px;
    color: var(--muted);
}

.map-panel-heading .icon {
    color: var(--green);
}

.protocol-map {
    width: 100%;
    min-height: 280px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: #dce8f1;
}

.map-locate,
.full-action {
    width: 100%;
}

.protocol-details-form {
    margin: 0;
    padding: 14px;
}

.file-drop {
    padding: 12px;
    border: 1px dashed #b8c8d9;
    border-radius: var(--radius);
    background: #f8fbfd;
}

.file-drop span {
    color: var(--muted);
    font-size: 0.84rem;
}

.protocol-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.protocol-section-heading span {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 850;
}

.protocol-history {
    padding-top: 4px;
}

.protocol-empty {
    margin: 0;
    padding: 14px;
    border: 1px dashed #b8c8d9;
    border-radius: var(--radius);
    color: var(--muted);
    background: rgba(255, 255, 255, 0.74);
}

.attachment-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.attachment-list a {
    display: inline-flex;
    min-height: 34px;
    padding: 0 10px;
    border-radius: var(--radius);
    align-items: center;
    color: var(--blue);
    background: #e8f2ff;
    font-size: 0.82rem;
    font-weight: 850;
}

.citizen-map-actions {
    justify-content: flex-start;
}

@media (min-width: 780px) {
    .app-shell:has(.protocol-page) {
        width: min(100%, 920px);
    }

    body:has(.protocol-page) .bottom-nav {
        max-width: 920px;
    }

    .category-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .protocol-details-grid {
        grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
        align-items: start;
    }

    .protocol-map {
        min-height: 360px;
    }
}

.admin-muted {
    margin: 0;
    color: var(--muted);
}

.admin-editor-list,
.protocol-admin-list {
    display: grid;
    gap: 12px;
}

.admin-edit-row,
.protocol-admin-card {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: white;
}

.admin-edit-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-edit-row > strong {
    display: flex;
    align-items: center;
}

.notification-row,
.user-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card-row {
    grid-template-columns: 1fr repeat(4, minmax(0, 180px));
}

.protocol-admin-card {
    grid-template-columns: 1fr;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(19, 34, 54, 0.07);
}

.protocol-accordion-summary > div {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.protocol-accordion-body {
    display: grid;
    gap: 12px;
    padding: 14px;
    border-top: 1px solid var(--line);
    background: white;
}

.protocol-lock-note {
    display: flex;
    padding: 10px 12px;
    border: 1px solid #d7e8ff;
    border-radius: var(--radius);
    align-items: center;
    gap: 9px;
    color: #164b7d;
    background: #f0f7ff;
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1.35;
}

.protocol-lock-note .icon {
    width: 19px;
    height: 19px;
}

.status-pill {
    display: inline-grid;
    min-height: 32px;
    padding: 0 10px;
    border-radius: 999px;
    place-items: center;
    color: #164b7d;
    background: #e8f2ff;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.status-analise {
    color: #7a4a00;
    background: #fff4d8;
}

.status-execucao {
    color: #0f5a45;
    background: #dff8ed;
}

.status-concluido {
    color: #0d5d44;
    background: #cef3df;
}

.status-cancelado {
    color: #8a1f1f;
    background: #fff0f0;
}

.protocol-admin-card > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%);
}

.protocol-admin-card > header strong {
    display: block;
    font-size: 1.05rem;
}

.protocol-admin-card > header span {
    color: var(--muted);
}

.protocol-edit-form {
    margin: 0;
    padding: 0;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.protocol-edit-form input[readonly],
.protocol-edit-form textarea[readonly],
.protocol-edit-form select:disabled {
    color: #5f6f82;
    border-color: #d7e0ea;
    background: #f3f6f9;
    cursor: not-allowed;
}

.protocol-map-actions {
    justify-content: flex-start;
}

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

.map-actions a {
    display: inline-flex;
    min-height: 36px;
    padding: 0 10px;
    border-radius: var(--radius);
    align-items: center;
    gap: 7px;
    color: var(--blue);
    background: #e8f2ff;
    font-size: 0.84rem;
    font-weight: 850;
}

.map-actions .icon {
    width: 17px;
    height: 17px;
}

.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: end;
}

.row-actions button {
    min-height: 40px;
    padding: 0 12px;
    border: 0;
    border-radius: var(--radius);
    color: white;
    background: var(--blue);
    font-weight: 850;
}

.row-actions button[formaction*="block"],
.row-actions button[value="cancelado"] {
    background: #b7791f;
}

.row-actions button[formaction*="delete"] {
    background: #b42318;
}

@media (max-width: 760px) {
    .admin-shell {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: static;
        height: auto;
        padding: 12px;
    }

    .admin-nav {
        grid-auto-flow: column;
        grid-auto-columns: max-content;
        overflow-x: auto;
    }

    .admin-main {
        padding: 18px;
    }

    .admin-card-heading {
        display: grid;
    }

    .admin-tab-list {
        width: 100%;
    }

    .admin-stats,
    .admin-grid,
    .admin-grid.compact,
    .admin-form,
    .protocol-edit-form,
    .admin-edit-row,
    .notification-row,
    .category-row,
    .user-row,
    .card-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .quick-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .service-card {
        min-height: 96px;
        padding: 10px 5px;
    }

    .service-icon {
        width: 38px;
        height: 38px;
    }

    .service-card span:last-child {
        font-size: 0.74rem;
    }

    .city-pulse {
        align-items: stretch;
        flex-direction: column;
    }

    .grid-form,
    .two-cols,
    .admin-stats,
    .admin-grid,
    .admin-grid.compact,
    .admin-form,
    .protocol-edit-form,
    .admin-edit-row,
    .notification-row,
    .category-row,
    .user-row,
    .card-row,
    .category-card-grid {
        grid-template-columns: 1fr;
    }

    .category-row .row-actions,
    .protocol-edit-form .full-field {
        grid-column: 1 / -1;
    }

    .admin-tab-list {
        grid-template-columns: 1fr;
    }

    .admin-accordion-item > summary,
    .protocol-accordion-summary {
        align-items: flex-start;
    }

    .admin-table > div {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}

/* Citizen visual refresh */
.citizen-body {
    background:
        linear-gradient(180deg, #eaf3fb 0%, #f7fafc 42%, #eef8f2 100%);
}

.citizen-body .app-shell {
    position: relative;
    background: #f7fafc;
}

.citizen-body .app-shell::before {
    position: fixed;
    inset: 0 auto 0 50%;
    width: min(100%, 540px);
    content: "";
    transform: translateX(-50%);
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0)),
        repeating-linear-gradient(135deg, rgba(11, 92, 173, 0.035) 0 1px, transparent 1px 18px);
}

.app-hero {
    min-height: min(var(--header-height, 300px), 330px);
    padding: max(22px, env(safe-area-inset-top)) 22px 34px;
    align-items: end;
    justify-items: center;
    border-bottom-right-radius: 26px;
    border-bottom-left-radius: 26px;
    box-shadow: 0 18px 42px rgba(8, 63, 130, 0.18);
}

.app-hero::after {
    height: 96px;
    opacity: 0.18;
}

.brand-lockup {
    max-width: 440px;
    gap: 10px;
    animation: appFadeUp 360ms ease both;
}

.brand-emblem,
.avatar-ring {
    width: 72px;
    height: 72px;
    border-radius: var(--radius);
}

.hero-kicker,
.page-kicker {
    display: inline-flex;
    width: fit-content;
    min-height: 28px;
    padding: 0 9px;
    border-radius: var(--radius);
    align-items: center;
    justify-content: center;
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
}

.hero-kicker {
    color: white;
    background: rgba(255, 255, 255, 0.18);
}

.page-kicker {
    color: white;
    background: rgba(255, 255, 255, 0.16);
}

.brand-lockup h1,
.simple-top h1 {
    font-size: 2.25rem;
    line-height: 1.02;
}

.brand-lockup p,
.simple-top p {
    font-size: 0.98rem;
}

.citizen-home-stack {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 14px;
    padding: 16px;
}

.citizen-home-stack .home-section,
.profile-grid,
.notification-page-list,
.agent-strip {
    padding-right: 0;
    padding-left: 0;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.section-heading div {
    display: grid;
    gap: 3px;
}

.section-heading span,
.city-pulse > div > span {
    color: var(--green);
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
}

.section-heading h2,
.city-pulse h2,
.status-list h2 {
    margin: 0;
    color: var(--ink);
    font-size: 1.16rem;
    line-height: 1.18;
}

.mini-action {
    display: inline-flex;
    min-height: 36px;
    padding: 0 10px;
    border: 1px solid #cfe0f3;
    border-radius: var(--radius);
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: var(--blue);
    background: white;
    font-size: 0.82rem;
    font-weight: 900;
}

.quick-actions {
    margin-top: -36px;
}

.quick-grid {
    gap: 12px;
}

.service-card,
.city-banner,
.city-pulse,
.status-row,
.metric-tile,
.notification-card,
.chat-panel,
.form-panel,
.detail-panel,
.content-page {
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}

.service-card {
    min-height: 112px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    box-shadow: 0 18px 34px rgba(19, 34, 54, 0.13);
}

.service-card:hover,
.city-banner:hover,
.status-row:hover,
.metric-tile:hover,
.notification-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 34px rgba(19, 34, 54, 0.13);
}

.service-icon {
    width: 44px;
    height: 44px;
}

.wide-action {
    display: none;
}

.banner-strip {
    display: grid;
    gap: 10px;
}

.city-banner {
    height: 118px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 16px 32px rgba(19, 34, 54, 0.1);
}

.city-banner::after {
    position: absolute;
    inset: 0;
    content: "";
    background: linear-gradient(180deg, rgba(19, 34, 54, 0.02), rgba(19, 34, 54, 0.46));
}

.city-banner span {
    z-index: 1;
}

.city-pulse {
    display: grid;
    grid-template-columns: 1fr auto;
    margin: 0;
    padding: 16px;
    border-color: #cfe0f3;
    box-shadow: 0 14px 28px rgba(19, 34, 54, 0.08);
}

.secondary-action {
    min-height: 44px;
    border: 1px solid #cfe0f3;
    border-radius: var(--radius);
    background: #eef6ff;
}

.status-row {
    min-height: 74px;
    border-color: #dbe7f3;
    box-shadow: 0 10px 22px rgba(19, 34, 54, 0.055);
}

.status-row > span:first-child {
    border-radius: var(--radius);
}

.simple-top {
    position: relative;
    gap: 9px;
    padding: max(22px, env(safe-area-inset-top)) 18px 22px;
    border-bottom-right-radius: 22px;
    border-bottom-left-radius: 22px;
    box-shadow: 0 16px 34px rgba(8, 63, 130, 0.15);
}

.simple-top .back-link {
    margin-bottom: 2px;
}

.profile-top {
    place-items: center;
}

.profile-grid {
    position: relative;
    z-index: 1;
    gap: 12px;
    padding: 16px;
}

.metric-tile {
    min-height: 92px;
    box-shadow: 0 12px 24px rgba(19, 34, 54, 0.07);
}

.profile-history {
    padding-top: 0;
}

.notification-page-list {
    position: relative;
    z-index: 1;
    padding: 16px;
}

.notification-card {
    gap: 10px;
    padding: 16px;
}

.notification-card > div {
    display: grid;
    gap: 4px;
}

.notification-card small {
    color: var(--muted);
}

.notification-card a {
    display: inline-flex;
    width: fit-content;
    min-height: 38px;
    padding: 0 10px;
    border-radius: var(--radius);
    align-items: center;
    gap: 7px;
    background: #e8f2ff;
}

.chat-top {
    padding-bottom: 18px;
}

.agent-strip {
    padding: 14px 16px 0;
}

.agent-chip {
    box-shadow: 0 8px 18px rgba(19, 34, 54, 0.06);
    transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.agent-chip:hover {
    transform: translateY(-1px);
}

.chat-panel {
    min-height: 500px;
    margin: 16px;
    box-shadow: 0 16px 34px rgba(19, 34, 54, 0.1);
}

.bottom-nav {
    border-color: rgba(217, 226, 236, 0.86);
    background: rgba(255, 255, 255, 0.92);
}

.bottom-nav a {
    transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.bottom-nav a:hover,
.bottom-nav a.is-active {
    transform: translateY(-1px);
}

.sheet,
.modal {
    backdrop-filter: blur(6px);
}

.sheet-panel,
.modal-panel {
    animation: sheetUp 220ms ease both;
}

@keyframes appFadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes sheetUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 520px) {
    .citizen-home-stack {
        gap: 12px;
        padding: 14px;
    }

    .brand-lockup h1,
    .simple-top h1 {
        font-size: 2rem;
    }

    .quick-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .service-card {
        min-height: 102px;
    }

    .city-pulse,
    .section-heading {
        align-items: stretch;
        grid-template-columns: 1fr;
    }

    .section-heading {
        display: grid;
    }

    .profile-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
