:root {
    color-scheme: light;
    --bg: #f7f8fb;
    --bg-elevated: rgba(255, 255, 255, 0.82);
    --panel: rgba(255, 255, 255, 0.76);
    --panel-strong: rgba(255, 255, 255, 0.94);
    --panel-muted: rgba(248, 250, 252, 0.72);
    --line: rgba(15, 23, 42, 0.09);
    --line-strong: rgba(15, 23, 42, 0.14);
    --text: #111318;
    --text-soft: #303642;
    --muted: #717784;
    --muted-strong: #545b68;
    --primary: #2f7cf6;
    --primary-strong: #195fd1;
    --primary-soft: rgba(47, 124, 246, 0.1);
    --primary-line: rgba(47, 124, 246, 0.22);
    --danger: #c24135;
    --warning: #a86716;
    --success: #277a46;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 12px 34px rgba(15, 23, 42, 0.08), 0 1px 0 rgba(255, 255, 255, 0.8) inset;
    --shadow-glow: 0 0 0 1px rgba(47, 124, 246, 0.08), 0 12px 32px rgba(47, 124, 246, 0.13);
    --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 82% -12%, rgba(47, 124, 246, 0.12), transparent 34rem),
        linear-gradient(180deg, #fbfcff 0%, var(--bg) 44%, #f3f5f8 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(rgba(17, 19, 24, 0.018) 1px, transparent 1px);
    background-size: 100% 56px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.54), transparent 72%);
}

a {
    color: var(--primary-strong);
    text-decoration: none;
    transition: color 220ms var(--ease), opacity 220ms var(--ease), background 220ms var(--ease);
}

a:hover {
    color: var(--primary);
}

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

button {
    -webkit-tap-highlight-color: transparent;
}

::selection {
    color: #fff;
    background: rgba(47, 124, 246, 0.82);
}

.layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 292px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 5;
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    border-right: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.68);
    backdrop-filter: blur(24px) saturate(1.2);
    box-shadow: 1px 0 0 rgba(255, 255, 255, 0.65) inset;
}

.brand {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-height: 58px;
    padding: 4px 8px;
}

.brand img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
}

.brand strong {
    display: block;
    overflow: hidden;
    color: #0b0d12;
    font-size: 0.98rem;
    font-weight: 650;
    letter-spacing: 0;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand span {
    display: block;
    margin-top: 3px;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 450;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.menu {
    display: grid;
    gap: 5px;
}

.menu a {
    position: relative;
    min-height: 42px;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: 10px 12px 10px 36px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: #222832;
    font-size: 0.9rem;
    font-weight: 540;
    isolation: isolate;
    transition:
        color 240ms var(--ease),
        border-color 240ms var(--ease),
        background 240ms var(--ease),
        box-shadow 240ms var(--ease),
        transform 240ms var(--ease);
}

.menu a::before {
    content: "";
    position: absolute;
    left: 14px;
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: currentColor;
    opacity: 0.24;
    transform: scale(0.78);
    transition: opacity 260ms var(--ease), transform 260ms var(--ease), box-shadow 260ms var(--ease);
}

.menu a::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    opacity: 0;
    background: radial-gradient(circle at var(--spot-x, 50%) var(--spot-y, 50%), rgba(47, 124, 246, 0.12), transparent 52%);
    transition: opacity 260ms var(--ease);
}

.menu a:hover,
.menu a.active,
.menu a.is-frequent:not(.active) {
    color: #0f3c78;
    border-color: var(--primary-line);
    background: rgba(255, 255, 255, 0.68);
    box-shadow: 0 10px 26px rgba(47, 124, 246, 0.09);
    text-decoration: none;
    transform: translateY(-1px);
}

.menu a:hover::after,
.menu a.active::after {
    opacity: 1;
}

.menu a.active::before {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 18px rgba(47, 124, 246, 0.55);
}

.menu a.is-frequent:not(.active)::before {
    opacity: 0.48;
    transform: scale(0.88);
}

.user-card {
    position: relative;
    margin-top: auto;
    overflow: hidden;
    display: grid;
    gap: 5px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.58);
    box-shadow: var(--shadow-sm);
}

