:root {
    --bg-page: #f4f6f9;
    --bg-card: #ffffff;
    --border: #e8ecf2;
    --border-strong: #cfd6e4;
    --text: #1a2233;
    --text-muted: #64708b;
    --accent: #0f62fe;
    --accent-hover: #054ada;
    --accent-soft: #e8f1ff;
    --success-bg: #e7f7ef;
    --success-text: #146c43;
    --warn-bg: #fff4e5;
    --warn-text: #92400e;
    --danger-bg: #fdeaea;
    --danger-text: #991b1b;
    --header-bg: linear-gradient(135deg, #131c2f 0%, #1f2d4d 55%, #132337 100%);
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-card: 0 4px 28px rgba(26, 34, 51, 0.07), 0 2px 8px rgba(26, 34, 51, 0.04);
    --font: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    background: var(--bg-page);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.site-header {
    background: var(--header-bg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.navbar {
    max-width: 1320px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.03em;
    color: #f8fafc !important;
    margin-right: auto;
}

.brand:hover {
    opacity: 0.92;
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 12px;
}

.navbar .nav-links a:not(.btn) {
    color: rgba(248, 250, 252, 0.92);
    font-weight: 500;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
}

.navbar .nav-links a:not(.btn):hover {
    background: rgba(255, 255, 255, 0.08);
    text-decoration: none;
}

.navbar .nav-links a.is-active:not(.btn) {
    background: rgba(255, 255, 255, 0.12);
}

.navbar .btn.nav-cta {
    padding: 8px 16px;
    margin-left: 8px;
    font-size: 14px;
    box-shadow: none;
}

.container {
    max-width: 1680px;
    margin: 20px auto 48px;
    padding: 0 28px;
    flex: 1;
}

.site-footer {
    padding: 20px 24px 36px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

.site-footer .muted-code {
    background: rgba(148, 163, 184, 0.2);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 12px;
}

.card {
    background: var(--bg-card);
    border-radius: calc(var(--radius) + 2px);
    box-shadow: var(--shadow-card);
    padding: 26px 28px;
    margin-bottom: 28px;
    border: 1px solid rgba(226, 232, 242, 0.85);
}

.card.wide {
    max-width: none;
}

.form-page {
    border: 1px solid #dfe3ec;
    background: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
}

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

h1 {
    margin: 0 0 8px;
    font-size: clamp(26px, 4vw, 34px);
    letter-spacing: -0.035em;
    font-weight: 700;
}

h2.section-title {
    margin: 0 0 16px;
    font-size: 20px;
}

.lede,
.section-help {
    margin: 0;
    color: var(--text-muted);
}

.section-help {
    margin-bottom: 14px;
    font-size: 14px;
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
}

.detail-head {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.detail-head-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.detail-head-actions .inline-delete-form {
    display: inline-flex;
}

.btn.secondary.danger-outline {
    color: var(--danger-text) !important;
    border-color: rgba(153, 27, 27, 0.35);
}

.btn.secondary.danger-outline:hover {
    background: var(--danger-bg);
}

.search-bar {
    display: flex;
    gap: 10px;
    margin-top: 24px;
    align-items: stretch;
}

.search-bar input {
    flex: 1;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    padding: 10px 18px;
    font-family: inherit;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    text-decoration: none !important;
}

.btn.primary {
    background: var(--accent);
    color: #ffffff !important;
}

.btn.primary:hover {
    background: var(--accent-hover);
}

.btn.secondary {
    background: transparent;
    color: var(--accent) !important;
    border-color: rgba(15, 98, 254, 0.35);
}

.btn.secondary:hover {
    background: var(--accent-soft);
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-family: inherit;
    font-size: 14px;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

label {
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
}

.form-page .stack {
    margin-top: 8px;
}

.form-section {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 22px;
    margin: 0 0 24px;
    min-width: 0;
    max-width: 100%;
}

.form-section legend {
    font-weight: 700;
    padding: 0 8px;
    font-size: 15px;
}

.form-header-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px 18px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.field-span-file {
    grid-column: span 1;
}

.field-span-remarks {
    grid-column: 1 / -1;
}

.triplet-row {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px 18px;
}

.pricing-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px 18px;
    margin-top: 4px;
}

.readonly-input {
    background: #f1f5f9 !important;
    color: var(--text);
    cursor: default;
}

.meta-grid .pricing-meta-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: space-between;
    align-items: center;
    grid-column: 1 / -1;
    padding: 16px 18px !important;
    background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
    border: 1px solid var(--accent-soft);
}

.pricing-meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 120px;
}

.pricing-meta-item strong {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 700;
}

.pricing-meta-item span {
    font-size: 20px;
    font-weight: 700;
}

textarea {
    min-height: 72px;
    resize: vertical;
}

.hint {
    margin: 4px 0 0;
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
}

.picture-preview {
    margin-top: 10px;
}

.preview-thumb,
.list-thumb {
    display: block;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.preview-thumb {
    max-height: 140px;
    border: 1px solid var(--border);
}

.process-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.process-total-toolbar {
    justify-content: flex-end;
}

.process-bottom-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
    padding-left: 30px;
}

.process-bottom-actions .btn {
    white-space: nowrap;
}

.process-total-inline {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.process-total-inline #process_total {
    font-size: 20px;
}

.muted {
    color: var(--text-muted);
    font-size: 14px;
}

.process-layout {
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.process-side-actions {
    flex: 0 0 24px;
    display: flex;
    flex-direction: column;
    padding-top: 0;
}

.process-side-head-spacer {
    height: 40px;
    flex-shrink: 0;
}

.process-side-btn-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 58px;
    box-sizing: border-box;
}

.process-side-btn-wrap .btn-icon-remove {
    width: 22px;
    height: 22px;
    min-width: 22px;
    font-size: 15px;
    line-height: 1;
    border-radius: 5px;
}

.process-table-wrap {
    flex: 1;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
}

.process-table {
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
    table-layout: fixed;
}

.process-table col.col-process {
    width: 18.4%;
}

.process-table col.col-qty,
.process-table col.col-rate,
.process-table col.col-amount {
    width: 5.4%;
}

.process-table col.col-attr-dropdown {
    width: 9.2%;
}

.process-table col.col-vendor,
.process-table col.col-dropdown {
    width: 8.2%;
}

.process-table col.col-remarks {
    width: 11.2%;
}

.process-detail-table {
    min-width: 0;
}

.process-detail-table col.col-process {
    width: 18%;
}

.process-detail-table col.col-qty {
    width: 12%;
}

.process-detail-table col.col-dropdown {
    width: 7%;
}

.process-detail-table col.col-rate,
.process-detail-table col.col-amount {
    width: 9%;
}

.process-detail-table col.col-remarks {
    width: 10%;
}

.process-table th,
.process-table td {
    border-bottom: 1px solid var(--border);
    padding: 6px 4px;
    text-align: left;
    vertical-align: top;
    overflow: hidden;
}

.process-table thead th {
    background: #f7f9fc;
    font-size: 10px;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 700;
    color: var(--text-muted);
    white-space: normal;
    line-height: 1.2;
    text-align: center;
    vertical-align: bottom;
    padding: 6px 3px;
    word-break: break-word;
}

.process-table tbody tr.data-row {
    background: #fff;
}

.process-table tbody tr.data-row:hover {
    background: #fafbfd;
}

.process-table tr:last-child td {
    border-bottom: none;
}

.process-pick {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.process-pick-value {
    display: -webkit-box;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text);
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal;
    word-break: break-word;
    min-height: 24px;
    max-height: 24px;
}

.process-pick-value.is-empty {
    color: var(--text-muted);
    font-weight: 500;
}

.process-table select,
.process-table input[type="text"],
.process-table input[type="number"] {
    width: 100%;
    min-width: 0;
    min-height: 30px;
    padding: 5px 6px;
    font-size: 12px;
    border-radius: 5px;
}

.process-table .col-qty input,
.process-table .col-rate input,
.process-table .col-amount input {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-height: 32px;
    padding: 5px 2px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
}

.process-table select {
    padding-right: 1.25rem;
    cursor: pointer;
}

.form-page .process-table .col-attr-dropdown .process-pick-value {
    display: block;
    font-size: 9px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
    min-width: 7ch;
    min-height: 24px;
    max-height: 24px;
}

.form-page .process-table .col-attr-dropdown select {
    font-size: 9px;
    padding: 4px 3px;
    padding-right: 1.1rem;
}

.process-table .readonly-input {
    background: #f1f5f9;
    font-weight: 600;
}

.process-detail-table .process-cell-value {
    display: block;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.process-detail-table .col-remarks .process-cell-value {
    white-space: normal;
    word-break: break-word;
}

.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.table-rounded {
    border-radius: var(--radius);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 960px;
}

.data-table.process-detail-table,
.data-table.process-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}

.data-table th,
.data-table td,
.process-table th,
.process-table td {
    border-bottom: 1px solid var(--border);
    padding: 12px 14px;
    text-align: left;
    vertical-align: middle;
}

.data-table th,
.process-table thead th {
    background: #f7f9fc;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: var(--text-muted);
}

.data-table tr:last-child td,
.process-table tr:last-child td {
    border-bottom: none;
}

.form-page .process-table th,
.form-page .process-table td {
    padding: 6px 3px;
    vertical-align: top;
    overflow: hidden;
}

.form-page .process-table tbody td.col-qty,
.form-page .process-table tbody td.col-rate,
.form-page .process-table tbody td.col-amount,
.form-page .process-table tbody td.col-remarks {
    padding-top: 33px;
}

.form-page .process-table thead th {
    font-size: 10px;
    text-transform: none;
    letter-spacing: 0;
    text-align: center;
    vertical-align: bottom;
    line-height: 1.2;
    word-break: break-word;
    white-space: normal;
}

.col-action {
    width: auto;
    min-width: 132px;
}

.col-action-cell {
    width: 48px;
    text-align: center;
    vertical-align: middle;
}

.process-table .btn-icon-remove {
    width: 30px;
    height: 30px;
    font-size: 18px;
}

.btn-icon-remove {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: #fff;
    color: var(--text-muted);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-icon-remove:hover {
    background: var(--danger-bg);
    color: var(--danger-text);
    border-color: #f2c4c4;
}

.td-thumb {
    width: 72px;
}

.thumb-button {
    border: none;
    background: transparent;
    padding: 0;
    cursor: zoom-in;
}

.list-thumb {
    width: 56px;
    height: 56px;
}

.thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: #f1f5f9;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 14px;
}

.td-link {
    min-width: 200px;
    white-space: nowrap;
}

.inline-delete-form {
    display: inline;
    margin: 0;
    padding: 0;
}

button.table-link {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
    color: var(--accent);
}

button.table-link.danger {
    color: var(--danger-text);
}

button.table-link:hover {
    text-decoration: underline;
}

.table-link {
    font-weight: 600;
}

.empty {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 16px !important;
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 18px;
    font-weight: 500;
}

.alert.success {
    background: var(--success-bg);
    color: var(--success-text);
}

.alert.warning {
    background: var(--warn-bg);
    color: var(--warn-text);
}

.alert.danger {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(200px, 280px) 1fr;
    gap: 28px;
    margin-top: 24px;
    align-items: start;
}

.detail-photo-panel {
    position: sticky;
    top: 16px;
}

.detail-photo {
    width: 100%;
    max-height: 320px;
    object-fit: contain;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: #f8fafc;
}

.detail-photo-placeholder {
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    padding: 48px 16px;
    text-align: center;
    color: var(--text-muted);
    background: #fafbfc;
}

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

.meta-grid > div {
    background: #f8fafc;
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    border: 1px solid var(--border);
}

.meta-grid dt {
    margin: 0 0 6px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: var(--text-muted);
}

.meta-grid dd {
    margin: 0;
    font-weight: 500;
    word-break: break-word;
}

.meta-span-2 {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 8px;
}

.auth-card {
    max-width: 520px;
    margin: 0 auto 28px;
}

.auth-hero {
    background: radial-gradient(1200px 260px at 70% 10%, rgba(108, 99, 255, 0.25), transparent), #121532;
    border-radius: 16px;
    padding: 34px 26px 110px;
    color: #eef1ff;
    text-align: center;
    margin-bottom: -80px;
    border: 1px solid rgba(164, 170, 255, 0.2);
}

.auth-hero h1 {
    color: #ffffff;
    margin: 14px 0 8px;
}

.auth-chip {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0;
}

.auth-card-pro {
    position: relative;
    z-index: 2;
    border-top: 4px solid #6558df;
}

.auth-card-pro h2 {
    margin: 0 0 8px;
    font-size: 42px;
    letter-spacing: -0.03em;
}

.auth-form {
    margin-top: 18px;
}

.btn-block {
    width: 100%;
}

.auth-footnote {
    margin-top: 16px;
}

.dashboard-stats {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.dashboard-stats.compact {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    margin-bottom: 20px;
}

.master-page .header-row {
    margin-bottom: 0;
}

.master-page-head {
    margin-bottom: 8px;
}

.master-picker-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.master-picker-label {
    font-weight: 600;
    font-size: 14px;
}

.master-picker-select {
    min-width: min(100%, 280px);
    max-width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-family: inherit;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
}

.master-active-title {
    margin-bottom: 8px;
}

.master-editor-grid {
    display: grid;
    grid-template-columns: minmax(0, 12rem) minmax(0, 1fr);
    gap: 16px 28px;
    align-items: start;
}

.master-builtin-panel {
    min-width: 0;
}

.master-custom-panel {
    min-width: 0;
}

.master-builtin-scroll {
    max-height: min(380px, 50vh);
    overflow-y: auto;
    overflow-x: hidden;
}

.master-builtin-table th,
.master-builtin-table td,
.master-builtin-table .master-builtin-cell {
    padding: 7px 10px;
    font-size: 13px;
}

.master-custom-wrap {
    overflow-x: auto;
}

.master-custom-table {
    table-layout: fixed;
    width: 100%;
}

.master-custom-value-cell {
    word-break: break-word;
    vertical-align: top;
    min-width: 0;
}

.master-custom-actions-cell {
    min-width: 10rem;
    width: 28%;
    max-width: 220px;
    vertical-align: top;
}

th.col-action-wide {
    width: 28%;
    max-width: 220px;
}

.readonly-value {
    display: block;
    padding: 8px 4px 8px 0;
    font-size: 14px;
    line-height: 1.45;
    color: var(--text);
}

.row-readonly-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
}

.vendors-add-bar {
    margin-bottom: 16px;
}

.vendors-csv-bar {
    margin-top: 4px;
}

.vendors-table {
    table-layout: fixed;
    width: 100%;
}

.vendors-actions-cell {
    vertical-align: middle;
    min-width: 10rem;
}

.master-subtitle {
    margin: 0 0 10px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-muted);
}

.master-add-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
    align-items: stretch;
}

.master-add-bar input[type="text"] {
    flex: 1;
    min-width: 160px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-family: inherit;
    font-size: 14px;
}

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

.master-inline-form input[type="text"] {
    flex: 1;
    min-width: 120px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-family: inherit;
    font-size: 14px;
}

th.col-narrow,
td.col-narrow {
    width: 88px;
    white-space: nowrap;
}

.stat-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
    color: var(--text-muted);
    font-size: 13px;
}

.stat-value {
    font-size: 26px;
    line-height: 1;
}

.step-pill {
    margin-left: 8px;
    padding: 2px 8px;
    border: 1px solid #d5dbff;
    color: #564ac7;
    font-size: 11px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(18, 21, 50, 0.52);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 16px;
}

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

.modal-card {
    width: 100%;
    max-width: 460px;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #dee3f5;
    box-shadow: 0 18px 60px rgba(18, 21, 50, 0.24);
    padding: 20px;
}

.modal-title {
    margin: 0 0 4px;
    font-size: 20px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
}

.image-lightbox-card {
    max-width: min(92vw, 980px);
    padding: 10px;
    position: relative;
}

.lightbox-image {
    display: block;
    width: 100%;
    max-height: 82vh;
    object-fit: contain;
    border-radius: 10px;
}

.lightbox-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.72);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

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

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

