:root {
    --bg: #f6f4ef;
    --surface: #fffdf8;
    --surface-strong: #ffffff;
    --line: rgba(39, 37, 34, 0.12);
    --ink: #272522;
    --muted: #716b61;
    --sidebar: #211d19;
    --sidebar-soft: #2d2720;
    --brand: #b9652a;
    --brand-deep: #8d431d;
    --sage: #3f8068;
    --teal: #247a8d;
    --gold: #c99524;
    --danger: #b94f42;
    --shadow: 0 18px 36px rgba(48, 38, 25, 0.10);
    --radius: 8px;
    --radius-sm: 8px;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    font-size: 16px;
    overflow-x: clip;
}

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: clip;
    color: var(--ink);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(180deg, #fbfaf6 0%, var(--bg) 100%);
}

img,
video,
canvas {
    max-width: 100%;
}

a {
    color: inherit;
}

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

.auth-body {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 16% 12%, rgba(36, 122, 141, 0.16), transparent 28rem),
        radial-gradient(circle at 92% 88%, rgba(185, 101, 42, 0.18), transparent 26rem),
        var(--bg);
}

.auth-page {
    width: min(100%, 440px);
}

.auth-card,
.card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 253, 248, 0.96);
    box-shadow: var(--shadow);
}

.auth-card {
    padding: 28px;
}

.auth-footer {
    margin: 14px 0 0;
    color: rgba(39, 37, 34, 0.58);
    font-size: 0.82rem;
    font-weight: 700;
    text-align: center;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.auth-brand span,
.section-kicker,
.topbar-kicker,
.sidebar-label {
    color: var(--brand-deep);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-brand h1,
.topbar h1,
.hero-copy h2,
.card-header h2 {
    margin: 0;
    letter-spacing: 0;
}

.auth-brand h1 {
    margin-top: 3px;
    font-size: 1.8rem;
}

.auth-lead,
.card-header p,
.hero-copy p,
.muted-text,
.empty-state p,
.metric-card p,
.list-row span {
    color: var(--muted);
    line-height: 1.55;
}

.form-stack {
    display: grid;
    gap: 10px;
}

label {
    color: var(--ink);
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    min-height: 46px;
    border: 1px solid rgba(39, 37, 34, 0.18);
    border-radius: var(--radius);
    padding: 10px 12px;
    background: #fff;
    color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(36, 122, 141, 0.65);
    box-shadow: 0 0 0 4px rgba(36, 122, 141, 0.12);
}

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 0;
    border-radius: var(--radius-sm);
    color: var(--muted);
    background: transparent;
    cursor: pointer;
}

.password-toggle:hover,
.password-toggle[aria-pressed="true"] {
    color: var(--brand-deep);
    background: rgba(185, 101, 42, 0.10);
}

.password-toggle svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 0.94rem;
}

.check-row input {
    width: 17px;
    min-height: 17px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    min-height: 42px;
    border: 0;
    border-radius: var(--radius);
    padding: 10px 15px;
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-deep));
    font-weight: 800;
    text-decoration: none;
    text-align: center;
    white-space: normal;
    cursor: pointer;
}

.button:hover {
    filter: brightness(0.98);
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.62;
}