.user-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at 18% 0%, rgba(47, 124, 246, 0.1), transparent 48%);
}

.user-card p,
.user-card small,
.user-card a {
    position: relative;
}

.user-card p {
    margin: 0;
    color: #14171d;
    font-weight: 620;
    line-height: 1.3;
}

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

.user-card a {
    width: fit-content;
    margin-top: 8px;
    color: #8f322b;
    font-size: 0.85rem;
    font-weight: 600;
}

.content {
    position: relative;
    --content-x: clamp(20px, 3vw, 44px);
    width: min(100%, 1480px);
    padding: 28px var(--content-x) 44px;
    display: grid;
    align-content: start;
    gap: 18px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 64px;
    margin: -28px calc(0px - var(--content-x)) 2px;
    padding: 16px var(--content-x) 12px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.055);
    background: rgba(247, 248, 251, 0.74);
    backdrop-filter: blur(22px) saturate(1.18);
}

.topbar h1 {
    margin: 0;
    color: #0e1116;
    font-size: clamp(1.35rem, 1vw + 1.08rem, 2rem);
    font-weight: 620;
    letter-spacing: 0;
    line-height: 1.08;
}

.topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 500;
    white-space: nowrap;
}

.print-btn,
button[type="submit"] {
    position: relative;
    min-height: 38px;
    width: fit-content;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    overflow: hidden;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 620;
    line-height: 1;
    transition:
        transform 220ms var(--ease),
        box-shadow 220ms var(--ease),
        border-color 220ms var(--ease),
        background 220ms var(--ease),
        color 220ms var(--ease),
        opacity 220ms var(--ease);
}

.print-btn {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.7);
    color: #1c2230;
    padding: 9px 12px;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.print-btn:hover,
button[type="submit"]:hover {
    transform: translateY(-1px);
}

.print-btn:hover {
    border-color: var(--primary-line);
    box-shadow: var(--shadow-glow);
}

button[type="submit"] {
    border: 1px solid rgba(47, 124, 246, 0.42);
    background: linear-gradient(180deg, #3786ff 0%, #226ee8 100%);
    color: #fff;
    padding: 10px 15px;
    box-shadow: 0 10px 24px rgba(47, 124, 246, 0.18), 0 1px 0 rgba(255, 255, 255, 0.28) inset;
}

button[type="submit"]:hover {
    background: linear-gradient(180deg, #4590ff 0%, #1e68dc 100%);
    box-shadow: 0 14px 30px rgba(47, 124, 246, 0.22), 0 0 0 4px rgba(47, 124, 246, 0.08);
}

button[type="submit"]:active,
.print-btn:active {
    transform: translateY(0) scale(0.99);
}

form.is-submitting button[type="submit"] {
    opacity: 0.74;
    pointer-events: none;
}

form.is-submitting button[type="submit"]::after {
    content: "";
    width: 13px;
    height: 13px;
    border: 2px solid rgba(255, 255, 255, 0.42);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 760ms linear infinite;
}

.flash {
    position: relative;
    overflow: hidden;
    padding: 12px 14px;
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    animation: rise-in 360ms var(--ease) both;
}

.flash::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.7;
    background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.7) 45%, transparent 72%);
    transform: translateX(-100%);
    animation: sheen 2.4s 260ms var(--ease) 1;
}

.flash.success {
    color: #145c34;
    border: 1px solid rgba(39, 122, 70, 0.22);
    background: rgba(232, 247, 238, 0.84);
}

.flash.error {
    color: #8d2d27;
    border: 1px solid rgba(194, 65, 53, 0.23);
    background: rgba(253, 237, 235, 0.9);
}

.panel,
.kpi-card,
.auth-panel {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--panel);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(20px) saturate(1.14);
    transition:
        transform 280ms var(--ease),
        box-shadow 280ms var(--ease),
        border-color 280ms var(--ease),
        background 280ms var(--ease);
}

.panel::before,
.kpi-card::before,
.auth-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(circle at var(--spot-x, 50%) var(--spot-y, 0%), rgba(47, 124, 246, 0.11), transparent 46%);
    transition: opacity 300ms var(--ease);
}