@media (max-width: 768px) {
    .pricing-summary-grid {
        grid-template-columns: 1fr;
    }

    .meta-grid .pricing-meta-bar {
        flex-direction: column;
        align-items: flex-start;
    }

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

    .detail-layout {
        grid-template-columns: 1fr;
    }

    .detail-photo-panel {
        position: static;
    }

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

    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .dashboard-stats.compact {
        grid-template-columns: 1fr 1fr;
    }

    .search-bar {
        flex-direction: column;
    }

    .header-row,
    .detail-head {
        flex-direction: column;
    }

    .master-editor-grid {
        grid-template-columns: 1fr;
    }

    .master-builtin-scroll {
        max-height: 220px;
    }

    .pdf-checkbox-grid {
        grid-template-columns: 1fr;
    }

    .pdf-settings-head {
        flex-direction: column;
    }

    .pdf-settings-back {
        align-self: stretch;
        justify-content: center;
    }
}

/* PDF export settings */
.pdf-settings-page .pdf-settings-head {
    align-items: flex-start;
    gap: 20px;
}

.pdf-settings-back {
    flex-shrink: 0;
    align-self: flex-start;
}

.pdf-settings-page .lede {
    max-width: 52rem;
}

.pdf-callout {
    margin: 18px 0 0;
    max-width: 52rem;
    padding: 14px 18px;
    background: var(--accent-soft);
    border: 1px solid rgba(15, 98, 254, 0.22);
    border-radius: var(--radius-sm);
    font-size: 14px;
    line-height: 1.55;
    color: var(--text);
}

