/* Identidade FACOPI: Montserrat local (SIL OFL 1.1, ver fonts/Montserrat-LICENSE.txt) */
@font-face {
    font-family: "Montserrat";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("./fonts/Montserrat-Regular.woff") format("woff");
}

@font-face {
    font-family: "Montserrat";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("./fonts/Montserrat-SemiBold.woff") format("woff");
}

@font-face {
    font-family: "Montserrat";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("./fonts/Montserrat-Bold.woff") format("woff");
}

/* Paleta FACOPI (tema claro): fundo #f4f8f5, superfícies brancas, texto grafite #1e2522,
   verde institucional #2c5236 em botões/links/foco e faixa da marca; verde vivo #29af4c só em detalhes. */
:root {
    color-scheme: light;
    --bg: #f4f8f5;
    --bg-soft: #eef4f0;
    --surface: #ffffff;
    --surface-raised: #f8fbf9;
    --surface-hover: #eef5f0;
    --surface-strong: #e3ede6;
    --ink: #1e2522;
    --ink-soft: #2f3a35;
    --muted: #5a6b62;
    --muted-strong: #46554d;
    --accent: #2c5236;
    --accent-bright: #1f3d28;
    --accent-deep: #2c5236;
    --accent-vivid: #29af4c;
    --accent-wash: rgba(44, 82, 54, .08);
    --brand-band: #2c5236;
    --line: #d6e2da;
    --line-strong: #b9cbbf;
    --field-border: #7f9688;
    --danger: #b42318;
    --warning: #8a5a00;
    --info: #1d5fa8;
    --success: #0f6b5c;
    /* Marcadores (barras, bordas, pontos): não são texto */
    --mark-low: #8d9b93;
    --mark-normal: #3b82c4;
    --mark-high: #e0a33a;
    --mark-critical: #c8372b;
    --mark-resolved: #2aa595;
    --shadow-sm: 0 1px 2px rgba(30, 37, 34, .06), 0 6px 18px rgba(30, 37, 34, .05);
    --shadow-lg: 0 24px 60px rgba(30, 37, 34, .18);
    --radius-sm: 9px;
    --radius-md: 14px;
    --radius-lg: 20px;
    font-family: Montserrat, "Segoe UI Variable", "Segoe UI", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--ink);
    background: var(--bg);
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

html { min-height: 100%; scroll-behavior: smooth; }

body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 16% -8%, rgba(41, 175, 76, .07), transparent 32rem),
        radial-gradient(circle at 90% 18%, rgba(44, 82, 54, .06), transparent 34rem),
        var(--bg);
    color: var(--ink);
    line-height: 1.5;
}

::selection { background: rgba(41, 175, 76, .25); color: var(--ink); }

button,
input,
select,
textarea { font: inherit; }

button,
a,
input,
select,
textarea,
summary { outline-offset: 3px; }

button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .58; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-bright); }

:focus-visible {
    outline: 2px solid var(--accent) !important;
    outline-offset: 3px;
}

/* Na faixa verde escura (cabeçalho e painel do login) o foco fica branco */
.topbar :focus-visible,
.intro :focus-visible { outline-color: #ffffff !important; }

h1,
h2,
h3,
p { overflow-wrap: anywhere; }

h1,
h2,
h3 { color: var(--ink); }

.workspace { min-height: 100vh; }

/* Marca e navegação */
.brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    width: max-content;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .14em;
    line-height: 1;
    text-decoration: none;
    text-transform: uppercase;
}

/* Logo oficial branca: só escala proporcional, sem recolorir, sombrear ou girar. */
.brand-logo {
    display: block;
    width: auto;
    height: 40px;
    flex: 0 0 auto;
}

.brand-name {
    padding-left: 14px;
    border-left: 1px solid rgba(255, 255, 255, .35);
    color: rgba(255, 255, 255, .88);
}