.panel:hover,
.kpi-card:hover,
.auth-panel:hover {
    border-color: rgba(47, 124, 246, 0.2);
    background: var(--panel-strong);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.panel:hover::before,
.kpi-card:hover::before,
.auth-panel:hover::before {
    opacity: 1;
}

.panel {
    padding: 18px;
}

.panel h2 {
    position: relative;
    margin: 0 0 14px;
    color: #12151b;
    font-size: 1.02rem;
    font-weight: 650;
    letter-spacing: 0;
    line-height: 1.25;
}

.description {
    position: relative;
    margin: -6px 0 14px;
    max-width: 780px;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.55;
}

.feature-list {
    display: grid;
    gap: 12px;
}

.feature-list div {
    display: grid;
    gap: 4px;
    padding: 12px 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.64);
}

.feature-list strong {
    color: #131822;
    font-size: 0.9rem;
    font-weight: 650;
}

.feature-list span {
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.45;
}

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

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

.kpi-card {
    min-height: 126px;
    padding: 18px;
    display: grid;
    align-content: space-between;
}

.kpi-card h3 {
    position: relative;
    margin: 0;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 640;
    line-height: 1.25;
    text-transform: uppercase;
}

.kpi-card strong {
    position: relative;
    display: inline-block;
    margin-top: 14px;
    color: #0b0e13;
    font-size: clamp(2rem, 2.3vw, 3rem);
    font-weight: 560;
    letter-spacing: 0;
    line-height: 0.95;
}

.indicator-list {
    position: relative;
    display: grid;
    gap: 9px;
}

.indicator-list div:not(.kpi-bar) {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    color: var(--muted-strong);
    font-size: 0.9rem;
}

.indicator-list strong {
    color: #151922;
    font-weight: 650;
}

.kpi-bar {
    --fill: 0%;
    height: 8px;
    border-radius: 99px;
    background: rgba(15, 23, 42, 0.07);
    position: relative;
    overflow: hidden;
}

.kpi-bar::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.4), transparent);
}

.kpi-bar::after {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--fill);
    border-radius: inherit;
    background: linear-gradient(90deg, #7e8795, #2f7cf6);
    box-shadow: 0 0 18px rgba(47, 124, 246, 0.25);
    transition: width 720ms var(--ease);
}

.kpi-bar.positive::after {
    background: linear-gradient(90deg, #2e8f5b, #2f7cf6);
}

.form-grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
}

.form-grid.compact {
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.form-grid.compact:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
}

.form-grid label,
.auth-form label {
    display: grid;
    gap: 7px;
    color: var(--muted-strong);
    font-size: 0.82rem;
    font-weight: 560;
    line-height: 1.25;
}

.form-grid input,
.form-grid textarea,
.form-grid select,
.filter-row input,
.auth-form input {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px 11px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.74);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.86) inset;
    outline: none;
    transition:
        border-color 220ms var(--ease),
        box-shadow 220ms var(--ease),
        background 220ms var(--ease),
        transform 220ms var(--ease);
}

.form-grid select,
.filter-row select {
    cursor: pointer;
}

.form-grid input::placeholder,
.form-grid textarea::placeholder,
.filter-row input::placeholder,
.auth-form input::placeholder {
    color: rgba(84, 91, 104, 0.6);
}

.form-grid input:hover,
.form-grid textarea:hover,
.form-grid select:hover,
.filter-row input:hover,
.auth-form input:hover {
    border-color: rgba(47, 124, 246, 0.2);
    background: rgba(255, 255, 255, 0.92);
}

.form-grid input:focus,
.form-grid textarea:focus,
.form-grid select:focus,
.filter-row input:focus,
.auth-form input:focus {
    border-color: rgba(47, 124, 246, 0.5);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(47, 124, 246, 0.1), 0 10px 28px rgba(47, 124, 246, 0.08);
}

.form-grid textarea {
    min-height: 92px;
    line-height: 1.45;
    resize: vertical;
}

.form-grid input[type="file"] {
    padding: 8px;
}

.span-2 {
    grid-column: span 2;
}

.filter-row {
    position: relative;
    display: grid;
    grid-template-columns: 2fr repeat(4, minmax(120px, 1fr)) 140px 110px;
    gap: 10px;
    align-items: end;
}

