:root {
    --gemelo-orange: #f36f21;
    --gemelo-amber: #ffba1a;
    --gemelo-dark: #161b24;
    --gemelo-darker: #0e1219;
    --gemelo-gray: #656a73;
    --ink: #1d2430;
    --muted: #707887;
    --line: #e5e8ed;
    --background: #f3f5f7;
    --card: #ffffff;
    --success: #17724c;
    --error: #ad342e;
    --shadow: 0 18px 50px rgba(24, 31, 43, 0.08);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { min-height: 100%; }
button, input { font: inherit; }
button { color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }

.app-body {
    margin: 0;
    background: var(--background);
    color: var(--ink);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.app-body.modal-open { overflow: hidden; }

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

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: 260px;
    padding: 28px 18px 20px;
    display: flex;
    flex-direction: column;
    color: #fff;
    background:
        radial-gradient(circle at 20% 0%, rgba(243, 111, 33, 0.18), transparent 34%),
        linear-gradient(160deg, #202630 0%, #11161e 72%);
    box-shadow: 10px 0 35px rgba(7, 10, 15, 0.12);
}

.brand {
    display: block;
    padding: 0 9px 30px;
    color: #fff;
    text-decoration: none;
}

.brand img { width: 188px; height: auto; display: block; }
.brand span {
    display: block;
    margin-top: 13px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.13);
    color: #c8cdd5;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.nav-group { display: grid; gap: 5px; }
.nav-label {
    padding: 8px 12px;
    color: #7f8793;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.16em;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 11px;
    color: #c9ced6;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
}

.nav-item svg,
.logout-form svg,
.mobile-menu svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-item:hover,
.nav-item.active { background: rgba(255, 255, 255, 0.08); color: #fff; }
.nav-item.active { box-shadow: inset 3px 0 0 var(--gemelo-orange); }

.sidebar-note {
    margin-top: auto;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.04);
}

.sidebar-note strong,
.sidebar-note span { display: block; }
.sidebar-note strong { font-size: 12px; }
.sidebar-note span { margin-top: 5px; color: #929aa7; font-size: 11px; line-height: 1.5; }

.logout-form button {
    width: 100%;
    margin-top: 12px;
    padding: 11px;
    display: flex;
    align-items: center;
    gap: 11px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #aab1bc;
    cursor: pointer;
    font-weight: 700;
    text-align: left;
}

.logout-form button:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }

.main-area { grid-column: 2; min-width: 0; }
.topbar {
    position: sticky;
    top: 0;
    z-index: 25;
    height: 72px;
    padding: 0 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-context { color: var(--muted); font-size: 13px; font-weight: 700; }
.mobile-menu { display: none; border: 0; background: transparent; cursor: pointer; }
.user-box { display: flex; align-items: center; gap: 10px; }
.avatar {
    width: 39px;
    height: 39px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, var(--gemelo-amber), var(--gemelo-orange));
    font-weight: 900;
}
.user-box strong, .user-box span { display: block; }
.user-box strong { max-width: 260px; overflow: hidden; color: #242b35; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.user-box span { margin-top: 2px; color: var(--muted); font-size: 11px; }

.page-content { max-width: 1480px; margin: 0 auto; padding: 36px; }
.page-heading { margin-bottom: 27px; display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.eyebrow { color: var(--gemelo-orange); font-size: 10px; font-weight: 900; letter-spacing: 0.16em; }
.page-heading h1 { margin: 7px 0 6px; color: #202731; font-size: 31px; line-height: 1.15; }
.page-heading p { margin: 0; color: var(--muted); font-size: 14px; }

.btn-primary,
.btn-secondary {
    min-height: 42px;
    padding: 10px 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}
.btn-primary { border: 1px solid var(--gemelo-orange); color: #fff; background: var(--gemelo-orange); box-shadow: 0 10px 22px rgba(243, 111, 33, 0.2); }
.btn-primary:hover { border-color: #d95d17; background: #d95d17; }
.btn-primary.full { width: 100%; }
.btn-secondary { border: 1px solid #d8dce2; color: #3d4652; background: #fff; }
.btn-secondary:hover { background: #f7f8fa; }
.btn-danger {
    min-height: 42px;
    padding: 10px 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--error);
    border-radius: 10px;
    color: #fff;
    background: var(--error);
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
}
.btn-danger:hover { background: #922b27; border-color: #922b27; }

.flash,
.form-error,
.setup-warning {
    margin-bottom: 20px;
    border-radius: 11px;
    font-size: 12px;
}
.flash,
.form-error { padding: 12px 14px; display: flex; align-items: center; gap: 9px; }
.flash { border: 1px solid #bee4d3; color: var(--success); background: #eaf8f2; }
.flash.error,
.form-error { border: 1px solid #f2c6c3; color: var(--error); background: #fff0ef; }
.flash > span,
.form-error > span { width: 19px; height: 19px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--success); font-size: 10px; }
.flash.error > span,
.form-error > span { background: var(--error); }

.setup-warning { padding: 16px 18px; display: grid; gap: 6px; border: 1px solid #f2d8a7; color: #7c5715; background: #fff8e9; }
.setup-warning strong { font-size: 13px; }
.setup-warning code { width: fit-content; margin-top: 4px; padding: 5px 7px; border-radius: 6px; color: #4e3c1a; background: #fff; }

.client-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 270px));
    align-items: start;
    justify-content: start;
    gap: 18px;
}
.client-card {
    position: relative;
    width: 100%;
    max-width: 270px;
    min-width: 0;
    overflow: hidden;
    border: 1px solid #dde3ea;
    border-radius: 15px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
    box-shadow: 0 8px 22px rgba(22, 27, 36, 0.055);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.client-card:hover {
    transform: translateY(-3px);
    border-color: rgba(243, 111, 33, 0.35);
    box-shadow: 0 15px 34px rgba(22, 27, 36, 0.11);
}
.client-card-open {
    width: 100%;
    min-width: 0;
    padding: 0;
    overflow: hidden;
    display: grid;
    grid-template-rows: 132px auto auto;
    border: 0;
    background: transparent;
    cursor: pointer;
    text-align: left;
}
.client-card-open:focus-visible {
    outline: 3px solid rgba(243, 111, 33, 0.25);
    outline-offset: -3px;
}
.client-card-top {
    min-height: 132px;
    padding: 18px;
    display: grid;
    place-items: center;
    border-bottom: 1px solid #edf1f5;
    background:
        radial-gradient(circle at top left, rgba(243, 111, 33, 0.08), transparent 36%),
        linear-gradient(160deg, #f8fafc 0%, #eef2f6 100%);
}
.client-logo-wrap {
    width: 100%;
    height: 100%;
    min-width: 0;
    display: grid;
    place-items: center;
}
.client-logo-wrap img {
    width: 100%;
    height: 100%;
    max-width: 210px;
    max-height: 94px;
    object-fit: contain;
    object-position: center;
}
.client-fallback {
    width: 70px;
    height: 70px;
    display: grid;
    place-items: center;
    border-radius: 17px;
    color: #fff;
    background: linear-gradient(135deg, var(--gemelo-amber), var(--gemelo-orange));
    box-shadow: 0 10px 24px rgba(243, 111, 33, 0.18);
    font-size: 21px;
    font-weight: 900;
}
.client-card-content {
    padding: 13px 16px 10px;
}
.client-name {
    min-height: 38px;
    display: -webkit-box;
    overflow: hidden;
    color: #1f2833;
    font-size: 15px;
    line-height: 1.25;
    font-weight: 800;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.client-card-footer {
    padding: 9px 16px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-top: 1px solid #edf1f5;
    color: #586270;
    font-size: 11px;
    font-weight: 700;
}
.client-arrow {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, var(--gemelo-amber), var(--gemelo-orange));
    box-shadow: 0 6px 14px rgba(243, 111, 33, 0.18);
    font-size: 15px;
}
.client-delete-button {
    position: absolute;
    top: 9px;
    right: 9px;
    z-index: 3;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(173, 52, 46, 0.15);
    border-radius: 9px;
    color: #9b3b35;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 6px 16px rgba(28, 34, 43, 0.10);
    cursor: pointer;
    font-size: 12px;
}
.client-delete-button:hover {
    border-color: #d8a39f;
    color: #fff;
    background: var(--error);
}

.empty-state-card { padding: 70px 24px; border: 1px dashed #d7dbe1; border-radius: 18px; background: #fff; text-align: center; }
.empty-mark,
.modal-icon { margin: 0 auto; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--gemelo-amber), var(--gemelo-orange)); font-weight: 900; }
.empty-mark { width: 70px; height: 70px; border-radius: 20px; }
.empty-state-card h2 { margin: 18px 0 7px; font-size: 19px; }
.empty-state-card p { margin: 0 0 18px; color: var(--muted); font-size: 13px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; padding: 24px; display: grid; place-items: center; background: rgba(10, 14, 20, 0.68); backdrop-filter: blur(5px); }
.modal-card { position: relative; width: min(520px, 100%); max-height: calc(100vh - 48px); overflow: auto; padding: 31px; border-radius: 18px; background: #fff; box-shadow: 0 30px 90px rgba(0, 0, 0, 0.28); }
.modal-card h2 { margin: 8px 0; color: #202731; font-size: 25px; }
.modal-card > p { margin: 0 0 23px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.modal-close { position: absolute; top: 13px; right: 14px; width: 34px; height: 34px; border: 0; border-radius: 50%; color: #7c838c; background: #f2f4f6; cursor: pointer; font-size: 22px; line-height: 1; }
.modal-close:hover { color: #202731; background: #e7eaee; }
.report-modal {
    width: min(720px, 100%);
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 22px;
    text-align: left;
    background: #fff;
    box-shadow: 0 32px 90px rgba(6, 10, 16, 0.34);
}
.report-modal-accent {
    height: 5px;
    background: linear-gradient(90deg, var(--gemelo-amber) 0%, var(--gemelo-orange) 58%, #d95318 100%);
}
.report-modal .modal-close {
    top: 20px;
    right: 20px;
    z-index: 3;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid #e5e9ee;
    color: #68717d;
    background: #fff;
    box-shadow: 0 7px 18px rgba(19, 27, 38, 0.08);
    font-size: 16px;
}
.report-modal .modal-close:hover {
    border-color: #d8dde4;
    color: #202731;
    background: #f7f8fa;
}
.report-client-heading {
    min-height: 146px;
    padding: 29px 78px 25px 32px;
    display: flex;
    align-items: center;
    gap: 22px;
    border-bottom: 1px solid #e9edf1;
    background:
        radial-gradient(circle at 4% 0%, rgba(255, 186, 26, 0.11), transparent 29%),
        linear-gradient(135deg, #ffffff 0%, #f7f9fb 100%);
}
.report-client-logo {
    flex: 0 0 116px;
    width: 116px;
    height: 82px;
    padding: 12px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid #e1e6ec;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 9px 24px rgba(20, 28, 39, 0.07);
}
.report-client-logo img {
    width: 100%;
    height: 100%;
    max-width: 92px;
    max-height: 58px;
    display: block;
    object-fit: contain;
    object-position: center;
}
.report-client-logo span {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(135deg, var(--gemelo-amber), var(--gemelo-orange));
    box-shadow: 0 8px 18px rgba(243, 111, 33, 0.18);
    font-size: 17px;
    font-weight: 900;
    letter-spacing: 0.04em;
}
.report-client-copy { min-width: 0; }
.report-modal-kicker {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--gemelo-orange);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}
.report-client-copy h2 {
    margin: 8px 0 5px;
    overflow: hidden;
    color: #1f2732;
    font-size: 26px;
    line-height: 1.16;
    letter-spacing: -0.02em;
    text-overflow: ellipsis;
}
.report-client-copy p {
    margin: 0;
    color: #707987;
    font-size: 13px;
    line-height: 1.5;
}
.report-modal-body { padding: 25px 32px 28px; }
.report-section-heading {
    margin-bottom: 14px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}
.report-section-heading > div { min-width: 0; }
.report-section-heading strong,
.report-section-heading span { display: block; }
.report-section-heading strong {
    color: #28313d;
    font-size: 13px;
    font-weight: 850;
}
.report-section-heading > div > span {
    margin-top: 4px;
    color: #8a929d;
    font-size: 11px;
    line-height: 1.4;
}
.report-count {
    flex: 0 0 auto;
    padding: 5px 9px;
    border: 1px solid #ead8ca;
    border-radius: 999px;
    color: #b25019;
    background: #fff8f2;
    font-size: 10px;
    font-weight: 800;
}
.report-option {
    min-width: 0;
    padding: 18px;
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    border: 1px solid #dfe5eb;
    border-radius: 15px;
    color: inherit;
    background: #fff;
    box-shadow: 0 7px 20px rgba(24, 32, 43, 0.045);
    text-decoration: none;
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.report-option:hover {
    transform: translateY(-2px);
    border-color: rgba(243, 111, 33, 0.4);
    background: linear-gradient(135deg, #fff 0%, #fffbf8 100%);
    box-shadow: 0 13px 30px rgba(24, 32, 43, 0.09);
}
.report-option:focus-visible {
    outline: 3px solid rgba(243, 111, 33, 0.22);
    outline-offset: 3px;
}
.report-option.loading {
    pointer-events: none;
    opacity: 0.72;
}
.report-option-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border: 1px solid #f2d8c7;
    border-radius: 14px;
    color: var(--gemelo-orange);
    background: linear-gradient(145deg, #fff9f4, #fff2e8);
    font-size: 21px;
}
.report-option-content {
    min-width: 0;
    display: block;
}
.report-option-content > strong {
    display: block;
    color: #242d38;
    font-size: 14px;
    line-height: 1.35;
}
.report-option-content > small {
    max-width: 430px;
    margin-top: 5px;
    display: block;
    color: #727b87;
    font-size: 11px;
    line-height: 1.5;
}
.report-option-meta {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}
.report-option-meta > span {
    padding: 4px 7px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid #e7eaee;
    border-radius: 999px;
    color: #66707c;
    background: #f8f9fa;
    font-size: 9px;
    font-weight: 750;
    white-space: nowrap;
}
.report-option-meta i { color: #8b949f; }
.report-option-action {
    min-height: 38px;
    padding: 9px 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 10px;
    color: #fff;
    background: var(--gemelo-orange);
    box-shadow: 0 8px 18px rgba(243, 111, 33, 0.2);
    font-size: 11px;
    font-weight: 850;
    white-space: nowrap;
}
.report-option:hover .report-option-action { background: #d95d17; }
.report-empty {
    min-height: 134px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 17px;
    border: 1px dashed #d9dfe6;
    border-radius: 15px;
    color: #68717d;
    background: #f8fafb;
}
.report-empty-icon {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: #89929d;
    background: #eef1f4;
    font-size: 20px;
}
.report-empty div { min-width: 0; }
.report-empty strong,
.report-empty div > span { display: block; }
.report-empty strong {
    color: #343d48;
    font-size: 14px;
    line-height: 1.4;
}
.report-empty div > span {
    margin-top: 5px;
    color: #818a95;
    font-size: 11px;
    line-height: 1.55;
}
.report-modal-footer {
    padding: 13px 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-top: 1px solid #e9edf1;
    color: #87909b;
    background: #fafbfc;
    font-size: 10px;
    line-height: 1.45;
    text-align: center;
}
.report-modal-footer i { color: #6f7884; }

.client-form { display: grid; gap: 17px; }
.client-form label,
.login-form label { color: #39424e; font-size: 12px; font-weight: 800; }
.client-form input,
.login-form input { width: 100%; margin-top: 7px; padding: 12px; border: 1px solid #d6dae0; border-radius: 10px; outline: none; color: #242c37; background: #fff; }
.client-form input:focus,
.login-form input:focus { border-color: var(--gemelo-orange); box-shadow: 0 0 0 3px rgba(243, 111, 33, 0.1); }
.client-form input[type="file"] { padding: 9px; color: #69717d; background: #fafbfc; }
.client-form small { display: block; margin-top: 6px; color: #8b929c; font-size: 10px; font-weight: 500; }
.logo-preview { height: 120px; padding: 14px; border: 1px dashed #d5d9df; border-radius: 10px; background: #fafbfc; }
.logo-preview img { width: 100%; height: 100%; object-fit: contain; }
.modal-actions { margin-top: 5px; display: flex; justify-content: flex-end; gap: 10px; }
.delete-client-modal > p strong { color: #2c3440; }
.delete-warning {
    padding: 12px 13px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border: 1px solid #f0cecb;
    border-radius: 10px;
    color: #8d342f;
    background: #fff3f2;
    font-size: 11px;
    line-height: 1.45;
}
.delete-warning i { margin-top: 2px; }

.auth-body { background: #fff; }
.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr); }
.login-visual { position: relative; overflow: hidden; padding: 68px; display: flex; align-items: center; color: #fff; background: radial-gradient(circle at 18% 16%, #39424d 0%, #1d232c 38%, #0e1218 100%); }
.login-visual::before { content: ""; position: absolute; inset: 0; opacity: 0.22; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 44px 44px; mask-image: linear-gradient(to bottom right, #000, transparent 72%); }
.login-decoration { position: absolute; border: 1px solid rgba(255, 255, 255, 0.08); transform: rotate(30deg); }
.login-decoration-one { width: 390px; height: 390px; right: -90px; top: -120px; box-shadow: 0 0 0 65px rgba(243,111,33,.04), 0 0 0 130px rgba(255,186,26,.025); }
.login-decoration-two { width: 240px; height: 240px; left: 13%; bottom: -170px; box-shadow: 0 0 0 50px rgba(255,255,255,.025); }
.visual-inner { position: relative; z-index: 2; max-width: 610px; }
.login-logo { width: 270px; height: auto; margin-bottom: 72px; }
.eyebrow-light { color: #ffb16f; font-size: 10px; font-weight: 900; letter-spacing: 0.17em; }
.visual-inner h1 { max-width: 650px; margin: 16px 0 17px; font-size: clamp(38px, 4vw, 58px); line-height: 1.04; letter-spacing: -0.035em; }
.visual-inner > p { max-width: 580px; margin: 0; color: #b8bec8; font-size: 15px; line-height: 1.7; }
.visual-product { margin-top: 42px; padding: 14px 0 14px 18px; border-left: 3px solid var(--gemelo-orange); }
.visual-product span,
.visual-product strong { display: block; }
.visual-product span { color: #9098a4; font-size: 10px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.visual-product strong { margin-top: 4px; font-size: 17px; }

.login-form-panel { padding: 44px; display: flex; align-items: center; justify-content: center; background: #fff; }
.login-form-wrap { width: 100%; max-width: 390px; }
.mobile-brand-logo {
    display: none;
    width: 230px;
    margin-bottom: 40px;
    padding: 18px 20px;
    border-radius: 14px;
    background: linear-gradient(145deg, #242b35, #11161e);
    box-shadow: 0 14px 34px rgba(17, 22, 30, 0.16);
}
.mobile-brand-logo img { width: 100%; height: auto; display: block; }
.login-form-wrap h2 { margin: 8px 0 8px; color: #222a35; font-size: 31px; }
.login-form-wrap > p { margin: 0 0 27px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.login-form { display: grid; gap: 17px; }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 74px; }
.password-field button { position: absolute; right: 8px; top: 14px; border: 0; color: #6d7580; background: transparent; cursor: pointer; font-size: 11px; font-weight: 800; }
.mock-note { margin-top: 18px; padding: 11px 12px; border: 1px solid #e0e3e8; border-radius: 9px; color: #68717e; background: #f7f8fa; font-size: 11px; }

@media (max-width: 1220px) {
    .client-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 260px)); }
    .client-card { max-width: 260px; }
}

@media (max-width: 900px) {
    .app-shell { display: block; }
    .sidebar { transform: translateX(-100%); transition: transform 0.2s ease; }
    .sidebar.open { transform: translateX(0); }
    .main-area { grid-column: auto; }
    .mobile-menu { display: inline-flex; }
    .client-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 260px)); }
    .login-page { grid-template-columns: 1fr; }
    .login-visual { display: none; }
    .mobile-brand-logo { display: block; }
    .login-form-panel { min-height: 100vh; }
}

@media (max-width: 620px) {
    .topbar { padding: 0 17px; }
    .topbar-context { display: none; }
    .user-box strong { max-width: 150px; }
    .page-content { padding: 25px 16px; }
    .page-heading { flex-direction: column; }
    .client-grid { grid-template-columns: 1fr; }
    .client-card { max-width: none; }
    .client-card-open { grid-template-rows: 128px auto auto; }
    .client-card-top { min-height: 128px; padding: 17px; }
    .client-logo-wrap img { max-height: 90px; }
    .login-form-panel { padding: 30px 22px; }
    .modal-backdrop { padding: 12px; }
    .modal-card { padding: 27px 21px; }
    .modal-actions { flex-direction: column-reverse; }
    .modal-actions button { width: 100%; }
    .report-modal { border-radius: 18px; }
    .report-modal .modal-close { top: 15px; right: 15px; }
    .report-client-heading {
        min-height: 0;
        padding: 24px 58px 20px 20px;
        align-items: flex-start;
        gap: 14px;
    }
    .report-client-logo {
        flex-basis: 82px;
        width: 82px;
        height: 64px;
        padding: 9px;
        border-radius: 12px;
    }
    .report-client-logo img { max-width: 64px; max-height: 44px; }
    .report-client-logo span { width: 42px; height: 42px; border-radius: 11px; font-size: 14px; }
    .report-client-copy h2 { margin-top: 6px; font-size: 21px; }
    .report-client-copy p { display: none; }
    .report-modal-body { padding: 20px; }
    .report-section-heading { align-items: flex-start; }
    .report-section-heading > div > span { display: none; }
    .report-option {
        padding: 15px;
        grid-template-columns: 46px minmax(0, 1fr);
        gap: 12px;
    }
    .report-option-icon { width: 46px; height: 46px; border-radius: 12px; font-size: 18px; }
    .report-option-action {
        grid-column: 1 / -1;
        width: 100%;
        margin-top: 2px;
    }
    .report-option-meta { gap: 5px; }
    .report-empty { padding: 19px; align-items: flex-start; }
    .report-empty-icon { flex-basis: 46px; width: 46px; height: 46px; }
    .report-modal-footer { padding: 12px 20px; }
}

/* Login refinado */
.login-page {
    grid-template-columns: minmax(0, 51.5%) minmax(0, 48.5%);
}

.login-visual {
    padding: 44px;
}

.visual-inner {
    width: 100%;
    max-width: 630px;
}

.login-logo {
    width: 140px;
    margin-bottom: 52px;
}

.visual-inner h1 {
    max-width: 590px;
    margin: 17px 0 16px;
    font-size: clamp(42px, 2.95vw, 52px);
    line-height: 1.02;
    letter-spacing: -0.04em;
}

.visual-inner > p {
    max-width: 570px;
    font-size: 14px;
    line-height: 1.6;
}

.visual-product {
    margin-top: 38px;
}

.login-form-panel {
    padding: 44px clamp(36px, 7vw, 116px);
}

.login-form-wrap {
    max-width: 345px;
}

.login-form-wrap h2 {
    margin: 9px 0 25px;
    font-size: 31px;
    line-height: 1.1;
    letter-spacing: -0.025em;
}

.login-form {
    gap: 17px;
}

.login-form input {
    min-height: 43px;
}

.login-form .btn-primary {
    min-height: 43px;
    margin-top: 1px;
}

.login-legal-links {
    margin-top: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    color: #8a919c;
    font-size: 11px;
    text-align: center;
}

.login-support-link {
    line-height: 1.4;
}

.login-legal-links a,
.login-legal-links button,
.sidebar-legal a,
.sidebar-legal button {
    border: 0;
    padding: 0;
    color: inherit;
    background: transparent;
    cursor: pointer;
    font: inherit;
    text-decoration: none;
}

.login-legal-links a:hover,
.login-legal-links button:hover {
    color: var(--gemelo-orange);
    text-decoration: underline;
}

/* Cadastro de clientes */
.client-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

/* Links institucionais no menu */
.sidebar-legal {
    margin-top: 12px;
    padding: 14px 10px 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 13px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #939ba6;
    font-size: 10px;
}

.sidebar-legal a:hover,
.sidebar-legal button:hover {
    color: #fff;
}

.sidebar-legal + .logout-form {
    margin-top: 8px;
}

/* Aviso de cookies */
.cookie-banner {
    position: fixed;
    left: 50%;
    bottom: 22px;
    z-index: 9000;
    width: min(760px, calc(100vw - 40px));
    padding: 15px 16px 15px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 14px;
    color: #fff;
    background: rgba(20, 25, 33, 0.97);
    box-shadow: 0 22px 65px rgba(6, 10, 16, 0.3);
    transform: translateX(-50%);
    backdrop-filter: blur(12px);
}

.cookie-banner-content {
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.cookie-icon {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: #fff;
    background: linear-gradient(135deg, var(--gemelo-amber), var(--gemelo-orange));
    font-size: 14px;
}

.cookie-icon i {
    line-height: 1;
}

.cookie-banner strong {
    display: block;
    margin-bottom: 3px;
    font-size: 12px;
}

.cookie-banner p {
    margin: 0;
    color: #b9c0ca;
    font-size: 11px;
    line-height: 1.45;
}

.cookie-banner-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.cookie-banner-actions a {
    color: #d6dbe2;
    font-size: 10px;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.btn-cookie {
    min-height: 36px;
    padding: 0 18px;
    border: 0;
    border-radius: 9px;
    color: #fff;
    background: var(--gemelo-orange);
    cursor: pointer;
    font-size: 11px;
    font-weight: 800;
}

.btn-cookie:hover {
    filter: brightness(0.96);
}

/* Política de Privacidade */
.legal-page {
    min-height: 100vh;
    padding: 44px 22px;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 12% 8%, rgba(243, 111, 33, 0.12), transparent 28%),
        linear-gradient(145deg, #171d26 0%, #0d1117 100%);
}

.legal-card {
    width: min(900px, 100%);
    overflow: hidden;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.28);
}

.legal-header {
    padding: 34px 38px;
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    align-items: center;
    gap: 30px;
    color: #fff;
    background:
        radial-gradient(circle at 0% 0%, rgba(243, 111, 33, 0.19), transparent 45%),
        #171d26;
}

.legal-header img {
    width: 165px;
}

.legal-header h1 {
    margin: 8px 0 7px;
    font-size: 32px;
    line-height: 1.1;
}

.legal-header p {
    margin: 0;
    color: #b9c0ca;
    font-size: 13px;
}

.legal-content {
    padding: 34px 38px 20px;
    display: grid;
    gap: 22px;
}

.legal-content section {
    padding-bottom: 20px;
    border-bottom: 1px solid #edf0f3;
}

.legal-content section:last-child {
    border-bottom: 0;
}

.legal-content h2 {
    margin: 0 0 8px;
    color: #242c37;
    font-size: 16px;
}

.legal-content p {
    margin: 0 0 8px;
    color: #66707d;
    font-size: 13px;
    line-height: 1.7;
}

.legal-content p:last-child {
    margin-bottom: 0;
}

.legal-updated {
    font-weight: 700;
}

.legal-footer {
    padding: 0 38px 34px;
    display: flex;
    justify-content: flex-end;
}

.legal-footer .btn-secondary {
    text-decoration: none;
}


@media (max-width: 900px) {
    .login-page {
        grid-template-columns: 1fr;
    }

    .login-form-panel {
        padding: 38px 24px;
    }

    .login-form-wrap {
        max-width: 390px;
    }

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

@media (max-width: 620px) {
    .cookie-banner {
        bottom: 12px;
        width: calc(100vw - 24px);
        padding: 14px;
        align-items: stretch;
        flex-direction: column;
    }

    .cookie-banner-actions {
        justify-content: space-between;
    }

    .legal-page {
        padding: 16px;
    }

    .legal-header {
        padding: 28px 22px;
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .legal-header img {
        width: 145px;
    }

    .legal-content {
        padding: 26px 22px 12px;
    }

    .legal-footer {
        padding: 0 22px 26px;
    }
}

/* Geração de relatórios ---------------------------------------------------- */
.app-body.report-generating {
    overflow: hidden !important;
    cursor: wait;
}

.app-body.report-generating .app-shell,
.app-body.report-generating .compliance-banner {
    pointer-events: none;
    user-select: none;
}

.report-generation-overlay[hidden] {
    display: none !important;
}

.report-generation-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483647 !important;
    display: none;
    place-items: center;
    padding: 24px;
    background: rgba(12, 17, 25, 0.82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    pointer-events: auto !important;
    user-select: none;
}

.report-generation-overlay.is-visible:not([hidden]) {
    display: grid !important;
}

.report-generation-card {
    width: min(420px, calc(100vw - 48px));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    box-sizing: border-box;
    padding: 34px 32px 30px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-top: 4px solid #ff6b1a;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
    text-align: center;
}

.report-generation-card strong {
    margin-top: 4px;
    color: #17202d;
    font-size: 1.18rem;
    line-height: 1.25;
}

.report-generation-card > span:last-child {
    max-width: 320px;
    color: #667085;
    font-size: 0.9rem;
    line-height: 1.55;
}

.report-generation-spinner {
    width: 52px;
    height: 52px;
    display: block;
    box-sizing: border-box;
    border: 5px solid #e7eaf0;
    border-top-color: #ff6b1a;
    border-right-color: #ff8a46;
    border-radius: 50%;
    animation: report-spinner-rotation 0.82s linear infinite;
}

.report-option.loading {
    pointer-events: none;
    opacity: 0.72;
}

@keyframes report-spinner-rotation {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .report-generation-spinner {
        animation-duration: 1.6s;
    }
}
