:root {
  color-scheme: light;
  --ink: #15231e;
  --muted: #66736e;
  --line: #dce5e0;
  --green: #08765a;
  --green-deep: #064b3a;
  --cream: #f7f4ec;
  --gold: #d6a642;
  --danger: #a32828;
  --white: #fff;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: #edf2ef; }
body { min-height: 100vh; margin: 0; color: var(--ink); background: linear-gradient(145deg, #f9fbf9, #edf2ef 58%, #e7efeb); }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.owner-login { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: radial-gradient(circle at 20% 0%, rgba(214,166,66,.22), transparent 28rem), linear-gradient(145deg, #0c6b52, #073f32); }
.owner-login-card { width: min(520px, 100%); padding: 44px; border: 1px solid rgba(255,255,255,.14); border-radius: 30px; background: rgba(255,255,255,.98); box-shadow: 0 36px 100px rgba(0,24,17,.35); }
.owner-brand { display: inline-flex; align-items: center; gap: 12px; color: var(--green-deep); font-size: 20px; font-weight: 850; text-decoration: none; }
.owner-brand img { width: 42px; height: 42px; object-fit: contain; border-radius: 12px; }
.owner-eyebrow { display: block; margin-top: 42px; color: var(--green); font-size: 12px; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
.owner-login h1, .owner-header h1, .owner-menu-intro h2, .panel-heading h2 { margin: 10px 0; font-family: Georgia, "Times New Roman", serif; font-weight: 500; letter-spacing: -.04em; }
.owner-login h1 { font-size: clamp(48px, 9vw, 74px); line-height: .95; }
.owner-login > section > p { color: var(--muted); line-height: 1.65; }
.owner-login form { display: grid; gap: 16px; margin-top: 30px; }
.owner-login label { display: grid; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 750; }
.owner-login input, .filter-bar input, .filter-bar select { min-height: 50px; border: 1px solid var(--line); border-radius: 13px; background: #fff; color: var(--ink); padding: 0 15px; outline: none; }
.owner-login input:focus, .filter-bar input:focus, .filter-bar select:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(8,118,90,.1); }
.primary-button, .secondary-button, .danger-button, .ghost-button, .load-more { min-height: 44px; border: 0; border-radius: 12px; padding: 0 17px; font-weight: 800; }
.primary-button { color: #fff; background: var(--green); }
.primary-button:hover { background: var(--green-deep); }
.primary-button.compact { min-height: 50px; }
.secondary-button { color: var(--green-deep); background: #e8f2ee; }
.danger-button { color: var(--danger); background: #f8e9e9; }
.danger-solid { color: #fff; background: var(--danger); }
.ghost-button { border: 1px solid var(--line); color: var(--ink); background: #fff; }
.back-link { display: inline-block; margin-top: 26px; color: var(--muted); text-decoration: none; }
.form-status, .panel-status { min-height: 22px; margin: 0; color: var(--muted); font-size: 14px; }
.form-status[data-state="error"], .panel-status[data-state="error"] { color: var(--danger); }
.form-status[data-state="success"], .panel-status[data-state="success"] { color: var(--green); }

.owner-app { width: min(1480px, calc(100% - 40px)); margin: 0 auto; padding: 28px 0 70px; }
.owner-header { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; padding: 18px 0 26px; }
.owner-header-copy { text-align: center; }
.owner-header-copy span { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.owner-header h1 { margin: 3px 0 0; font-size: 32px; }
.owner-header > button { justify-self: end; }
.owner-section-menu { padding: 48px 0 34px; }
.owner-menu-intro { max-width: 650px; margin: 0 auto; text-align: center; }
.owner-menu-intro .owner-eyebrow { margin: 0; }
.owner-menu-intro h2 { font-size: clamp(44px, 6vw, 64px); line-height: .98; }
.owner-menu-intro p { margin: 0; color: var(--muted); font-size: 16px; }
.owner-section-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); justify-content: center; gap: 18px; margin-top: 42px; }
.owner-section-card { --card-accent: var(--green); position: relative; min-height: 260px; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: 30px; border: 1px solid rgba(21,35,30,.1); border-radius: 24px; color: var(--ink); background: #fff; box-shadow: 0 16px 40px rgba(24,50,40,.08); text-align: left; isolation: isolate; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.owner-section-card::before { position: absolute; z-index: -1; top: 0; left: 0; width: 100%; height: 5px; content: ""; background: var(--card-accent); }
.owner-section-card::after { position: absolute; z-index: -1; top: -105px; right: -80px; width: 260px; height: 260px; border-radius: 50%; content: ""; background: color-mix(in srgb, var(--card-accent) 10%, transparent); }
.owner-section-card.is-contacts { --card-accent: #397fa3; }
.owner-section-card.is-hotels { --card-accent: #c38a22; }
.owner-section-card.is-companies { --card-accent: #6548a9; }
.owner-section-card.is-finance { --card-accent: #b44d63; }
.owner-section-card.is-jewelry { --card-accent: #b07916; }
.owner-section-card.is-sunglasses { --card-accent: #2d708b; }
.owner-section-card.is-bags { --card-accent: #9a5b36; }
.owner-section-card.is-add-product { --card-accent: #1f6fb2; }
.owner-section-card.is-documents { --card-accent: #5369a8; }
.owner-section-card:hover { transform: translateY(-5px); border-color: color-mix(in srgb, var(--card-accent) 38%, #dce5e0); box-shadow: 0 24px 54px rgba(24,50,40,.14); }
.owner-section-card:focus-visible { outline: 4px solid color-mix(in srgb, var(--card-accent) 24%, transparent); outline-offset: 3px; }
.owner-section-number { position: absolute; top: 25px; right: 28px; color: color-mix(in srgb, var(--card-accent) 55%, #aeb7b3); font-size: 13px; font-weight: 900; letter-spacing: .16em; }
.owner-section-icon { width: 64px; height: 64px; display: grid; place-items: center; border: 1px solid color-mix(in srgb, var(--card-accent) 18%, #dce5e0); border-radius: 18px; color: var(--card-accent); background: color-mix(in srgb, var(--card-accent) 9%, #fff); }
.owner-section-icon svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.9; }
.owner-section-copy { display: grid; gap: 10px; margin-top: 42px; }
.owner-section-copy strong { font-size: clamp(32px, 4vw, 46px); line-height: .95; letter-spacing: -.045em; }
.owner-section-card.is-companies .owner-section-copy strong { max-width: 220px; font-size: clamp(24px, 2.4vw, 34px); line-height: 1; }
.owner-section-card.is-finance .owner-section-copy strong { max-width: 220px; font-size: clamp(25px, 2.4vw, 35px); line-height: 1; }
.owner-section-card.is-jewelry .owner-section-copy strong { max-width: 240px; font-size: clamp(28px, 3vw, 40px); line-height: 1; }
.owner-section-card.is-sunglasses .owner-section-copy strong { max-width: 240px; font-size: clamp(26px, 2.8vw, 38px); line-height: 1; }
.owner-section-card.is-bags .owner-section-copy strong { max-width: 240px; font-size: clamp(28px, 3vw, 40px); line-height: 1; }
.owner-section-card.is-add-product .owner-section-copy strong { max-width: 240px; font-size: clamp(28px, 3vw, 40px); line-height: 1; }
.owner-section-card.is-documents .owner-section-copy strong { max-width: 240px; font-size: clamp(28px, 3vw, 40px); line-height: 1; }
.owner-section-copy > span { color: var(--muted); font-size: 13px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.owner-section-arrow { position: absolute; right: 30px; bottom: 30px; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: #fff; background: var(--card-accent); font-size: 20px; }
.owner-panel { padding: 28px; border: 1px solid rgba(21,35,30,.09); border-radius: 26px; background: rgba(255,255,255,.96); box-shadow: 0 24px 64px rgba(24,50,40,.09); }
.panel-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.panel-heading-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.panel-heading .owner-eyebrow { margin: 0; }
.panel-heading h2 { font-size: 44px; }
.panel-heading p { margin: 0; color: var(--muted); }
.filter-bar { display: grid; grid-template-columns: minmax(260px, 1fr) 170px 180px auto; gap: 10px; margin: 26px 0 14px; }
.search-field { display: block; }
.search-field input { width: 100%; }
.bulk-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--cream); }
.select-all { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 750; }
.select-all input, .media-select input { width: 18px; height: 18px; accent-color: var(--green); }
.bulk-bar strong { color: var(--muted); font-size: 13px; }
.bulk-spacer { flex: 1; }
.panel-status { padding: 14px 2px; }
.media-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.media-card { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.media-preview { aspect-ratio: 4/3; display: grid; place-items: center; overflow: hidden; background: #e8efeb; }
.media-preview img { width: 100%; height: 100%; object-fit: cover; }
.media-preview span { color: var(--green-deep); font-size: 38px; }
.media-select { position: absolute; z-index: 2; top: 10px; left: 10px; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: rgba(255,255,255,.92); box-shadow: 0 5px 18px rgba(0,0,0,.13); }
.media-content { padding: 15px; }
.media-content h3 { overflow: hidden; margin: 0 0 7px; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.media-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; color: var(--muted); font-size: 12px; }
.media-meta span { overflow: hidden; max-width: 100%; text-overflow: ellipsis; white-space: nowrap; }
.media-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.media-actions a, .media-actions button { min-height: 38px; display: grid; place-items: center; border: 0; border-radius: 10px; font-size: 13px; font-weight: 800; text-decoration: none; }
.media-actions a { color: var(--green-deep); background: #e8f2ee; }
.media-actions button { color: var(--danger); background: #f8e9e9; }
.load-more { display: block; margin: 24px auto 0; color: var(--green-deep); background: #e8f2ee; }
.empty-state { grid-column: 1/-1; padding: 60px 20px; color: var(--muted); text-align: center; border: 1px dashed var(--line); border-radius: 18px; }

.contact-table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 18px; }
.contact-table { width: 100%; min-width: 1260px; border-collapse: collapse; background: #fff; }
.contact-table th, .contact-table td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.contact-table th { position: sticky; top: 0; color: var(--muted); background: var(--cream); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.contact-table td { font-size: 13px; }
.contact-table tr:last-child td { border-bottom: 0; }
.contact-name { font-weight: 800; }
.contact-subtle { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.contact-message-cell { width: 178px; }
.contact-message-actions { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.contact-message-button { min-width: 42px; min-height: 32px; display: inline-grid; place-items: center; padding: 0 9px; border: 1px solid transparent; border-radius: 9px; color: #fff; font-size: 10px; font-weight: 900; letter-spacing: .035em; text-decoration: none; transition: transform .16s ease, filter .16s ease; }
.contact-message-button:hover { filter: brightness(.94); transform: translateY(-1px); }
.contact-message-button:focus-visible { outline: 3px solid rgba(8,118,90,.2); outline-offset: 2px; }
.contact-message-button.is-whatsapp { background: #178b50; }
.contact-message-button.is-telegram { background: #2489be; }
.contact-message-button.is-max { background: #7255d9; }
.contact-message-button.is-disabled { color: #89938f; background: #edf1ef; cursor: not-allowed; filter: none; transform: none; }
.contact-remark-cell { width: 300px; min-width: 260px; }
.contact-remark-editor { display: grid; gap: 7px; }
.contact-remark-editor textarea { width: 100%; min-height: 62px; resize: vertical; border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; color: var(--ink); background: #fff; font: inherit; line-height: 1.4; outline: none; }
.contact-remark-editor textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(8,118,90,.1); }
.contact-remark-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.contact-remark-save { min-height: 31px; border: 0; border-radius: 8px; padding: 0 12px; color: #fff; background: var(--green); font-size: 11px; font-weight: 850; }
.contact-remark-state { min-width: 46px; color: var(--muted); font-size: 11px; }
.contact-remark-state[data-state="success"] { color: var(--green); }
.contact-remark-state[data-state="error"] { color: var(--danger); }
.contact-action-cell { width: 92px; }
.contact-delete-button { min-height: 34px; border: 1px solid #efd0d0; border-radius: 9px; padding: 0 12px; color: var(--danger); background: #fff4f4; font-size: 11px; font-weight: 850; }
.contact-delete-button:hover { color: #fff; background: var(--danger); border-color: var(--danger); }

.owner-invoice-filter { grid-template-columns: minmax(240px, 1fr) minmax(150px, .55fr) minmax(150px, .55fr) 140px 140px 170px auto; }
.date-filter { position: relative; display: block; }
.date-filter > span { position: absolute; z-index: 1; top: 5px; left: 15px; color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; pointer-events: none; }
.date-filter input { width: 100%; padding-top: 12px; }
.invoice-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 14px 0 2px; }
.invoice-metric { min-height: 92px; display: grid; align-content: center; gap: 6px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 15px; background: var(--cream); }
.invoice-metric span { color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.invoice-metric strong { overflow: hidden; font-size: 21px; text-overflow: ellipsis; white-space: nowrap; }
.invoice-table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 18px; }
.invoice-report-table { width: 100%; min-width: 1040px; border-collapse: collapse; background: #fff; }
.invoice-report-table th, .invoice-report-table td { padding: 15px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.invoice-report-table th { position: sticky; top: 0; color: var(--muted); background: var(--cream); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.invoice-commission-select { min-width: 108px; min-height: 38px; border: 1px solid #ead7a9; border-radius: 10px; padding: 0 28px 0 11px; color: #8a5a00; background: #fff9e8; font-size: 12px; font-weight: 850; }
.invoice-commission-select.is-paid { border-color: #b9dfd2; color: var(--green); background: #edf8f4; }
.invoice-commission-select:disabled { opacity: .6; cursor: wait; }
.invoice-view-button { white-space: nowrap; }
.invoice-report-table td { font-size: 13px; }
.invoice-report-table tr:last-child td { border-bottom: 0; }
.invoice-report-table tbody tr:hover { background: #f9fbfa; }
.invoice-number { font-weight: 850; }
.invoice-entity { max-width: 220px; font-weight: 800; }
.invoice-amount { white-space: nowrap; font-weight: 850; }
.invoice-view-button { min-height: 34px; border: 0; border-radius: 9px; padding: 0 14px; color: var(--green-deep); background: #e8f2ee; font-size: 11px; font-weight: 850; }
.owner-invoice-dialog { width: min(880px, calc(100% - 28px)); max-height: calc(100vh - 40px); overflow: auto; padding: 28px; border: 1px solid rgba(21,35,30,.14); border-radius: 24px; color: var(--ink); background: #fff; box-shadow: 0 36px 100px rgba(0,24,17,.3); }
.owner-invoice-dialog::backdrop { background: rgba(8,24,18,.54); backdrop-filter: blur(5px); }
.invoice-dialog-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.invoice-dialog-heading .owner-eyebrow { margin: 0; }
.invoice-dialog-heading h2 { margin: 8px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: 42px; font-weight: 500; letter-spacing: -.04em; }
.invoice-dialog-close { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: #fff; font-size: 25px; line-height: 1; }
.invoice-detail-hero { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 24px 0; }
.invoice-detail-hero div { padding: 16px; border-radius: 14px; background: var(--cream); }
.invoice-detail-hero span, .invoice-detail-grid dt { display: block; color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.invoice-detail-hero strong { display: block; margin-top: 6px; font-size: 18px; }
.invoice-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 0; border: 1px solid var(--line); border-radius: 15px; }
.invoice-detail-grid div { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.invoice-detail-grid div:nth-child(odd) { border-right: 1px solid var(--line); }
.invoice-detail-grid div:nth-last-child(-n+2) { border-bottom: 0; }
.invoice-detail-grid dd { margin: 5px 0 0; overflow-wrap: anywhere; }
.invoice-products-title { margin: 24px 0 10px; font-size: 18px; }
.invoice-products { width: 100%; border-collapse: collapse; }
.invoice-products th, .invoice-products td { padding: 11px 10px; border-bottom: 1px solid var(--line); text-align: left; font-size: 12px; }
.invoice-products th { color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.invoice-detail-remark { margin: 20px 0 0; padding: 16px; border-radius: 14px; color: var(--muted); background: #f7f9f8; white-space: pre-wrap; overflow-wrap: anywhere; }
.invoice-file-link { min-height: 44px; display: inline-grid; place-items: center; margin-top: 20px; padding: 0 18px; border-radius: 11px; color: #fff; background: var(--green); font-size: 13px; font-weight: 850; text-decoration: none; }

.finance-entry-form { margin: 26px 0 18px; padding: 24px; border: 1px solid rgba(180,77,99,.22); border-radius: 20px; background: #fff8fa; box-shadow: 0 16px 38px rgba(92,32,45,.08); }
.finance-form-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.finance-form-heading .owner-eyebrow { margin: 0; color: #a43e55; }
.finance-form-heading h3 { margin: 7px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: 29px; font-weight: 500; }
.finance-form-close { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: #fff; font-size: 23px; line-height: 1; }
.finance-form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 22px; }
.finance-form-grid label { display: grid; align-content: start; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 800; }
.finance-form-grid label > span { letter-spacing: .03em; }
.finance-form-grid input, .finance-form-grid select, .finance-form-grid textarea { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 12px; padding: 0 13px; color: var(--ink); background: #fff; outline: none; }
.finance-form-grid textarea { min-height: 88px; resize: vertical; padding-top: 12px; line-height: 1.45; }
.finance-form-grid input[type="file"] { padding: 10px 12px; }
.finance-form-grid input:focus, .finance-form-grid select:focus, .finance-form-grid textarea:focus { border-color: #b44d63; box-shadow: 0 0 0 4px rgba(180,77,99,.1); }
.finance-reason { grid-column: span 2; }
.finance-receipt { grid-column: span 2; }
.finance-file-help { margin: 10px 0 0; color: var(--muted); font-size: 11px; }
.finance-form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.finance-form-actions .form-status { margin-right: auto; }
.finance-filter { grid-template-columns: minmax(230px, 1fr) 130px 140px 140px 140px 170px auto; }
.finance-table { min-width: 980px; }
.finance-reason-cell { min-width: 260px; max-width: 460px; white-space: pre-wrap; overflow-wrap: anywhere; }
.finance-type { display: inline-grid; min-width: 76px; min-height: 30px; place-items: center; border-radius: 999px; padding: 0 11px; font-size: 10px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.finance-type.is-expense { color: #9e263e; background: #fff0f3; }
.finance-type.is-income { color: #08765a; background: #eaf7f2; }
.finance-amount.is-expense { color: #a52c44; }
.finance-amount.is-income { color: var(--green); }
.finance-receipt-link { display: inline-grid; min-height: 34px; place-items: center; border-radius: 9px; padding: 0 13px; color: var(--green-deep); background: #e8f2ee; font-size: 11px; font-weight: 850; text-decoration: none; white-space: nowrap; }

.owner-documents-panel { overflow: hidden; background: linear-gradient(145deg, rgba(255,255,255,.98), rgba(244,246,253,.96)); }
.document-entry-form { margin: 26px 0 18px; padding: 24px; border: 1px solid rgba(83,105,168,.24); border-radius: 20px; background: #f7f8fe; box-shadow: 0 16px 38px rgba(48,61,104,.08); }
.document-entry-form .owner-eyebrow { color: #5369a8; }
.document-form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 22px; }
.document-form-grid label { display: grid; align-content: start; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 800; }
.document-form-grid label > span { letter-spacing: .03em; }
.document-form-grid input, .document-form-grid select, .document-form-grid textarea { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 12px; padding: 0 13px; color: var(--ink); background: #fff; outline: none; }
.document-form-grid textarea { min-height: 88px; resize: vertical; padding-top: 12px; line-height: 1.45; }
.document-form-grid input[type="file"] { min-height: 62px; padding: 14px 12px; }
.document-form-grid input:focus, .document-form-grid select:focus, .document-form-grid textarea:focus { border-color: #5369a8; box-shadow: 0 0 0 4px rgba(83,105,168,.11); }
.document-name, .document-remark, .document-files { grid-column: span 2; }
.document-filter { grid-template-columns: minmax(260px, 1fr) auto; }
.document-list { display: grid; gap: 14px; margin-top: 14px; }
.document-card { padding: 22px; border: 1px solid rgba(83,105,168,.16); border-radius: 18px; background: #fff; box-shadow: 0 10px 26px rgba(24,50,40,.055); }
.document-card-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.document-card-heading h3 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 25px; font-weight: 500; letter-spacing: -.025em; overflow-wrap: anywhere; }
.document-card-meta { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.document-category { flex: 0 0 auto; max-width: 260px; overflow: hidden; border-radius: 999px; padding: 7px 11px; color: #40548f; background: #edf0fb; font-size: 10px; font-weight: 900; letter-spacing: .06em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.document-remark { margin: 16px 0 0; color: var(--muted); line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.document-files-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 18px; }
.document-file-link { min-width: 0; display: flex; align-items: center; gap: 11px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #fafcfb; text-decoration: none; }
.document-file-link:hover { border-color: #aeb9d8; background: #f4f6fd; }
.document-file-link > span:last-child { min-width: 0; display: grid; gap: 3px; }
.document-file-link strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.document-file-link small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.document-file-icon { flex: 0 0 34px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; color: #5369a8; background: #edf0fb; font-size: 15px; font-weight: 900; }
.document-no-files { grid-column: 1/-1; margin: 0; color: var(--muted); font-size: 12px; }
.document-empty-state { padding: 44px 20px; border: 1px dashed #bfc8df; border-radius: 16px; background: rgba(255,255,255,.72); text-align: center; }

.jewelry-filter { grid-template-columns: minmax(300px, 1fr) 150px minmax(170px, .55fr) 210px auto; }
.jewelry-metrics { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.jewelry-metrics .invoice-metric { min-width: 0; }
.jewelry-metrics .invoice-metric small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.jewelry-table { min-width: 1450px; }
.jewelry-table th, .jewelry-table td { padding: 13px 14px; }
.jewelry-photo-cell { width: 82px; min-width: 82px; padding-top: 8px !important; padding-bottom: 8px !important; }
.jewelry-photo { position: relative; width: 58px; height: 58px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; color: #907b54; background: linear-gradient(145deg, #f8f5ed, #eef4f1); font-size: 22px; }
.jewelry-photo img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; }
.jewelry-product-number { min-width: 130px; font-weight: 850; }
.jewelry-item-name { min-width: 220px; max-width: 340px; font-weight: 750; }
.jewelry-item-name .contact-subtle { max-height: 2.8em; overflow: hidden; font-weight: 450; line-height: 1.4; }
.jewelry-stock-status { display: inline-grid; min-width: 74px; min-height: 30px; place-items: center; border-radius: 999px; padding: 0 11px; font-size: 10px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.jewelry-stock-status.is-available { color: var(--green); background: #eaf7f2; }
.jewelry-stock-status.is-sold { color: #9e263e; background: #fff0f3; }
.jewelry-invoice-cell { min-width: 140px; }
.jewelry-invoice-cell .contact-subtle { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jewelry-invoice-button { display: inline-grid; min-height: 34px; place-items: center; border-radius: 9px; padding: 0 13px; color: #fff; background: var(--green); font-size: 11px; font-weight: 850; text-decoration: none; white-space: nowrap; }
.jewelry-invoice-button:hover { background: var(--green-deep); }
.jewelry-print-button { background: #9a6a12; }
.jewelry-print-button:hover { background: #6f4b0b; }
.owner-jewelry-print { display: none; }

.owner-add-product-panel { overflow: hidden; background: linear-gradient(145deg, rgba(255,255,255,.98), rgba(242,247,252,.96)); }
.product-import-shop-card { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(320px, .8fr); align-items: center; gap: 28px; margin-top: 28px; padding: 24px; border: 1px solid rgba(31,111,178,.2); border-radius: 20px; background: linear-gradient(135deg, #eef6fd, #fff); box-shadow: 0 15px 38px rgba(31,82,125,.08); }
.product-import-step { color: #1f6fb2; font-size: 10px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.product-import-shop-card h3, .product-import-heading h3 { margin: 7px 0 5px; font-family: Georgia, "Times New Roman", serif; font-size: 30px; font-weight: 500; letter-spacing: -.035em; }
.product-import-shop-card p, .product-import-heading p { margin: 0; color: var(--muted); line-height: 1.55; }
.product-import-shop-card label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 850; }
.product-import-shop-card select { width: 100%; min-height: 54px; border: 1px solid #bed5e8; border-radius: 13px; padding: 0 42px 0 15px; color: var(--ink); background: #fff; outline: none; }
.product-import-shop-card select:focus { border-color: #1f6fb2; box-shadow: 0 0 0 4px rgba(31,111,178,.11); }
.product-import-heading { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin: 34px 2px 16px; }
.product-import-heading > p { max-width: 620px; text-align: right; }
.product-import-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.product-import-card { --import-accent: #1f6fb2; position: relative; min-width: 0; display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 16px; overflow: hidden; padding: 22px; border: 1px solid color-mix(in srgb, var(--import-accent) 20%, var(--line)); border-radius: 18px; background: #fff; box-shadow: 0 12px 28px rgba(24,50,40,.06); }
.product-import-card::before { position: absolute; inset: 0 auto 0 0; width: 4px; content: ""; background: var(--import-accent); }
.product-import-card.is-fashion { --import-accent: #181818; }
.product-import-card.is-cosmetics { --import-accent: #bf5276; }
.product-import-card.is-perfume { --import-accent: #7053a5; }
.product-import-card.is-travel { --import-accent: #c47b18; }
.product-import-card.is-electronics { --import-accent: #147a75; }
.product-import-card.is-watch { --import-accent: #8a6723; }
.product-import-number { position: absolute; top: 18px; right: 20px; color: color-mix(in srgb, var(--import-accent) 62%, #aeb7b3); font-size: 10px; font-weight: 900; letter-spacing: .14em; }
.product-import-card > div { grid-column: 1/-1; padding-right: 38px; }
.product-import-card strong { display: block; font-family: Georgia, "Times New Roman", serif; font-size: 25px; font-weight: 500; letter-spacing: -.025em; }
.product-import-card > div p { min-height: 38px; margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.product-import-card label { min-width: 0; display: grid; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 850; }
.product-import-card input { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 12px; padding: 0 13px; color: var(--ink); background: #fff; outline: none; }
.product-import-card input:focus { border-color: var(--import-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--import-accent) 10%, transparent); }
.product-import-card .primary-button { min-width: 150px; background: var(--import-accent); }
.product-import-card .primary-button:hover { filter: brightness(.88); }
.product-import-card .form-status { grid-column: 1/-1; min-height: 18px; font-size: 12px; }
.product-import-global-status { margin-top: 10px; }
.product-import-result { margin-top: 4px; padding: 20px 22px; border: 1px solid #b9dfd2; border-radius: 16px; background: #edf8f4; }
.product-import-result span { display: block; color: var(--green); font-size: 10px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.product-import-result strong { display: block; margin-top: 6px; font-family: Georgia, "Times New Roman", serif; font-size: 25px; font-weight: 500; }
.product-import-result p { margin: 7px 0 0; color: var(--muted); font-size: 13px; }

@media (max-width: 1120px) {
  .owner-section-grid { grid-template-columns: repeat(2, minmax(260px, 360px)); }
  .media-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .owner-invoice-filter { grid-template-columns: 1fr 1fr 1fr; }
  .owner-invoice-filter .search-field { grid-column: 1/-1; }
  .finance-filter { grid-template-columns: 1fr 1fr 1fr; }
  .finance-filter .search-field { grid-column: 1/-1; }
  .jewelry-filter { grid-template-columns: 1fr 1fr; }
  .jewelry-filter .search-field { grid-column: 1/-1; }
  .jewelry-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .finance-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .document-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .document-files-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-import-shop-card { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .owner-app { width: min(100% - 24px, 1480px); }
  .owner-header { grid-template-columns: 1fr auto; }
  .owner-header-copy { grid-column: 1/-1; grid-row: 2; text-align: left; }
  .owner-header h1 { font-size: 28px; }
  .owner-section-menu { padding: 38px 12px 42px; }
  .owner-section-grid { gap: 16px; margin-top: 32px; }
  .owner-section-card { min-height: 230px; padding: 24px; }
  .owner-section-arrow { right: 24px; bottom: 24px; }
  .owner-panel { padding: 20px; border-radius: 20px; }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1/-1; }
  .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bulk-spacer { display: none; }
  .bulk-bar button { flex: 1 1 180px; }
  .invoice-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .finance-form-actions { align-items: stretch; flex-wrap: wrap; }
  .finance-form-actions .form-status { flex-basis: 100%; }
  .product-import-grid { grid-template-columns: 1fr; }
  .product-import-heading { align-items: start; flex-direction: column; }
  .product-import-heading > p { max-width: none; text-align: left; }
  .document-card-heading { align-items: start; flex-direction: column; gap: 12px; }
}
@media (max-width: 540px) {
  .owner-login { padding: 14px; }
  .owner-login-card { padding: 30px 24px; border-radius: 22px; }
  .owner-login h1 { font-size: 52px; }
  .owner-section-menu { padding: 28px 20px 30px; }
  .owner-menu-intro h2 { font-size: 42px; }
  .owner-section-grid { grid-template-columns: 1fr; }
  .owner-section-card { min-height: 220px; }
  .panel-heading { align-items: start; flex-direction: column; }
  .panel-heading-actions { width: 100%; justify-content: flex-start; }
  .panel-heading-actions .ghost-button { flex: 1; }
  .panel-heading h2 { font-size: 38px; }
  .filter-bar { grid-template-columns: 1fr; }
  .search-field { grid-column: auto; }
  .media-grid { grid-template-columns: 1fr; }
  .owner-invoice-filter { grid-template-columns: 1fr; }
  .owner-invoice-filter .search-field { grid-column: auto; }
  .invoice-detail-hero, .invoice-detail-grid { grid-template-columns: 1fr; }
  .invoice-detail-grid div:nth-child(odd) { border-right: 0; }
  .invoice-detail-grid div:nth-last-child(-n+2) { border-bottom: 1px solid var(--line); }
  .invoice-detail-grid div:last-child { border-bottom: 0; }
  .finance-filter, .finance-form-grid { grid-template-columns: 1fr; }
  .finance-filter .search-field, .finance-reason, .finance-receipt { grid-column: auto; }
  .document-filter, .document-form-grid, .document-files-list { grid-template-columns: 1fr; }
  .document-name, .document-remark, .document-files { grid-column: auto; }
  .jewelry-filter { grid-template-columns: 1fr; }
  .jewelry-filter .search-field { grid-column: auto; }
  .jewelry-metrics { grid-template-columns: 1fr 1fr; }
  .finance-form-actions .ghost-button, .finance-form-actions .primary-button { flex: 1; }
  .product-import-shop-card { padding: 20px; }
  .product-import-card { grid-template-columns: 1fr; }
  .product-import-card .primary-button { width: 100%; }
}

@media print {
  @page { size: A4 landscape; margin: 10mm; }
  html, body { min-width: 0; min-height: 0; background: #fff; }
  body > :not(.owner-jewelry-print) { display: none !important; }
  .owner-jewelry-print { display: block; color: #111; font-family: Arial, Helvetica, sans-serif; }
  .owner-jewelry-print header { margin-bottom: 6mm; border-bottom: 1.5pt solid #9a6a12; padding-bottom: 4mm; }
  .jewelry-print-brand { color: #76500c; font-size: 8pt; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
  .owner-jewelry-print h1 { margin: 2mm 0 1mm; font-family: Georgia, "Times New Roman", serif; font-size: 23pt; font-weight: 500; letter-spacing: -.03em; }
  .owner-jewelry-print header p { margin: 0; color: #555; font-size: 7.5pt; }
  .jewelry-print-metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2mm; margin-bottom: 5mm; }
  .jewelry-print-metrics > div { min-height: 15mm; padding: 2.5mm; border: .6pt solid #d7d7d7; border-radius: 2mm; }
  .jewelry-print-metrics span { display: block; color: #666; font-size: 6pt; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
  .jewelry-print-metrics strong { display: block; margin-top: 1.5mm; font-size: 11pt; }
  .jewelry-print-metrics small { display: block; margin-top: 1mm; color: #555; font-size: 5.7pt; }
  .jewelry-print-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
  .jewelry-print-table thead { display: table-header-group; }
  .jewelry-print-table tr { break-inside: avoid; page-break-inside: avoid; }
  .jewelry-print-table th, .jewelry-print-table td { padding: 1.8mm 1.4mm; border: .5pt solid #d7d7d7; text-align: left; vertical-align: top; overflow-wrap: anywhere; font-size: 6.2pt; }
  .jewelry-print-table th { color: #444; background: #f3efe6 !important; font-size: 5.8pt; letter-spacing: .04em; text-transform: uppercase; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .jewelry-print-table th:nth-child(1) { width: 6%; }
  .jewelry-print-table th:nth-child(2) { width: 10%; }
  .jewelry-print-table th:nth-child(3) { width: 17%; }
  .jewelry-print-table th:nth-child(4), .jewelry-print-table th:nth-child(5), .jewelry-print-table th:nth-child(7) { width: 9%; }
  .jewelry-print-table th:nth-child(6) { width: 7%; }
  .jewelry-print-table th:nth-child(8) { width: 9%; }
  .jewelry-print-table th:nth-child(9) { width: 8%; }
  .jewelry-print-table th:nth-child(10) { width: 9%; }
  .jewelry-print-table .jewelry-photo-cell { width: auto; min-width: 0; padding: 1.2mm !important; }
  .jewelry-print-table .jewelry-photo { width: 9mm; height: 9mm; border-radius: 1.5mm; font-size: 9pt; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .jewelry-print-table .jewelry-invoice-cell { min-width: 0; }
  .jewelry-print-table .contact-subtle { display: block; margin-top: .8mm; color: #666; font-size: 5.4pt; font-weight: 400; }
  .jewelry-print-table .jewelry-stock-status { min-width: 0; min-height: 0; padding: 0; color: inherit; background: transparent; font-size: inherit; letter-spacing: 0; text-transform: none; }
  .jewelry-print-note { margin: 4mm 0 0; color: #666; font-size: 6.5pt; text-align: right; }
}