.table-wrap {
    position: relative;
    overflow: auto;
    border: 1px solid rgba(15, 23, 42, 0.065);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.52);
}

table {
    width: 100%;
    min-width: 680px;
    border-collapse: separate;
    border-spacing: 0;
}

th,
td {
    text-align: left;
    padding: 12px 13px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.065);
    vertical-align: top;
    color: #242a35;
    font-size: 0.88rem;
    line-height: 1.42;
}

th {
    position: sticky;
    top: 0;
    z-index: 1;
    color: #555e6c;
    background: rgba(248, 250, 252, 0.9);
    backdrop-filter: blur(14px);
    font-size: 0.72rem;
    font-weight: 680;
    text-transform: uppercase;
}

tbody tr {
    transition: background 220ms var(--ease), transform 220ms var(--ease), box-shadow 220ms var(--ease);
}

tbody tr:hover {
    background: rgba(47, 124, 246, 0.045);
}

tr:last-child td {
    border-bottom: 0;
}

td small {
    display: inline-block;
    margin-top: 3px;
    color: var(--muted);
    line-height: 1.35;
}

.inline-title {
    display: block;
    margin-bottom: 4px;
    color: #151922;
    font-size: 0.79rem;
    font-weight: 680;
}

td .pill + .pill {
    margin-left: 6px;
}

.pill {
    display: inline-flex;
    min-height: 22px;
    align-items: center;
    border-radius: 999px;
    padding: 3px 9px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(15, 23, 42, 0.055);
    color: #424a56;
    font-size: 0.7rem;
    font-weight: 680;
    line-height: 1;
    text-transform: uppercase;
}

.pill.alta {
    color: #8d2d27;
    border-color: rgba(194, 65, 53, 0.22);
    background: rgba(253, 237, 235, 0.82);
}

.pill.media,
.pill.media:not(.alta):not(.baixa) {
    color: #7a4c12;
    border-color: rgba(168, 103, 22, 0.22);
    background: rgba(255, 246, 227, 0.86);
}

.pill.baixa {
    color: #174c8f;
    border-color: rgba(47, 124, 246, 0.2);
    background: rgba(47, 124, 246, 0.09);
}

.ai-output {
    position: relative;
    margin: 0;
    min-height: 180px;
    white-space: pre-wrap;
    line-height: 1.58;
    color: #17202e;
    border: 1px solid rgba(47, 124, 246, 0.12);
    border-radius: var(--radius);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(248, 250, 252, 0.68)),
        radial-gradient(circle at 0% 0%, rgba(47, 124, 246, 0.08), transparent 42%);
    padding: 14px;
    font-family: "SFMono-Regular", "Cascadia Code", Consolas, Monaco, monospace;
    font-size: 0.88rem;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.86) inset;
}

.client-stack-section {
    display: grid;
    gap: 14px;
}

.client-stack-section h2 {
    margin: 0;
    color: #12151b;
    font-size: 1.02rem;
    font-weight: 650;
    line-height: 1.25;
}

.client-stack {
    display: grid;
    gap: 16px;
}

.client-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--panel);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(20px) saturate(1.14);
    padding: 18px;
}

.client-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.client-card-header h3 {
    margin: 0;
    color: #12151b;
    font-size: 1rem;
    font-weight: 650;
    line-height: 1.2;
}

.client-card-header p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.45;
}

.client-card-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.client-card-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 18px;
}

.client-facts {
    display: grid;
    gap: 12px;
}

.client-facts div,
.client-ai-block {
    display: grid;
    gap: 4px;
    padding: 12px 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.6);
}

.client-facts span,
.client-ai-block span {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 680;
    text-transform: uppercase;
}

.client-facts strong {
    color: #131822;
    font-size: 0.9rem;
    font-weight: 620;
    line-height: 1.5;
}

.client-facts small {
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

.client-ai-panel {
    display: grid;
    gap: 12px;
}

.client-ai-block p {
    margin: 0;
    color: #1c2330;
    font-size: 0.88rem;
    line-height: 1.55;
}

.action-list {
    margin: 0;
    padding-left: 18px;
    color: #1c2330;
    font-size: 0.88rem;
    line-height: 1.55;
}

.action-list li + li {
    margin-top: 6px;
}

.auth-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 50% 0%, rgba(47, 124, 246, 0.16), transparent 32rem),
        linear-gradient(180deg, #ffffff 0%, #f4f6f9 100%);
}