.button-secondary {
    background: linear-gradient(135deg, var(--teal), #155f70);
}

.button-muted {
    background: #6e665d;
}

.button-danger {
    background: linear-gradient(135deg, var(--danger), #87362e);
}

.button-full {
    width: 100%;
}

.alert {
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 14px;
    font-weight: 700;
}

.alert-danger {
    color: #8f3129;
    background: #fdebea;
}

.alert-success {
    color: #1f694f;
    background: #e7f5ed;
}

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

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    min-width: 0;
    flex-direction: column;
    color: rgba(255, 253, 248, 0.88);
    background: var(--sidebar);
}

.sidebar-backdrop {
    display: none;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 72px;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid rgba(255, 253, 248, 0.22);
    background: #fff;
    font-weight: 900;
}

.brand-mark-large {
    width: 72px;
    height: 58px;
    border-color: var(--line);
}

.auth-brand .brand-mark-large {
    border-color: transparent;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.brand-logo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-copy {
    display: grid;
    min-width: 0;
}

.brand-copy strong {
    overflow: hidden;
    color: #fff;
    font-size: 1.02rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-copy span,
.user-mini span {
    overflow: hidden;
    color: rgba(255, 253, 248, 0.62);
    font-size: 0.82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 14px 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

.sidebar-scroll::-webkit-scrollbar {
    width: 8px;
}

.sidebar-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
}

.sidebar-section + .sidebar-section {
    margin-top: 12px;
}

.sidebar-label {
    margin: 8px 8px 10px;
    color: rgba(255, 253, 248, 0.46);
}

.sidebar-nav {
    display: grid;
    gap: 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    border-radius: var(--radius);
    padding: 9px 10px;
    color: rgba(255, 253, 248, 0.82);
    text-decoration: none;
}

.sidebar-link:hover,
.sidebar-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-link.active {
    box-shadow: inset 3px 0 0 var(--brand);
}

.sidebar-icon {
    display: grid;
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-icon svg {
    width: 17px;
    height: 17px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sidebar-footer {
    display: grid;
    gap: 12px;
    padding: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.user-mini {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.user-mini strong {
    overflow: hidden;
    color: #fff;
    font-size: 0.88rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logout-button {
    width: 100%;
    min-height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius);
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    font-weight: 800;
    cursor: pointer;
}

.main-shell {
    width: 100%;
    min-width: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 72px;
    padding: 14px 22px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 253, 248, 0.94);
    backdrop-filter: blur(8px);
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.topbar h1 {
    overflow: hidden;
    max-width: 52vw;
    font-size: 1.2rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-pill {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    min-height: 34px;
    border-radius: 999px;
    padding: 7px 12px;
    color: var(--ink);
    background: #eee8dc;
    font-size: 0.88rem;
    font-weight: 800;
}

.topbar-pill-strong {
    color: #fff;
    background: var(--sidebar-soft);
}

.sidebar-toggle {
    display: none;
    width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    cursor: pointer;
}

.sidebar-toggle span,
.sidebar-toggle::before,
.sidebar-toggle::after {
    content: "";
    display: block;
    width: 16px;
    height: 2px;
    margin: 4px auto;
    border-radius: 999px;
    background: var(--ink);
}

.content-shell {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 22px;
}

.page-stack {
    display: grid;
    min-width: 0;
    gap: 16px;
}

.card {
    min-width: 0;
    padding: 18px;
    overflow-wrap: anywhere;
}

.card-header {
    margin-bottom: 14px;
}

.card-header h2 {
    color: var(--ink);
    font-size: 1.08rem;
}

.card-header p {
    margin: 6px 0 0;
}

.hero-card {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background:
        linear-gradient(135deg, rgba(36, 122, 141, 0.12), transparent 38%),
        var(--surface);
}

.hero-copy {
    min-width: 0;
    max-width: 720px;
}

.hero-copy h2 {
    margin-top: 4px;
    font-size: 1.7rem;
}

.hero-copy p {
    margin: 8px 0 0;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

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

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

.metric-card {
    min-width: 0;
    min-height: 150px;
    border-radius: var(--radius);
    padding: 16px;
    color: #fff;
    box-shadow: var(--shadow);
}

.metric-card span {
    font-weight: 800;
}

.metric-card strong {
    display: block;
    margin-top: 14px;
    font-size: 2rem;
    line-height: 1.1;
}

.metric-card p {
    margin: 10px 0 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.92rem;
}

.metric-teal {
    background: linear-gradient(135deg, var(--teal), #155f70);
}

.metric-sage {
    background: linear-gradient(135deg, var(--sage), #2f684f);
}

.metric-gold {
    background: linear-gradient(135deg, var(--gold), #a87418);
}

.metric-rust {
    background: linear-gradient(135deg, var(--brand), var(--brand-deep));
}

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

.list-row {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
    background: var(--surface-strong);
}

.list-row + .list-row {
    margin-top: 10px;
}

.list-row strong,
.list-row span {
    display: block;
}

.row-side {
    display: grid;
    min-width: 0;
    justify-items: end;
    gap: 8px;
    text-align: right;
}

.card-action-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 14px;
}

.badge {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    min-height: 28px;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 0.78rem;
    font-weight: 900;
}

.badge-success {
    color: #1f694f;
    background: #e5f4ec;
}

.badge-warning {
    color: #7b5b13;
    background: #fff3cd;
}

.badge-info {
    color: #155f70;
    background: #e2f3f6;
}

.badge-danger {
    color: #8f3129;
    background: #fdebea;
}

.badge-neutral {
    color: var(--ink);
    background: #eee8dc;
}

.module-grid {
    display: grid;
    min-width: 0;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
    gap: 12px;
}

.module-tile {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 13px 14px;
    background: linear-gradient(135deg, #fff, rgba(237, 231, 220, 0.52));
    color: var(--ink);
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(38, 31, 24, 0.04);
    transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.module-tile:hover {
    border-color: rgba(36, 122, 141, 0.42);
    box-shadow: 0 14px 28px rgba(38, 31, 24, 0.08);
    transform: translateY(-1px);
}

.module-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: var(--ink);
    color: #f7efe1;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.04em;
}

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

.module-copy strong {
    font-size: 0.98rem;
}

.module-copy small {
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.35;
}

.report-export-panel {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr);
    gap: 18px;
    align-items: start;
}

.export-note {
    border: 1px solid rgba(172, 116, 69, 0.24);
    border-radius: var(--radius-sm);
    padding: 14px;
    background: linear-gradient(135deg, rgba(243, 229, 212, 0.72), rgba(255, 255, 255, 0.84));
}

.export-note strong,
.export-note p {
    display: block;
}

.export-note p {
    margin: 6px 0 0;
    color: var(--muted);
}

.sheet-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.sheet-list span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border-radius: 999px;
    padding: 5px 10px;
    background: rgba(30, 52, 55, 0.08);
    color: var(--ink);
    font-size: 0.78rem;
    font-weight: 800;
}

.proof-management-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.proof-management-grid form {
    min-width: min(100%, 260px);
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: end;
    justify-content: space-between;
}

.toolbar form,
.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: end;
}

.toolbar > *,
.toolbar form > *,
.inline-actions > * {
    min-width: min(100%, 180px);
}

.toolbar .button,
.toolbar button,
.toolbar a.button,
.inline-actions .button,
.inline-actions button,
.inline-actions a.button {
    min-width: 0;
}

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

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

.form-full {
    grid-column: 1 / -1;
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.link-button {
    border: 0;
    padding: 0;
    color: var(--brand-deep);
    background: transparent;
    font-weight: 800;
    cursor: pointer;
}

.link-button-danger {
    color: #9d332b;
}

.action-menu {
    position: relative;
    display: inline-block;
}

.action-menu summary {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 7px 11px;
    color: var(--ink);
    background: #fff;
    font-weight: 800;
    cursor: pointer;
    list-style: none;
}

.action-menu summary::-webkit-details-marker {
    display: none;
}

.action-menu summary::after {
    content: "";
    width: 7px;
    height: 7px;
    margin-left: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
}

.action-menu[open] summary {
    border-color: rgba(36, 122, 141, 0.42);
    box-shadow: 0 0 0 4px rgba(36, 122, 141, 0.1);
}

.action-menu-list {
    position: absolute;
    right: 0;
    z-index: 20;
    display: grid;
    min-width: 190px;
    gap: 2px;
    margin-top: 7px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 6px;
    background: var(--surface-strong);
    box-shadow: var(--shadow);
}

.action-menu-list a,
.action-menu-list button {
    width: 100%;
    min-height: 34px;
    border: 0;
    border-radius: 6px;
    padding: 8px 9px;
    color: var(--ink);
    background: transparent;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 800;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.action-menu-list a:hover,
.action-menu-list button:hover {
    background: #f2ece2;
}

.action-menu-list .danger-action {
    color: #9d332b;
}

.text-right {
    text-align: right;
}

.summary-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
    gap: 10px;
}

.summary-strip span {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px 12px;
    background: #fff;
    font-weight: 800;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 14px;
}

.pagination nav {
    width: 100%;
}

.table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

table {
    width: 100%;
    min-width: 640px;
    border-collapse: collapse;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 11px 10px;
    text-align: left;
    vertical-align: top;
    overflow-wrap: anywhere;
}

th {
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

tfoot th {
    background: rgba(172, 116, 69, 0.1);
    color: var(--text);
    font-size: 0.82rem;
}

.empty-state {
    border: 1px dashed rgba(39, 37, 34, 0.2);
    border-radius: var(--radius);
    padding: 14px;
    background: rgba(255, 255, 255, 0.62);
}

.empty-state p {
    margin: 4px 0 0;
}

.clean-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding-left: 19px;
}

.clean-list li {
    line-height: 1.5;
}

.confirm-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(22, 18, 14, 0.58);
    backdrop-filter: blur(4px);
}

body.modal-open {
    overflow: hidden;
}

.confirm-modal {
    width: min(100%, 460px);
    max-height: calc(100vh - 36px);
    overflow: auto;
    border: 1px solid rgba(255, 253, 248, 0.18);
    border-radius: var(--radius);
    background: var(--surface-strong);
    box-shadow: 0 22px 60px rgba(22, 18, 14, 0.28);
}

.confirm-modal-header {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 18px;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(36, 122, 141, 0.2), transparent 42%),
        linear-gradient(135deg, var(--sidebar), var(--sidebar-soft));
}

.confirm-modal-icon {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    border: 2px solid rgba(255, 253, 248, 0.46);
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--danger));
    font-weight: 900;
}

.confirm-modal-header p {
    margin: 0 0 3px;
    color: rgba(255, 253, 248, 0.68);
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.confirm-modal-header h2 {
    margin: 0;
    font-size: 1.08rem;
    letter-spacing: 0;
}

.confirm-modal-body {
    padding: 18px 18px 4px;
}

.confirm-modal-body p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
    white-space: pre-line;
}

.confirm-phrase-wrap {
    display: grid;
    gap: 7px;
    margin-top: 14px;
}

.confirm-phrase-wrap input {
    border-color: rgba(143, 49, 41, 0.34);
    background: #fff;
}

.confirm-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    padding: 18px;
}

.image-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(22, 18, 14, 0.68);
    backdrop-filter: blur(4px);
}

.image-modal {
    width: min(100%, 720px);
    max-height: calc(100vh - 36px);
    overflow: auto;
    border-radius: var(--radius);
    background: var(--surface-strong);
    box-shadow: 0 22px 60px rgba(22, 18, 14, 0.3);
}

.image-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    color: #fff;
    background: linear-gradient(135deg, var(--sidebar), var(--sidebar-soft));
}

.image-modal-header h2 {
    margin: 0;
    font-size: 1rem;
}

.image-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.image-modal-body {
    padding: 14px;
}

.image-modal-body img {
    display: block;
    width: 100%;
    max-height: 72vh;
    object-fit: contain;
    border-radius: var(--radius);
    background: #111;
}

.proof-card {
    display: none;
    margin-top: 16px;
}

.proof-card.is-visible {
    display: block;
}

.camera-box {
    display: grid;
    gap: 10px;
}

.camera-preview,
.proof-preview {
    width: 100%;
    max-height: 340px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    object-fit: contain;
    background: #16120e;
}

.camera-preview[hidden],
.proof-preview[hidden] {
    display: none;
}

.service-picker {
    display: grid;
    gap: 9px;
    margin-top: 16px;
}

.service-picker-rows {
    display: grid;
    gap: 8px;
}

.service-picker-head,
.service-picker-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 64px;
    gap: 9px;
    align-items: end;
}

.service-picker-head {
    padding: 0 10px 2px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.service-picker-row {
    border: 1px solid rgba(39, 37, 34, 0.10);
    border-radius: var(--radius);
    padding: 8px;
    background: rgba(255, 255, 255, 0.72);
}

.service-picker-field {
    display: grid;
    gap: 6px;
}

.service-picker-field label {
    display: none;
}

.service-picker-action {
    display: flex;
    justify-content: flex-end;
    min-height: 46px;
    align-items: center;
}

.service-picker-lock {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    border-radius: 999px;
    padding: 6px 10px;
    color: var(--muted);
    background: #eee8dc;
    font-size: 0.78rem;
    font-weight: 900;
}

.service-picker [data-service-add] {
    width: 100%;
    margin-top: 2px;
}

.icon-button {
    display: inline-grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 0;
    border-radius: var(--radius);
    color: #fff;
    background: #6e665d;
    font-weight: 900;
    cursor: pointer;
}

.danger-icon {
    background: linear-gradient(135deg, var(--danger), #87362e);
}

.receipt-body {
    margin: 0;
    min-height: 100vh;
    color: #171512;
    background: #eee9df;
}

.receipt-size-58mm {
    --receipt-width: 58mm;
    --receipt-padding: 9px;
    --receipt-font-size: 11px;
}

.receipt-size-80mm {
    --receipt-width: 80mm;
    --receipt-padding: 12px;
    --receipt-font-size: 12px;
}

.receipt-page {
    display: grid;
    min-height: 100vh;
    place-items: start center;
    gap: 14px;
    padding: 22px 12px;
}

.receipt-toolbar {
    display: flex;
    width: min(100%, 560px);
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.receipt-size-toggle {
    display: inline-flex;
    min-height: 42px;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 6px;
    background: #fffdf8;
    color: var(--muted);
    font-weight: 800;
}

.receipt-size-toggle a {
    border-radius: var(--radius-sm);
    padding: 6px 9px;
    color: var(--ink);
    text-decoration: none;
}

.receipt-size-toggle a.active {
    color: #fff;
    background: var(--brand-deep);
}

.receipt-paper {
    width: min(100%, var(--receipt-width));
    border: 1px solid rgba(23, 21, 18, 0.12);
    border-radius: var(--radius);
    padding: var(--receipt-padding);
    background: #fff;
    box-shadow: 0 16px 36px rgba(23, 21, 18, 0.16);
    color: #111;
    font-family: Consolas, "Courier New", monospace;
    font-size: var(--receipt-font-size);
    line-height: 1.35;
}

.receipt-header,
.receipt-footer {
    display: grid;
    gap: 3px;
    justify-items: center;
    text-align: center;
}

.receipt-header strong {
    font-size: 1.28em;
    letter-spacing: 0;
}

.receipt-lines,
.receipt-totals {
    display: grid;
    gap: 4px;
}

.receipt-lines div,
.receipt-totals div {
    display: grid;
    grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
    gap: 6px;
}

.receipt-lines span,
.receipt-totals span {
    color: #333;
}

.receipt-lines strong,
.receipt-totals strong {
    overflow-wrap: anywhere;
    text-align: right;
}

.receipt-divider {
    border-top: 1px dashed #111;
    margin: 9px 0;
}

.receipt-paper h1 {
    margin: 0 0 6px;
    font-size: 1em;
    letter-spacing: 0;
}

.receipt-items {
    display: grid;
    gap: 7px;
    margin: 0;
    padding-left: 18px;
}

.receipt-items li {
    padding-left: 2px;
}

.receipt-items strong,
.receipt-items span {
    display: block;
}

.receipt-items span:last-child {
    text-align: right;
}

.receipt-grand-total {
    border-top: 1px dashed #111;
    padding-top: 6px;
    font-size: 1.12em;
}

.receipt-footer {
    margin-top: 12px;
}

@media print {
    .no-print {
        display: none !important;
    }

    .receipt-body {
        min-height: 0;
        background: #fff;
    }

    .receipt-page {
        display: block;
        min-height: 0;
        padding: 0;
    }

    .receipt-paper {
        width: var(--receipt-width);
        max-width: none;
        border: 0;
        border-radius: 0;
        padding: var(--receipt-padding);
        box-shadow: none;
    }
}

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

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

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 30;
        display: block;
        pointer-events: none;
        background: rgba(22, 18, 14, 0.46);
        opacity: 0;
        transition: opacity 0.16s ease;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 40;
        width: min(86vw, 320px);
        transform: translateX(-100%);
        transition: transform 0.16s ease;
    }

    body.sidebar-open {
        overflow: hidden;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    body.sidebar-open .sidebar-backdrop {
        pointer-events: auto;
        opacity: 1;
    }

    .sidebar-toggle {
        display: block;
    }

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

@media (max-width: 900px) {
    .split-grid,
    .report-export-panel {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
        padding: 12px 14px;
    }

    .topbar-left,
    .topbar-right {
        width: 100%;
    }

    .topbar-right {
        flex-wrap: wrap;
    }

    .topbar h1 {
        max-width: calc(100vw - 90px);
        white-space: normal;
    }

    .content-shell {
        padding: 14px;
    }

    .hero-card,
    .split-grid,
    .list-row {
        grid-template-columns: 1fr;
    }

    .hero-card {
        display: grid;
    }

    .hero-actions,
    .hero-actions .button {
        width: 100%;
    }

    .card-action-row,
    .proof-management-grid {
        align-items: stretch;
    }

    .card-action-row .button,
    .proof-management-grid .button,
    .proof-management-grid form {
        width: 100%;
    }

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

    .toolbar,
    .toolbar form,
    .inline-actions {
        display: grid;
        width: 100%;
        grid-template-columns: 1fr;
        align-items: stretch;
        justify-content: stretch;
    }

    .toolbar > *,
    .toolbar form > *,
    .inline-actions > *,
    .toolbar .button,
    .toolbar button,
    .toolbar a.button,
    .inline-actions .button,
    .inline-actions button,
    .inline-actions a.button {
        width: 100%;
        min-width: 0;
    }

    .action-row {
        align-items: stretch;
    }

    .action-row > .button,
    .action-row > a.button,
    .action-row > button {
        width: 100%;
    }

    .service-picker-head {
        display: none;
    }

    .service-picker-row {
        grid-template-columns: 1fr;
        gap: 10px;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        padding: 12px;
        background: #fff;
    }

    .service-picker-field label {
        display: block;
    }

    .service-picker-action {
        justify-content: flex-start;
        min-height: 0;
    }

    .row-side {
        justify-items: start;
        text-align: left;
    }

    .action-menu {
        width: 100%;
    }

    .action-menu summary {
        justify-content: center;
        width: 100%;
    }

    .action-menu-list {
        position: static;
        min-width: 0;
        width: 100%;
        margin-top: 6px;
        box-shadow: none;
    }
}

@media (max-width: 560px) {
    .auth-card,
    .card {
        padding: 14px;
    }

    .metric-grid,
    .metric-grid-three {
        grid-template-columns: 1fr;
    }

    .auth-brand {
        align-items: flex-start;
    }

    .confirm-modal-actions .button {
        width: 100%;
    }

    .confirm-modal-backdrop,
    .image-modal-backdrop {
        padding: 12px;
    }

    .confirm-modal,
    .image-modal {
        width: calc(100vw - 24px);
        max-height: calc(100vh - 24px);
    }

    .image-modal-header {
        display: grid;
        align-items: start;
    }

    .image-modal-actions,
    .image-modal-actions .button {
        width: 100%;
    }
}