.pdf-callout strong {
    color: var(--text);
}

.pdf-settings-form {
    margin-top: 8px;
}

.pdf-fieldset .section-help {
    margin-top: 2px;
    margin-bottom: 0;
}

.pdf-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.pdf-check {
    display: grid;
    grid-template-columns: 1.25rem 1fr;
    column-gap: 12px;
    row-gap: 2px;
    align-items: start;
    margin: 0;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fafbfd;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    line-height: 1.4;
}

.pdf-check:hover {
    border-color: rgba(15, 98, 254, 0.35);
    box-shadow: 0 2px 10px rgba(26, 34, 51, 0.06);
}

.pdf-check:has(input:checked) {
    border-color: rgba(15, 98, 254, 0.45);
    background: #ffffff;
    box-shadow: 0 0 0 1px rgba(15, 98, 254, 0.14);
}

.pdf-check input[type="checkbox"] {
    width: 1.125rem;
    height: 1.125rem;
    margin: 0.2rem 0 0;
    accent-color: var(--accent);
    cursor: pointer;
    flex-shrink: 0;
}

.pdf-check-label {
    display: block;
    font-weight: 500;
    font-size: 14px;
    line-height: 1.4;
    padding-top: 1px;
}

.pdf-form-actions {
    margin-top: 4px;
    padding-top: 22px;
    border-top: 1px solid var(--border);
    justify-content: flex-end;
}

.pdf-form-actions .btn.primary {
    min-width: 168px;
    padding: 12px 24px;
    font-size: 15px;
}

.td-pdf {
    width: 52px;
    text-align: center;
}

th.col-pdf {
    width: 52px;
    text-align: center;
}