.auth-wrapper {
    width: min(940px, 100%);
}

.auth-panel {
    min-height: 560px;
    display: grid;
    align-content: center;
    gap: 14px;
    padding: clamp(28px, 6vw, 64px);
}

.auth-panel .auth-logo {
    position: relative;
    width: 130px;
    height: 64px;
    object-fit: contain;
}

.auth-logo.secondary {
    width: 112px;
    height: 52px;
    opacity: 0.72;
    margin-top: -12px;
}

.auth-panel h1 {
    position: relative;
    max-width: 680px;
    margin: 10px 0 0;
    color: #0b0d12;
    font-size: clamp(2rem, 4vw, 4rem);
    font-weight: 560;
    letter-spacing: 0;
    line-height: 0.98;
}

.auth-panel p {
    position: relative;
    max-width: 560px;
    margin: 0 0 8px;
    color: var(--muted);
    font-size: clamp(1rem, 1vw, 1.12rem);
    line-height: 1.55;
}

.auth-form {
    position: relative;
    display: grid;
    gap: 12px;
    width: min(420px, 100%);
    margin-top: 4px;
}

.demo-users {
    position: relative;
    display: grid;
    gap: 5px;
    max-width: 420px;
    margin-top: 4px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

.demo-users strong {
    color: #2f3540;
    font-weight: 620;
}

.is-revealed {
    animation: rise-in 420ms var(--ease) both;
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.995);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes sheen {
    to {
        transform: translateX(100%);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 1320px) {
    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 1024px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: relative;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line);
        gap: 14px;
    }

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

    .menu a {
        padding-left: 32px;
    }

    .content {
        width: 100%;
        padding-top: 24px;
    }

    .topbar {
        position: relative;
        margin-top: -24px;
    }

    .panel-grid {
        grid-template-columns: 1fr;
    }

    .client-card-grid {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .span-2 {
        grid-column: auto;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .topbar-actions {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 768px) {
    body {
        background: linear-gradient(180deg, #fbfcff 0%, #f5f6f9 100%);
    }

    .sidebar {
        padding: 18px 14px;
    }

    .brand {
        padding-inline: 2px;
    }

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

    .menu a {
        min-height: 40px;
        font-size: 0.84rem;
    }

    .content {
        padding: 20px 14px 30px;
        gap: 14px;
    }

    .topbar {
        margin-inline: -14px;
        padding-inline: 14px;
    }

    .topbar-actions {
        flex-wrap: wrap;
        gap: 10px;
        white-space: normal;
    }

    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .panel,
    .kpi-card {
        padding: 15px;
    }

    .client-card {
        padding: 15px;
    }

    .client-card-header {
        flex-direction: column;
    }

    .client-card-pills {
        justify-content: flex-start;
    }

    .filter-row {
        grid-template-columns: 1fr;
    }

    .auth-body {
        padding: 14px;
    }

    .auth-panel {
        min-height: auto;
        padding: 24px;
    }

    .auth-panel h1 {
        font-size: 2rem;
        line-height: 1.04;
    }
}

@media (max-width: 480px) {
    .menu {
        grid-template-columns: 1fr;
    }

    .topbar h1 {
        font-size: 1.55rem;
    }

    .print-btn,
    button[type="submit"] {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 1ms !important;
    }
}

@media print {
    body {
        background: #fff;
    }

    body::before,
    .sidebar,
    .topbar-actions,
    form,
    .print-btn {
        display: none !important;
    }

    .layout {
        display: block;
    }

    .content {
        width: 100%;
        padding: 0;
        gap: 8px;
    }

    .topbar {
        position: static;
        margin: 0 0 12px;
        padding: 0;
        border: 0;
        background: transparent;
    }

    .panel,
    .kpi-card {
        border: 1px solid #d8d8d8;
        box-shadow: none;
        break-inside: avoid;
        background: #fff;
    }

    th {
        background: #f3f4f6;
    }
}
