:root {
  color-scheme: light;
  --ink: #261d21;
  --muted: #6c5f64;
  --primary: #862247;
  --darker: #6c1535;
  --line: #e9dfe2;
  --paper: #fff;
  --bg: #f7f6f2;
  --soft: #faf4f6;
  --radius: 18px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
input, button, select { font: inherit; }
button, a.button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
a { color: var(--darker); }
[hidden] { display: none !important; }
button:focus-visible, a:focus-visible { outline: 3px solid #b3466b; outline-offset: 3px; }
.loading { text-align: center; margin: 20vh 1rem 0; color: var(--muted); }
.topbar { background: #fff; border-bottom: 1px solid var(--line); }
.top-inner { max-width: 1296px; margin: auto; min-height: 76px; padding: 0 30px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.brand-badge { width: 61px; height: 36px; border-radius: 6px; object-fit: cover; }
.brand-name { font-weight: 750; font-size: 1rem; letter-spacing: -.025em; }
.nav { display: flex; gap: 5px; justify-content: center; flex: 1; }
.nav button, .logout { border: 0; background: transparent; color: var(--muted); font-weight: 650; padding: 10px 13px; border-radius: 8px; white-space: nowrap; }
.nav button:hover, .logout:hover { background: var(--soft); color: var(--primary); }
.nav button[aria-current="page"] { background: #f4e8ee; color: var(--darker); }
.logout { margin-inline-start: auto; }
.shell { max-width: 1296px; margin: 0 auto; padding: 42px 30px 54px; }
.page-head { margin-bottom: 27px; }
.page-head h1 { font-size: clamp(2.1rem, 4vw, 3.15rem); margin: 0; font-weight: 760; letter-spacing: -.06em; line-height: 1.12; }
.page-head p { margin: 8px 0 0; color: var(--muted); }
.two-cols { display: grid; grid-template-columns: minmax(0, .91fr) minmax(0, 1.09fr); gap: 24px; align-items: start; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 3px 9px #35132206; min-width: 0; }
.form-card { padding: 25px; }
.section-head { margin-bottom: 19px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.section-head h2, .dialog-head h2 { font-size: 1.23rem; margin: 0; letter-spacing: -.025em; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.full { grid-column: 1 / -1; }
label, legend, .field-label { display: block; color: var(--ink); font-weight: 660; font-size: .91rem; padding: 0; }
.optional { color: var(--muted); font-weight: 450; font-size: .82rem; }
.control { display: block; width: 100%; min-height: 45px; margin-top: 6px; padding: 9px 12px; border: 1px solid #dcd1d6; border-radius: 9px; color: var(--ink); background: #fff; font-size: 1rem; }
.control:focus { outline: 2px solid #ac5375; outline-offset: 1px; }
.control::placeholder { color: #776b70; opacity: 1; }
select.control { appearance: none; padding-right: 29px; background: linear-gradient(45deg, transparent 47%, #79656c 49% 63%, transparent 65%) calc(100% - 16px) 53% / 6px 7px no-repeat, linear-gradient(-45deg, transparent 47%, #79656c 49% 63%, transparent 65%) calc(100% - 11px) 53% / 6px 7px no-repeat, #fff; }
.inline-field { display: flex; gap: 8px; align-items: end; }
.inline-field > label { min-width: 0; flex: 1; }
.field-head { display: flex; align-items: baseline; justify-content: space-between; min-height: 22px; gap: 8px; }
.field-head .edit-customer { padding: 0 4px; font-size: .85rem; text-decoration: underline; text-underline-offset: 3px; }
.check-line { display: flex; align-items: flex-start; gap: 8px; }
.check-line input { margin-top: 2px !important; }
.assignment-note { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); }
.assignment-note .status { margin-top: 5px; }
.warning { background: #fff5dc; border: 1px solid #e9d48f; border-radius: 8px; color: #57420f; font-size: .9rem; margin: 0; padding: 10px 12px; line-height: 1.45; }
.add-button { min-width: 45px; font-size: 1.35rem; padding: 0 !important; line-height: 1; }
.money-input { position: relative; }
.money-input .control { padding-right: 55px; font-variant-numeric: tabular-nums; }
.money-input span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--primary); font-size: .82rem; font-weight: 800; pointer-events: none; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.methods { display: flex; gap: 5px; margin-top: 7px; background: #f7f3f4; padding: 4px; border-radius: 9px; }
.methods label { flex: 1; position: relative; text-align: center; cursor: pointer; }
.methods input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.methods span { display: block; padding: 8px 3px; border: 1px solid transparent; border-radius: 7px; font-size: .85rem; white-space: nowrap; }
.methods input:checked + span { background: #fff; color: var(--darker); border-color: #eadde2; box-shadow: 0 1px 2px #452b3810; }
.methods input:focus-visible + span { outline: 2px solid var(--primary); }
.more { font-size: .89rem; color: var(--darker); }
.more summary { cursor: pointer; width: max-content; padding: 1px 0 3px; font-weight: 650; }
.form-actions { margin-top: 20px; display: flex; align-items: center; gap: 12px; }
.button { display: inline-flex; min-height: 44px; border: 1px solid transparent; border-radius: 9px; padding: 9px 14px; font-weight: 700; align-items: center; justify-content: center; text-decoration: none; line-height: 1.25; text-align: center; }
.primary { background: var(--primary); color: #fff; }
.primary:hover { background: var(--darker); }
.secondary { background: white; color: var(--darker); border-color: #e2d5db; }
.secondary:hover { background: var(--soft); }
.soft { background: #f4e8ee; color: var(--darker); }
.soft:hover { background: #ead8e2; }
.text-button { background: transparent; color: var(--darker); border: 0; cursor: pointer; padding: 7px; border-radius: 6px; font-weight: 650; }
.text-button:hover { background: var(--soft); }
.text-button.danger-text { color: #9a2336; }
.button.danger { background: #9a2336; color: #fff; }
.wide { width: 100%; }
.error { color: #96213c; font-size: .9rem; font-weight: 620; margin: 10px 0 0; }
.preview { background: #f1edef; padding: 18px; }
.preview-bar { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 13px; gap: 12px; }
.preview-bar h2 { font-size: .94rem; font-weight: 730; margin: 0; }
.flag { color: var(--muted); font-size: .79rem; background: #fff; border: 1px solid #eadfe4; padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
.voucher { display: block; width: 100%; height: auto; background: white; border-radius: 5px; box-shadow: 0 4px 12px #36222a12; }
.preview-caption { color: var(--muted); font-size: .86rem; margin: 13px 5px 0; line-height: 1.4; }
.auth-shell { margin: 0 auto; min-height: 100dvh; display: grid; place-items: center; padding: 26px 18px; }
.auth-card { width: min(100%, 435px); padding: clamp(24px, 8vw, 40px); border-top: 5px solid var(--primary); }
.auth-card .brand-badge { width: 83px; height: auto; border-radius: 7px; display: block; margin-bottom: 20px; }
.auth-card h1 { margin: 0; font-size: 2rem; letter-spacing: -.055em; }
.auth-card .auth-info { color: var(--muted); margin: 7px 0 24px; line-height: 1.5; }
.auth-card label + label { margin-top: 16px; }
.auth-card button { margin-top: 20px; }
.password-hint { font-size: .87rem; line-height: 1.45; color: var(--muted); font-weight: 450; display: block; margin-top: 6px; }
.history { padding: 14px 24px 24px; }
.search-form { display: flex; align-items: end; gap: 8px; margin-bottom: 18px; }
.search-form label { width: min(100%, 400px); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { color: var(--muted); font-size: .86rem; }
th, td { padding: 13px 10px; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
.amount-cell { white-space: nowrap; font-weight: 650; font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); padding: 9px 0; }
.directory-card { padding: 20px; }
.directory-list { padding: 0; margin: 0; list-style: none; }
.directory-list li { padding: 10px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.customer-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.customer-name { text-align: start; padding-inline-start: 5px; text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; min-width: 0; }
.rental-history { margin-top: 10px; line-height: 1.4; font-size: .91rem; }
.rental-history summary { cursor: pointer; width: fit-content; color: var(--darker); font-weight: 650; }
.rental-history ul { padding-left: 22px; margin: 8px 0 0; }
.rental-history li { padding: 3px 0; border: 0; }
.rental-history small { color: var(--muted); display: block; font-size: .84rem; }
.assign-row { display: grid; grid-template-columns: minmax(0, 1fr)  minmax(0, 1fr); gap: 8px; align-items: center; }
.assign-row .control { margin-top: 0; }
.settings-card { max-width: 520px; }
.sequence-current { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin: 0; }
.sequence-current strong { font-size: 1.65rem; color: var(--darker); }
.receipt-page { max-width: 760px; margin: 0 auto; padding: 35px 22px 50px; }
.receipt-page .page-head h1 { font-size: clamp(1.9rem, 5vw, 2.65rem); }
.receipt-page .card + .card { margin-top: 15px; }
.action-card { padding: 19px; }
.action-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.receipt-record .action-buttons { margin-top: 14px; }
.record-file { overflow-wrap: anywhere; }
.file-input { padding: 7px; }
.file-input::file-selector-button { background: var(--soft); color: var(--darker); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; font: inherit; cursor: pointer; }
.share-controls { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.share-controls label, .sign-agree { display: flex; justify-content: flex-start; align-items: center; gap: 8px; }
input[type="checkbox"] { width: 17px; height: 17px; margin: 0; accent-color: var(--primary); flex-shrink: 0; }
.link-controls { display: flex; gap: 8px; align-items: end; margin-top: 12px; flex-wrap: wrap; }
.back { margin-bottom: 13px; }
.status { color: var(--muted); font-size: .91rem; line-height: 1.45; margin: 11px 0 0; }
.sign-box { display: block; width: 100%; height: 165px; border: 1px dashed #a68894; border-radius: 8px; background: #fff; margin: 8px 0 4px; touch-action: none; }
.sign-agree { margin: 14px 0; }
dialog { border: 1px solid var(--line); border-radius: 15px; padding: 22px; width: min(calc(100% - 28px), 440px); color: var(--ink); }
dialog::backdrop { background: #30161e70; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
#notice { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 28px); padding: 11px 16px; background: #39232f; color: #fff; border-radius: 9px; z-index: 2; }
@media (max-width: 820px) {
  .two-cols { grid-template-columns: 1fr; }
  .shell { max-width: 660px; }
  .top-inner { gap: 12px; padding: 0 18px; }
  .brand-name { display: none; }
}
@media (max-width: 500px) {
  .top-inner { padding: 12px 13px 8px; min-height: 0; display: grid; grid-template-columns: 1fr auto; gap: 7px; }
  .brand-name { display: block; }
  .nav { grid-row: 2; grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .nav button { padding-inline: 4px; font-size: .84rem; white-space: normal; }
  .shell { padding: 26px 14px 31px; }
  .page-head { margin-bottom: 18px; }
  .form-card { padding: 16px; }
  .form-grid { gap: 13px; }
  .preview { padding: 10px; }
  .history { padding: 12px; }
  .receipt-page { padding: 22px 13px; }
  .assign-row { grid-template-columns: 1fr; }
}