/* A marca sempre fica sobre a faixa verde escura (logo branca oficial) */
.brand:hover { color: #ffffff; }
.brand:hover .brand-name { color: #ffffff; }

/* Telas sem cabeçalho (erro): a marca ganha a própria faixa verde escura */
.workspace-main > .brand {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    background: var(--brand-band);
}

.topbar {
    min-height: 72px;
    padding: 15px max(24px, 5vw);
    border-bottom: 1px solid #1f3d28;
    background: var(--brand-band);
    box-shadow: 0 2px 12px rgba(30, 37, 34, .12);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-actions form { margin: 0; }

.user-chip {
    min-height: 38px;
    padding: 9px 14px;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 999px;
    background: rgba(255, 255, 255, .1);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
}

.topbar .secondary {
    border-color: rgba(255, 255, 255, .45);
    background: transparent;
    color: #ffffff;
}

.topbar .secondary:hover {
    border-color: #ffffff;
    background: rgba(255, 255, 255, .14);
    color: #ffffff;
}

.eyebrow {
    margin: 0;
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.muted,
.help,
.security-note { color: var(--muted); line-height: 1.65; }
.muted { font-size: 15px; }

/* Botões */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.primary,
.primary-link,
.action-primary,
.secondary {
    min-height: 44px;
    border-radius: var(--radius-sm);
    padding: 11px 17px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    transition: border-color .18s ease, background-color .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.primary,
.primary-link,
.action-primary {
    border: 1px solid transparent;
    background: var(--accent);
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(44, 82, 54, .18);
}

.primary:hover,
.primary-link:hover,
.action-primary:hover {
    background: var(--accent-bright);
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(44, 82, 54, .26);
    transform: translateY(-1px);
}

.primary:active,
.primary-link:active,
.action-primary:active,
.secondary:active { transform: translateY(0); }

.secondary {
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--ink-soft);
}

.secondary:hover {
    border-color: var(--field-border);
    background: var(--surface-strong);
    color: var(--ink);
    transform: translateY(-1px);
}

/* Login */
.login-layout {
    min-height: 100svh;
    display: grid;
    grid-template-columns: minmax(420px, 1.08fr) minmax(440px, .92fr);
}

.intro {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 100svh;
    padding: clamp(36px, 5vw, 76px) clamp(32px, 6.5vw, 112px);
    border-right: 1px solid #1f3d28;
    color: #ffffff;
    background:
        linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px),
        radial-gradient(circle at 72% 35%, rgba(41, 175, 76, .22), transparent 27rem),
        linear-gradient(145deg, #2c5236, #1d3a26 72%);
    background-size: 48px 48px, 48px 48px, auto, auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 64px;
}

.intro::after {
    position: absolute;
    z-index: -1;
    right: clamp(-110px, -8vw, -32px);
    bottom: clamp(40px, 10vh, 120px);
    width: clamp(280px, 38vw, 540px);
    aspect-ratio: 1;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 50%;
    box-shadow:
        0 0 0 52px rgba(255, 255, 255, .03),
        0 0 0 104px rgba(255, 255, 255, .02),
        inset 0 0 80px rgba(41, 175, 76, .08);
    content: "";
}

.intro > div { position: relative; max-width: 620px; }
.intro .eyebrow { color: #c4ebcf; }

.intro h1 {
    color: #ffffff;
    max-width: 650px;
    margin: 20px 0 28px;
    font-size: clamp(42px, 5.1vw, 78px);
    font-weight: 600;
    letter-spacing: -.035em;
    line-height: .98;
}

.intro > div > p:last-child {
    max-width: 490px;
    margin: 0;
    color: #dbe9df;
    font-size: 16px;
    line-height: 1.8;
}

.intro-foot {
    margin: 0;
    color: #c2d4c7;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.form-panel {
    min-height: 100svh;
    padding: 48px clamp(28px, 5vw, 86px);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-container { width: 100%; max-width: 430px; }

.form-container h2 {
    margin: 14px 0 8px;
    font-size: clamp(29px, 3vw, 38px);
    font-weight: 600;
    letter-spacing: -.025em;
    line-height: 1.15;
}

.form-container > .muted { margin: 0; }
.form-container form { margin-top: 34px; }

label {
    display: block;
    margin: 20px 0 8px;
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .01em;
}

input:not([type="hidden"]),
select,
textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--field-border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink);
    box-shadow: inset 0 1px 2px rgba(30, 37, 34, .04);
    transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}

input:not([type="hidden"]),
select { min-height: 50px; padding: 0 14px; }

textarea {
    min-height: 104px;
    padding: 13px 14px;
    line-height: 1.6;
    resize: vertical;
}

select { color-scheme: light; }

input::placeholder,
textarea::placeholder { color: #63746a; opacity: 1; }

input:not([type="hidden"]):hover,
select:hover,
textarea:hover { border-color: var(--muted-strong); }

input:not([type="hidden"]):focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    background: var(--surface);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(44, 82, 54, .22);
}

input[type="file"] {
    height: auto;
    min-height: 50px;
    padding: 7px;
    color: var(--muted-strong);
    font-size: 12px;
}

input[type="file"]::file-selector-button {
    height: 34px;
    margin-right: 12px;
    padding: 0 12px;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    background: var(--surface-strong);
    color: var(--ink-soft);
    cursor: pointer;
    font: inherit;
    font-weight: 600;
}

input[type="radio"] { accent-color: var(--accent); }

.password-field { position: relative; }
.password-field input { padding-right: 84px; }

.reveal {
    position: absolute;
    top: 7px;
    right: 7px;
    min-height: 36px;
    padding: 0 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
}

.reveal:hover { background: var(--accent-wash); color: var(--accent-bright); }

.form-container .primary {
    width: 100%;
    min-height: 50px;
    margin-top: 28px;
    justify-content: space-between;
    padding-inline: 17px;
}

.help { margin: 26px 0 0; font-size: 12px; }

.security-note {
    margin: 28px 0 0;
    padding: 22px 0 0 25px;
    border-top: 1px solid var(--line);
    position: relative;
    font-size: 11px;
}

.security-note::before {
    position: absolute;
    top: 22px;
    left: 0;
    color: var(--accent-vivid);
    content: "◇";
    font-size: 14px;
}

/* Feedback */
.notice,
.error,
.flash {
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    font-size: 13px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.notice {
    border: 1px solid #b5dcc0;
    background: #e8f4ec;
    color: #1f4a2c;
}

.error,
.flash-error {
    border: 1px solid #f2b8b2;
    background: #fdecea;
    color: #8f1d14;
}

.flash { margin: 0 0 24px; }

.flash-success {
    border: 1px solid #b5dcc0;
    background: #e8f4ec;
    color: #1f4a2c;
}

/* Estrutura da aplicação */
.app-shell,
.ticket-detail-shell {
    width: min(1220px, calc(100% - 48px));
    margin: 46px auto 84px;
}

.form-page {
    width: min(880px, calc(100% - 48px));
    margin: 46px auto 84px;
}

.workspace-main {
    width: min(980px, calc(100% - 48px));
    margin: 68px auto 84px;
}

.workspace-main h1,
.page-heading h1,
.ticket-title h1 {
    margin: 10px 0;
    font-size: clamp(34px, 4.6vw, 54px);
    font-weight: 600;
    letter-spacing: -.03em;
    line-height: 1.04;
}

.workspace-main > .muted,
.page-heading .muted,
.ticket-title .muted { margin: 0; }

.page-heading {
    margin-bottom: 30px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
}

.page-heading > div { min-width: 0; }
.compact-heading { align-items: flex-start; }

.identity-card,
.card,
.conversation,
.ticket-list {
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.identity-card,
.card { border-radius: var(--radius-md); padding: 25px 27px; }

.identity-card { margin: 32px 0; }
.identity-card h2 { margin: 0 0 22px; font-size: 17px; }

dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
dt { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
dd { margin: 7px 0 0; color: var(--ink-soft); font-size: 14px; overflow-wrap: anywhere; }
.notice p { margin-bottom: 0; }

/* Resumo */
.metric-grid {
    margin-bottom: 30px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.metric-grid article {
    position: relative;
    overflow: hidden;
    min-height: 104px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

.metric-grid article::before {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    background: var(--mark-normal);
    content: "";
}

.metric-grid article:nth-child(2)::before { background: var(--accent-vivid); }
.metric-grid article:nth-child(3)::before { background: var(--mark-high); }
.metric-grid article:nth-child(4)::before { background: var(--mark-resolved); }

.metric-grid span { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.metric-grid strong { font-size: 32px; font-weight: 600; letter-spacing: -.03em; line-height: 1; }

/* Navegação e filtros */
.tabs {
    margin-bottom: 20px;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 2px;
}

.tabs a {
    position: relative;
    padding: 13px 15px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.tabs a::after {
    position: absolute;
    right: 13px;
    bottom: -1px;
    left: 13px;
    height: 2px;
    border-radius: 2px 2px 0 0;
    background: transparent;
    content: "";
}

.tabs a:hover { color: var(--ink-soft); }
.tabs a.active { color: var(--accent); }
.tabs a.active::after { height: 3px; background: var(--accent); }
.stage-tabs a:nth-child(1).active { color: var(--info); }
.stage-tabs a:nth-child(1).active::after { background: var(--mark-normal); }
.stage-tabs a:nth-child(3).active { color: var(--warning); }
.stage-tabs a:nth-child(3).active::after { background: var(--mark-high); }
.stage-tabs a[href*="view=closed"].active { color: var(--muted-strong); }
.stage-tabs a[href*="view=closed"].active::after { background: var(--mark-low); }

.tabs span {
    display: inline-flex;
    min-width: 21px;
    min-height: 21px;
    margin-left: 5px;
    padding: 2px 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-strong);
    align-items: center;
    justify-content: center;
    color: var(--muted-strong);
    font-size: 10px;
}

.filter-bar {
    margin-bottom: 22px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    display: grid;
    grid-template-columns: minmax(240px, 1fr) 190px 165px auto;
    gap: 11px;
    align-items: end;
}
.filter-bar-compact { grid-template-columns: minmax(240px, 1fr) 190px auto; }

.filter-bar label { margin: 0 0 7px; }
.filter-bar input,
.filter-bar select,
.filter-button { min-height: 44px; }
.filter-search { position: relative; }
.filter-search::after {
    position: absolute;
    bottom: 12px;
    left: 14px;
    color: var(--muted);
    content: "⌕";
    font-size: 18px;
    line-height: 1;
    pointer-events: none;
}
.filter-search input { padding-left: 40px; }

/* Lista de chamados */
.ticket-list {
    overflow: hidden;
    border-radius: var(--radius-md);
}

.list-heading {
    min-height: 64px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-raised);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.list-heading h2 { margin: 0; font-size: 15px; font-weight: 700; }
.list-heading span { color: var(--muted); font-size: 11px; }

.ticket-row {
    position: relative;
    min-height: 101px;
    padding: 18px 18px 18px 0;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    display: grid;
    grid-template-columns: 4px minmax(0, 1fr) auto;
    gap: 19px;
    align-items: center;
    transition: background-color .18s ease, box-shadow .18s ease;
}

.ticket-row:last-child { border-bottom: 0; }
.ticket-row:hover { background: var(--surface-hover); }
.ticket-row.urgency-3 { background: linear-gradient(90deg, rgba(224, 163, 58, .1), var(--surface) 28%); }
.ticket-row.urgency-4 { background: linear-gradient(90deg, rgba(200, 55, 43, .08), var(--surface) 32%); }
.ticket-row.urgency-3:hover { background: linear-gradient(90deg, rgba(224, 163, 58, .16), var(--surface-hover) 32%); }
.ticket-row.urgency-4:hover { background: linear-gradient(90deg, rgba(200, 55, 43, .13), var(--surface-hover) 36%); }

.ticket-priority {
    width: 4px;
    height: calc(100% - 16px);
    min-height: 64px;
    border-radius: 0 4px 4px 0;
    background: var(--mark-low);
}

.urgency-2 .ticket-priority { background: var(--mark-normal); }
.urgency-3 .ticket-priority { background: var(--mark-high); }
.urgency-4 .ticket-priority { background: var(--mark-critical); }

.ticket-main { min-width: 0; }
.ticket-kicker { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; }
.ticket-main h3 { margin: 9px 0 6px; font-size: 15px; font-weight: 600; letter-spacing: -.012em; line-height: 1.4; }
.ticket-main p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }

.status-badge {
    padding: 4px 8px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

/* Chips de estado: fundo tonal claro, texto escuro (contraste AA) e rótulo textual */
.status-new { border-color: #b7d0ee; background: #e6f0fb; color: #1d4f8c; }
.status-in_analysis { border-color: #b5dcc0; background: #e5f3e9; color: #1f5a32; }
.status-waiting_user { border-color: #ecd09a; background: #fdf1dc; color: #7a4f00; }
.status-resolved { border-color: #a9dcd3; background: #ddf3ef; color: #0d5e51; }
.status-closed { border-color: #d0d8d3; background: #eef1ef; color: #4a5650; }
.urgency-badge {
    padding: 4px 8px;
    border: 1px solid transparent;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.2;
    text-transform: none;
    white-space: nowrap;
}
.urgency-badge::before {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    content: "";
}
.urgency-level-1 { border-color: #d0d8d3; background: #eef1ef; color: #4a5650; }
.urgency-level-2 { border-color: #b7d0ee; background: #e6f0fb; color: #1d4f8c; }
.urgency-level-3 { border-color: #ecd09a; background: #fdf1dc; color: #7a4f00; }
.urgency-level-4 { border-color: #f2b8b2; background: #fde8e6; color: #9f1d14; }

.row-link {
    min-height: 40px;
    padding: 9px 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.row-link:hover { border-color: rgba(44, 82, 54, .25); background: var(--accent-wash); color: var(--accent-bright); }

.empty-state { padding: 64px 20px; text-align: center; }
.empty-state strong { font-size: 15px; }
.empty-state p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }

.pagination { margin-top: 24px; display: flex; justify-content: center; gap: 6px; }
.pagination a {
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--muted-strong);
    display: grid;
    place-items: center;
    font-size: 12px;
    text-decoration: none;
}
.pagination a:hover { border-color: var(--line-strong); background: var(--surface-hover); color: var(--ink); }
.pagination a.active { border-color: var(--accent); background: var(--accent); color: #ffffff; }

/* Formulário de chamado */
.ticket-form { padding: clamp(22px, 4vw, 34px); display: grid; gap: 30px; }
.ticket-form fieldset { margin: 0; padding: 0; border: 0; }
.ticket-form legend { color: var(--ink); font-size: 13px; font-weight: 700; }
.ticket-form > div > label:first-child { margin-top: 0; }
.field-help,
.field-row { color: var(--muted); font-size: 11px; line-height: 1.55; }
.field-help { margin: 7px 0 12px; }
.field-row { margin-top: 8px; display: flex; justify-content: space-between; gap: 16px; }

.urgency-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.urgency-option {
    --urgency-color: var(--muted-strong);
    --urgency-bg: #eef1ef;
    --urgency-ring: rgba(141, 155, 147, .35);
    min-height: 84px;
    margin: 0;
    padding: 14px;
    border: 1px solid var(--line-strong);
    border-radius: 11px;
    background: var(--surface);
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    gap: 11px;
    transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.urgency-option:hover { border-color: var(--line-strong); background: var(--surface-hover); transform: translateY(-1px); }
.urgency-choice-1 { --urgency-color: #4a5650; --urgency-bg: #eef1ef; --urgency-ring: rgba(74, 86, 80, .3); }
.urgency-choice-2 { --urgency-color: #1d4f8c; --urgency-bg: #e6f0fb; --urgency-ring: rgba(29, 79, 140, .28); }
.urgency-choice-3 { --urgency-color: #7a4f00; --urgency-bg: #fdf1dc; --urgency-ring: rgba(122, 79, 0, .28); }
.urgency-choice-4 { --urgency-color: #9f1d14; --urgency-bg: #fde8e6; --urgency-ring: rgba(159, 29, 20, .28); }
.urgency-option:has(input:checked) { border-color: var(--urgency-color); background: var(--urgency-bg); box-shadow: 0 0 0 1px var(--urgency-ring); }
.urgency-option input { width: auto; min-height: 0; height: auto; margin: 4px 0 0; accent-color: var(--urgency-color); }
.urgency-option span { display: grid; gap: 4px; }
.urgency-option strong { color: var(--ink-soft); font-size: 12px; }
.urgency-option strong::before { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--urgency-color); content: ""; }
.urgency-option:has(input:checked) strong { color: var(--urgency-color); }
.urgency-option small { color: var(--muted); font-size: 11px; font-weight: 400; line-height: 1.4; }

.form-actions { padding-top: 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.file-list {
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    gap: 10px;
}
.file-list:empty { display: none; }

.file-preview {
    position: relative;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.file-preview-visual {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--bg-soft);
    display: grid;
    place-items: center;
}

.file-preview-visual img { width: 100%; height: 100%; object-fit: cover; }
.file-preview-fallback { padding: 12px; color: var(--muted); font-size: 10px; text-align: center; }
.file-preview-document {
    background:
        radial-gradient(circle at 50% 25%, rgba(41, 175, 76, .1), transparent 62%),
        var(--bg-soft);
    align-content: center;
    gap: 7px;
}
.file-document-icon,
.attachment-document-icon {
    min-width: 48px;
    padding: 9px 7px;
    border: 1px solid rgba(41, 175, 76, .45);
    border-radius: 9px;
    background: #e5f3e9;
    color: #1f5a32;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    text-align: center;
}
.file-document-label { color: var(--muted); font-size: 9px; }
.file-preview-meta { min-width: 0; padding: 10px 11px 11px; display: grid; gap: 2px; }
.file-preview-meta strong {
    overflow: hidden;
    color: var(--ink-soft);
    font-size: 10px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.file-preview-meta span { color: var(--muted); font-size: 9px; }

.file-remove {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 2px 8px rgba(30, 37, 34, .18);
    color: var(--ink);
    display: grid;
    place-items: center;
    font-size: 19px;
    line-height: 1;
    transition: border-color .18s ease, background-color .18s ease, transform .18s ease;
}
.file-remove:hover { border-color: #e3a39c; background: #fdecea; color: #9f1d14; transform: scale(1.04); }

.paste-hint {
    margin: 10px 0 0;
    padding: 12px 14px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface-raised);
    color: var(--muted-strong);
    font-size: 11px;
    line-height: 1.55;
}

.paste-hint span { display: block; margin-top: 3px; color: var(--muted); }
.paste-hint kbd {
    min-width: 25px;
    padding: 2px 6px;
    border: 1px solid var(--line-strong);
    border-bottom-width: 2px;
    border-radius: 5px;
    background: var(--surface);
    color: var(--ink-soft);
    font: inherit;
    font-weight: 700;
    white-space: nowrap;
}

.paste-status { min-height: 18px; margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.paste-status:empty { display: none; }
.paste-status[data-type="success"] { color: var(--success); }
.paste-status[data-type="warning"] { color: var(--warning); }
.paste-status[data-type="error"] { color: var(--danger); }

/* Detalhe e conversa */
.ticket-title {
    margin-bottom: 28px;
    padding-left: 18px;
    border-left: 3px solid var(--line-strong);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 30px;
}
.ticket-title.urgency-1 { border-left-color: var(--mark-low); }
.ticket-title.urgency-2 { border-left-color: var(--mark-normal); }
.ticket-title.urgency-3 { border-left-color: var(--mark-high); }
.ticket-title.urgency-4 { border-left-color: var(--mark-critical); }

.ticket-title > div { min-width: 0; max-width: 820px; }
.ticket-title h1 { font-size: clamp(32px, 4.2vw, 50px); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(290px, .72fr); gap: 20px; align-items: start; }

.conversation { overflow: hidden; border-radius: var(--radius-md); }
.section-heading {
    min-height: 67px;
    padding: 19px 23px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.section-heading h2 { margin: 0; font-size: 15px; font-weight: 700; }
.section-heading span { color: var(--muted); font-size: 11px; }

.message-list {
    padding: 24px;
    background:
        radial-gradient(circle at 10% 10%, rgba(41, 175, 76, .05), transparent 20rem),
        var(--bg-soft);
    display: grid;
    gap: 16px;
}

.message {
    width: fit-content;
    max-width: 88%;
    padding: 15px 17px;
    border: 1px solid var(--line);
    border-radius: 5px 15px 15px 15px;
    background: var(--surface);
    box-shadow: 0 4px 14px rgba(30, 37, 34, .06);
}

/* Mensagem da equipe: verde claro tonal, alinhada à direita */
.message-support {
    margin-left: auto;
    border-color: #b5dcc0;
    border-radius: 15px 5px 15px 15px;
    background: #e8f3ec;
}

.message header { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.message header strong { color: var(--ink-soft); font-size: 12px; }
.message header span { color: var(--muted); font-size: 9px; }
.message-support header span { color: var(--muted-strong); }
.message p { margin: 11px 0 0; font-size: 13px; line-height: 1.65; white-space: normal; overflow-wrap: anywhere; }

.attachment-grid {
    margin-top: 13px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 220px));
    gap: 9px;
}
.attachment-grid a {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink-soft);
    display: block;
    text-decoration: none;
    transition: border-color .18s ease, background-color .18s ease, transform .18s ease;
}
.attachment-grid a:hover { border-color: rgba(44, 82, 54, .5); background: var(--surface-hover); transform: translateY(-1px); }
.attachment-grid a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.attachment-thumbnail {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--bg-soft);
    display: grid;
    place-items: center;
}
.attachment-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .25s ease;
}
.attachment-grid a:hover .attachment-thumbnail img { transform: scale(1.035); }
.attachment-caption { min-width: 0; padding: 9px 10px 10px; display: grid; gap: 3px; }
.attachment-caption strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.attachment-caption small { color: var(--muted); font-size: 9px; }
.attachment-grid .attachment-document {
    min-height: 72px;
    padding: 10px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
}
.attachment-document-icon { min-width: 43px; padding: 8px 6px; }
.attachment-document .attachment-caption { padding: 0; }
.attachment-download { color: var(--accent); font-size: 18px; font-weight: 700; }

/* Visualização ampliada de anexos */
body.image-lightbox-open { overflow: hidden; }
.image-lightbox {
    width: min(1180px, calc(100vw - 32px));
    max-width: none;
    max-height: calc(100dvh - 32px);
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 30px 90px rgba(30, 37, 34, .3);
}
.image-lightbox:not([open]) { display: none; }
.image-lightbox::backdrop { background: rgba(30, 37, 34, .55); backdrop-filter: blur(6px); }
.image-lightbox-panel { max-height: calc(100dvh - 34px); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.image-lightbox-header,
.image-lightbox-footer {
    padding: 13px 15px;
    background: var(--surface-raised);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}
.image-lightbox-header { border-bottom: 1px solid var(--line); }
.image-lightbox-header > div { min-width: 0; display: grid; gap: 3px; }
.image-lightbox-header span { color: var(--muted); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.image-lightbox-header strong { overflow: hidden; color: var(--ink-soft); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.image-lightbox-close {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    padding: 0;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink-soft);
    display: grid;
    place-items: center;
    font-size: 23px;
    line-height: 1;
}
.image-lightbox-close:hover { border-color: #e3a39c; background: #fdecea; color: #9f1d14; }
.image-lightbox-viewport {
    min-height: min(62dvh, 560px);
    padding: 18px;
    overflow: auto;
    background:
        linear-gradient(45deg, rgba(30, 37, 34, .04) 25%, transparent 25%, transparent 75%, rgba(30, 37, 34, .04) 75%),
        linear-gradient(45deg, rgba(30, 37, 34, .04) 25%, transparent 25%, transparent 75%, rgba(30, 37, 34, .04) 75%),
        var(--bg-soft);
    background-position: 0 0, 10px 10px;
    background-size: 20px 20px;
    display: grid;
    place-items: center;
}
.image-lightbox-viewport img { max-width: 100%; max-height: calc(100dvh - 168px); object-fit: contain; border-radius: 7px; box-shadow: 0 12px 40px rgba(30, 37, 34, .2); }
.image-lightbox-footer { border-top: 1px solid var(--line); }
.image-lightbox-footer > span { color: var(--muted); font-size: 10px; }
.image-lightbox-footer kbd { color: var(--ink-soft); font: inherit; font-weight: 700; }

.reply-box,
.resolution-actions { padding: 23px 24px; border-top: 1px solid var(--line); }
.reply-box { background: var(--surface-raised); display: grid; gap: 9px; }
.reply-box label,
.still-problem label { margin: 6px 0 0; }
.state-action-panel { margin-top: 9px; padding-top: 17px; border-top: 1px solid var(--line); display: grid; gap: 12px; }
.state-action-heading { display: grid; gap: 4px; }
.state-action-heading strong { color: var(--ink-soft); font-size: 12px; }
.state-action-heading span { color: var(--muted); font-size: 10px; line-height: 1.5; }
.state-action-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.state-action {
    --state-color: var(--accent);
    --state-bg: #e5f3e9;
    --state-border: #b5dcc0;
    position: relative;
    min-width: 0;
    min-height: 88px;
    margin: 0;
    padding: 13px;
    border: 1px solid var(--state-border);
    border-radius: 11px;
    background: var(--surface);
    color: var(--ink-soft);
    box-shadow: none;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    text-align: left;
    cursor: pointer;
    transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.state-action input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}
.state-action:hover { border-color: var(--state-color); background: color-mix(in srgb, var(--state-color) 5%, var(--surface)); transform: translateY(-1px); }
.state-action:has(input:checked) { border-color: var(--state-color); background: var(--state-bg); box-shadow: inset 0 3px 0 var(--state-color), 0 8px 22px color-mix(in srgb, var(--state-color) 12%, transparent); }
.state-action:has(input:checked):hover { background: color-mix(in srgb, var(--state-color) 6%, var(--state-bg)); }
.state-action:has(input:focus-visible) { outline: 2px solid var(--state-color); outline-offset: 3px; }
.state-action > span:last-child { min-width: 0; display: grid; gap: 5px; }
.state-action strong { color: var(--ink); font-size: 11px; line-height: 1.3; }
.state-action small { color: var(--state-color); font-size: 9px; font-weight: 600; line-height: 1.4; }
.state-action-icon {
    width: 31px;
    height: 31px;
    border: 1px solid var(--state-border);
    border-radius: 9px;
    background: color-mix(in srgb, var(--state-color) 9%, var(--surface));
    color: var(--state-color);
    display: grid;
    place-items: center;
    font-size: 15px;
    font-weight: 700;
}
.state-action:has(input:checked) .state-action-icon { border-color: var(--state-color); background: var(--surface); }
.state-action-analysis { --state-color: #1f5a32; --state-bg: #e5f3e9; --state-border: #b5dcc0; }
.state-action-waiting { --state-color: #7a4f00; --state-bg: #fdf1dc; --state-border: #ecd09a; }
.state-action-resolved { --state-color: #0d5e51; --state-bg: #ddf3ef; --state-border: #a9dcd3; }
.state-action-submit { justify-self: end; margin-top: 8px; }
.resolution-actions { display: grid; gap: 16px; }
.resolution-actions h3 { margin: 0; font-size: 15px; }
.still-problem { padding-top: 15px; border-top: 1px solid var(--line); display: grid; gap: 9px; }
.danger-button { border-color: #e3a39c; color: #9f1d14; justify-self: start; }
.danger-button:hover { border-color: #c8372b; background: #fdecea; color: #7f1710; }

.locked-message {
    margin: 0;
    padding: 20px 24px;
    border-top: 1px solid var(--line);
    background: #f1f4f2;
    color: var(--muted-strong);
    font-size: 12px;
    line-height: 1.65;
}

.ticket-sidebar { display: grid; gap: 14px; }
.metadata-card h2,
.management-card h2 { margin: 0 0 18px; font-size: 15px; }
.metadata-card.urgency-3 { border-color: rgba(224, 163, 58, .55); }
.metadata-card.urgency-4 { border-color: rgba(200, 55, 43, .45); box-shadow: 0 8px 26px rgba(200, 55, 43, .08); }
.metadata-card dl { grid-template-columns: 1fr; gap: 15px; }
.metadata-card dd { color: var(--ink-soft); font-size: 13px; font-weight: 600; }
.management-card form { margin-top: 17px; padding-top: 17px; border-top: 1px solid var(--line); display: grid; gap: 9px; }
.management-card form:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.management-card label { margin: 4px 0 0; }
.management-card button { justify-self: start; }
.admin-card { border-color: rgba(224, 163, 58, .5); }

.event-log summary { color: var(--ink-soft); cursor: pointer; font-size: 12px; font-weight: 700; }
.event-log summary::marker { color: var(--accent); }
.event-log ol { margin: 18px 0 0; padding-left: 18px; display: grid; gap: 13px; }
.event-log li { padding-left: 4px; color: var(--line-strong); }
.event-log li strong,
.event-log li span { display: block; font-size: 10px; }
.event-log li strong { color: var(--ink-soft); }
.event-log li span { margin-top: 3px; color: var(--muted); }

/* Marcador de onde se encontra o problema */
.location-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: var(--radius-sm);
    background: #e5f3e9;
    border: 1px solid #b5dcc0;
    color: #1f5a32;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .02em;
    white-space: nowrap;
}

.field-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}
.field-label-row label {
    margin: 0 !important;
}

.link-button {
    background: none;
    border: none;
    padding: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color .15s ease;
}
.link-button:hover {
    color: var(--accent-bright);
}

/* Modal Dialog */
.modal-dialog {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    padding: 24px;
    margin: 0;
    border: none;
    background: rgba(30, 37, 34, .5);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-dialog:not([open]) {
    display: none;
}
.modal-card {
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 24px;
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.modal-header h2 {
    margin: 0;
    font-size: 18px;
    color: var(--ink);
}
.modal-close {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 24px;
    cursor: pointer;
    padding: 2px 8px;
    line-height: 1;
    border-radius: var(--radius-sm);
    transition: color .15s ease, background-color .15s ease;
}
.modal-close:hover {
    color: var(--ink);
    background: var(--surface-hover);
}
.field-error-message {
    color: var(--danger);
    font-size: 12px;
    margin-top: 6px;
    font-weight: 400;
}

/* Gestão de Locais / Módulos para Admin */
.admin-locations-shell {
    max-width: 960px;
}
.admin-locations-grid {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 24px;
    align-items: start;
    margin-top: 24px;
}
.admin-locations-form-card,
.admin-locations-list-card {
    padding: 24px;
}
.location-pills-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}
.location-pill-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--surface-raised);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}
.location-pill-name {
    font-weight: 600;
    color: var(--ink);
}
.location-pill-status {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    background: #ddf3ef;
    color: #0d5e51;
}
.location-pill-item.is-inactive .location-pill-status {
    background: #fdecea;
    color: #9f1d14;
}

@media (max-width: 960px) {
    .login-layout { grid-template-columns: minmax(340px, .86fr) minmax(420px, 1.14fr); }
    .intro { padding-inline: 42px; }
    .filter-bar { grid-template-columns: 1fr 1fr; }
    .filter-search { grid-column: 1 / -1; }
    .detail-grid { grid-template-columns: 1fr; }
    .ticket-sidebar { grid-template-columns: repeat(2, 1fr); }
    .event-log { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
    .login-layout { grid-template-columns: 1fr; }
    .intro {
        min-height: auto;
        padding: 30px 26px 35px;
        border-right: 0;
        border-bottom: 1px solid #1f3d28;
        gap: 36px;
    }
    .intro::after { right: -120px; bottom: -150px; }
    .intro h1 { margin: 13px 0 18px; font-size: clamp(38px, 11vw, 54px); }
    .intro > div > p:last-child { font-size: 14px; line-height: 1.7; }
    .intro-foot { display: none; }
    .form-panel { min-height: auto; padding: 42px 24px 56px; }
    .form-container { max-width: 520px; }
    dl { grid-template-columns: 1fr; gap: 18px; }
    .workspace-main { margin-top: 42px; }
    .admin-locations-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 680px) {
    .topbar { min-height: 64px; padding: 12px 14px; }
    .brand { gap: 10px; font-size: 10px; letter-spacing: .1em; }
    .brand-logo { height: 32px; }
    .brand-name { padding-left: 10px; }
    .user-chip { display: none; }
    .topbar-actions .button { display: none; }
    .app-shell,
    .ticket-detail-shell,
    .form-page,
    .workspace-main { width: min(100% - 24px, 1220px); margin-top: 28px; }
    .page-heading,
    .ticket-title { flex-direction: column; align-items: flex-start; gap: 20px; }
    .page-heading .primary-link,
    .ticket-title > form,
    .ticket-title > form button { width: 100%; }
    .metric-grid { grid-template-columns: repeat(2, 1fr); }
    .metric-grid article { min-height: 92px; }
    .tabs { overflow-x: auto; scrollbar-width: thin; }
    .tabs a { white-space: nowrap; }
    .filter-bar { grid-template-columns: 1fr; }
    .filter-search { grid-column: auto; }
    .ticket-row { grid-template-columns: 4px 1fr; gap: 15px; }
    .ticket-open { grid-column: 2; }
    .row-link { padding-left: 0; }
    .list-heading span { display: none; }
    .urgency-options { grid-template-columns: 1fr; }
    .form-actions { flex-direction: column-reverse; }
    .form-actions .button,
    .form-actions button { width: 100%; }
    .ticket-sidebar { grid-template-columns: 1fr; }
    .event-log { grid-column: auto; }
    .message-list { padding: 17px; }
    .message { max-width: 96%; }
    .message header { flex-direction: column; align-items: flex-start; gap: 3px; }
    .attachment-grid { grid-template-columns: minmax(0, 1fr); }
    .image-lightbox { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); border-radius: 12px; }
    .image-lightbox-panel { max-height: calc(100dvh - 18px); }
    .image-lightbox-viewport { min-height: 52dvh; padding: 10px; }
    .image-lightbox-footer > span { display: none; }
    .image-lightbox-footer .button { width: 100%; }
    .state-action-grid { grid-template-columns: 1fr; }
    .state-action { min-height: 72px; }
    .field-row { flex-direction: column; gap: 3px; }
}

@media (max-width: 420px) {
    .topbar-actions { gap: 6px; }
    .secondary { padding-inline: 12px; }
    .metric-grid { gap: 8px; }
    .metric-grid article { min-height: 84px; padding: 15px; }
    .metric-grid strong { font-size: 27px; }
    .card,
    .identity-card { padding: 21px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* Notificações de rascunho recuperado e alerta de sessão */
.draft-restored-notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 14px;
    margin: 8px 0 12px;
    border-radius: var(--radius-sm);
    background: #e6f0fb;
    border: 1px solid #b7d0ee;
    color: #1d4f8c;
    font-size: 13px;
}

.draft-restored-notice .link-button {
    background: none;
    border: none;
    padding: 0;
    color: var(--muted-strong);
    text-decoration: underline;
    cursor: pointer;
    font-size: 12px;
}

.draft-restored-notice .link-button:hover {
    color: var(--danger);
}

.session-alert-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 18px;
    margin: 0 0 20px;
    border-radius: var(--radius-sm);
    background: #fdecea;
    border: 1px solid #e3a39c;
    color: #7f1710;
    font-size: 14px;
    box-shadow: var(--shadow-sm);
}

.session-alert-banner a {
    color: #7f1710;
    font-weight: 600;
    text-decoration: underline;
}

