:root {
    color-scheme: dark;
    --bg: #101010;
    --bg-secondary: #1b1b1b;
    --surface: #242424;
    --surface-raised: #2b2b2b;
    --ink: #f5f5f5;
    --muted: #aaa;
    --line: #353535;
    --brand: #ff8500;
    --brand-dark: #e97700;
    --brand-highlight: #ff9900;
    --gold: #d9a441;
    --nav: #171717;
    --nav-muted: #bcbcbc;
    --green: #58c98a;
    --red: #ff6b63;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; width: 248px; padding: 25px 18px; background: var(--nav); color: #fff; }
.brand { display: flex; align-items: center; gap: 12px; min-height: 52px; }
.brand-mark { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; background: #fff; color: var(--brand); font-weight: 800; letter-spacing: -.06em; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; }
.brand small { margin-top: 3px; color: var(--nav-muted); font-size: 10px; letter-spacing: .16em; }
.side-nav { display: grid; gap: 7px; margin-top: 45px; }
.side-nav a, .nav-logout { display: block; width: 100%; padding: 12px 14px; border: 0; border-radius: 9px; background: transparent; color: var(--nav-muted); text-align: left; cursor: pointer; }
.side-nav a:hover, .side-nav a.active { background: #26384b; color: #fff; }
.sidebar-bottom { margin-top: auto; border-top: 1px solid #344252; padding-top: 18px; }
.admin-label { display: block; padding: 0 14px 8px; color: var(--nav-muted); font-size: 12px; }
.nav-logout:hover { background: #26384b; color: #fff; }
.main-content { min-width: 0; min-height: 100vh; margin-left: 248px; }
.topbar { display: flex; min-width: 0; min-height: 104px; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 38px; border-bottom: 1px solid var(--line); background: var(--surface); }
.topbar h1, h2, p { margin-top: 0; }
.topbar h1 { margin-bottom: 0; font-size: 24px; }
.eyebrow { margin-bottom: 8px; color: var(--brand); font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.topbar-user { max-width: 42%; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; text-align: right; }
.content-wrap { width: min(1380px, 100%); min-width: 0; margin: 0 auto; padding: 34px 38px 56px; }
.welcome-row, .section-heading { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.welcome-row h2, .section-heading h2 { margin-bottom: 7px; font-size: 23px; }
.muted { color: var(--muted); line-height: 1.6; }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat-card, .panel-card { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 4px 16px rgb(20 35 50 / 3%); }
.stat-card { padding: 22px; }
.stat-card span, .stat-card strong { display: block; }
.stat-card span { color: var(--muted); font-size: 13px; }
.stat-card strong { margin-top: 12px; font-size: 30px; }
.panel-card { padding: 24px; }
.panel-card h2 { margin-bottom: 5px; font-size: 19px; }
.section-heading .eyebrow { margin-bottom: 6px; }
.text-link, .back-link { color: var(--brand); font-weight: 650; }
.button { display: inline-flex; min-width: 0; min-height: 42px; align-items: center; justify-content: center; padding: 8px 15px; border: 1px solid transparent; border-radius: 9px; font-weight: 650; line-height: 1.3; text-align: center; overflow-wrap: anywhere; cursor: pointer; transition: background .15s, border-color .15s; }
.button-primary { background: var(--brand); color: #fff; }
.button-primary:hover { background: var(--brand-dark); }
.button-secondary { border-color: var(--line); background: #fff; color: var(--ink); }
.button-secondary:hover { border-color: #bdc7d0; background: #f8fafb; }
.button-small { min-height: 34px; padding: 0 11px; font-size: 12px; }
.button-wide { width: 100%; margin-top: 10px; }
.table-card { min-width: 0; padding: 0; overflow: hidden; }
.table-scroll, .table-responsive { width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 14px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: #fafbfc; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
td { font-size: 13px; }
tbody tr:last-child td { border-bottom: 0; }
code { color: #27384a; font-size: 12px; font-weight: 700; }
.status-pill { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 999px; background: #edf1f4; color: #596672; font-size: 11px; font-weight: 700; }
.status-ativo { background: #e8f7ef; color: var(--green); }
.status-inativo { background: #f1f2f4; color: #606b75; }
.status-manutencao { background: #fff4e5; color: #9a5b00; }
.empty-state { display: grid; min-height: 180px; align-content: center; justify-items: center; gap: 7px; color: var(--muted); }
.empty-state strong { color: var(--ink); }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; margin-top: 20px; }
.slot-card { min-width: 0; padding: 19px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-raised); }
.slot-card h3 { margin: 0; font-size: 16px; }
.slot-card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.slot-fragrance-image { display: block; width: 100%; max-height: 190px; margin: 12px 0; border-radius: 8px; background: var(--bg-secondary); object-fit: contain; }
.slot-history { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 11px; }
.slot-history summary { color: var(--muted); font-size: 12px; cursor: pointer; }
.slot-history table { margin-top: 10px; }
.slot-history th, .slot-history td { padding: 8px; white-space: normal; }
.slot-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.slot-card .form-grid { margin-top: 13px; }
.slot-card textarea { min-height: 86px; resize: vertical; }
.slot-card input[type="file"] { width: 100%; color: var(--muted); font-size: 12px; }
.alert { margin: 16px 0; padding: 13px 15px; border: 1px solid transparent; border-radius: 9px; font-size: 14px; }
.alert ul { margin: 0; padding-left: 19px; }
.alert-error { border-color: #f3c6c2; background: #fff1f0; color: var(--red); }
.alert-success { border-color: #b8e4c9; background: #effaf3; color: #126b3c; }
.alert-warning { border-color: #f3d49b; background: #fff8e8; color: #805000; }
.table-subtext { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; white-space: normal; }
.form-page { max-width: 790px; margin: 0 auto; }
.client-form-page { max-width: 900px; }
.back-link { display: inline-block; margin-bottom: 18px; font-size: 13px; }
.form-card { padding: 30px; }
.form-card h2 { margin-bottom: 5px; }
.client-form { display: grid; gap: 17px; margin-top: 25px; }
.form-section { min-width: 0; margin: 0; padding: 22px; border: 1px solid var(--line); border-radius: 12px; }
.form-section legend { padding: 0 8px; color: var(--ink); font-size: 16px; font-weight: 750; }
.form-section legend span { margin-right: 7px; color: var(--brand); font-size: 11px; letter-spacing: .08em; }
.form-section .form-grid { margin-top: 8px; }
.form-section label b { color: var(--red); }
.field-error { color: var(--red); font-size: 12px; line-height: 1.4; }
.field-error:empty, .lookup-status:empty { display: none; }
.lookup-status { color: var(--muted); font-size: 12px; line-height: 1.4; }
.field:has(.field-error:not(:empty)) input { border-color: #d66a63; }
.toggle-row { display: flex; align-items: center; gap: 13px; padding: 9px 0 4px; cursor: pointer; }
.toggle-row input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.toggle-control { position: relative; flex: 0 0 46px; height: 26px; border-radius: 20px; background: #cbd3da; transition: background .15s; }
.toggle-control::after { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 20%); content: ""; transition: transform .15s; }
.toggle-row input:checked + .toggle-control { background: var(--brand); }
.toggle-row input:checked + .toggle-control::after { transform: translateX(20px); }
.toggle-row input:focus-visible + .toggle-control { outline: 3px solid rgb(37 87 214 / 25%); outline-offset: 2px; }
.toggle-row strong, .toggle-row small { display: block; }
.toggle-row strong { font-size: 13px; }
.toggle-row small { margin-top: 4px; color: var(--muted); font-size: 12px; }
.cnpj-fields { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.cnpj-fields.is-hidden { display: none; }
.cnpj-fields h3 { margin: 23px 0 8px; font-size: 14px; }
.discount-field { max-width: 380px; }
.currency-input { display: flex; align-items: center; border: 1px solid #d6dde3; border-radius: 8px; background: #fff; }
.currency-input span { padding-left: 12px; color: var(--muted); font-size: 13px; }
.currency-input input { border: 0; box-shadow: none; }
.discount-field > small { color: var(--muted); font-size: 12px; }
.client-form-footer { padding-top: 4px; }
.client-form-footer > p { color: var(--muted); font-size: 13px; line-height: 1.6; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 24px; }
.field { display: grid; gap: 8px; align-content: start; }
.field-full { grid-column: 1 / -1; }
.field label, .field-label, .form-stack label { color: #394653; font-size: 13px; font-weight: 650; }
input, select { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #d6dde3; border-radius: 8px; outline: none; background: #fff; color: var(--ink); }
input:focus, select:focus { border-color: #6c91ed; box-shadow: 0 0 0 3px rgb(37 87 214 / 12%); }
.owner-card { display: grid; gap: 4px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 9px; background: #f8fafc; }
.owner-card span { color: var(--muted); font-size: 12px; }
.checkbox-list { display: grid; max-height: 280px; gap: 8px; overflow-y: auto; padding: 10px; border: 1px solid var(--line); border-radius: 9px; }
.checkbox-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px; border-radius: 7px; background: #f8fafc; cursor: pointer; }
.checkbox-row input { width: 17px; min-height: 17px; margin: 2px 0 0; accent-color: var(--brand); }
.checkbox-row span, .checkbox-row small { display: block; }
.checkbox-row small { margin-top: 4px; color: var(--muted); font-size: 12px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.auth-layout { display: grid; min-height: 100vh; place-items: center; padding: 25px; background: radial-gradient(circle at 85% 10%, #e7edff, transparent 32%), var(--bg); }
.login-card { width: min(420px, 100%); padding: 34px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 14px 42px rgb(20 35 50 / 8%); }
.login-brand { margin-bottom: 35px; color: var(--ink); }
.login-brand .brand-mark { background: #eaf0ff; }
.login-brand small { color: var(--muted); }
.login-card h1 { margin-bottom: 8px; font-size: 25px; }
.login-card .muted { margin-bottom: 24px; font-size: 14px; }
.form-stack { display: grid; gap: 10px; }
.form-stack label:not(:first-of-type) { margin-top: 7px; }
.device-card { width: min(540px, 100%); margin: 7vh auto; padding: 36px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 14px 42px rgb(20 35 50 / 7%); text-align: center; }
.device-icon { display: grid; width: 58px; height: 58px; place-items: center; margin: 0 auto 22px; border-radius: 17px; background: #eaf0ff; color: var(--brand); font-weight: 800; }
.device-card h1 { margin-bottom: 10px; font-size: 25px; }
.device-serial { margin-bottom: 15px; font-size: 19px; font-weight: 750; letter-spacing: .04em; }
.device-card .muted { margin: 22px auto 0; max-width: 390px; font-size: 13px; }

:focus-visible { outline: 3px solid rgb(255 133 0 / 70%); outline-offset: 2px; }
body { background: var(--bg); color: var(--ink); }
.sidebar { border-right: 1px solid var(--line); background: var(--nav); }
.brand { gap: 11px; }
.brand-logo { display: block; width: 108px; height: 72px; flex: 0 0 auto; object-fit: contain; object-position: left center; }
.brand strong { color: var(--ink); }
.brand small { color: var(--muted); letter-spacing: .1em; }
.side-nav a, .nav-logout { color: var(--nav-muted); }
.side-nav a:hover, .side-nav a.active { background: rgb(255 133 0 / 14%); color: var(--brand-highlight); }
.side-nav a.active { box-shadow: inset 3px 0 0 var(--brand); }
.sidebar-bottom { border-color: var(--line); }
.main-content, .content-wrap { background: var(--bg); }
.topbar { border-color: var(--line); background: var(--bg-secondary); }
.topbar-user { color: var(--muted); }
.eyebrow, .text-link, .back-link { color: var(--brand-highlight); }
.stat-card, .panel-card { border-color: var(--line); background: var(--surface); box-shadow: none; }
.stat-card span, .muted { color: var(--muted); }
.stat-card strong { color: var(--brand-highlight); }
.button { transition: background-color .15s ease, border-color .15s ease, color .15s ease; }
.button-primary { background: var(--brand); color: #17110a; }
.button-primary:hover { background: var(--brand-highlight); }
.button-secondary { border-color: #484848; background: var(--surface-raised); color: var(--ink); }
.button-secondary:hover { border-color: var(--gold); background: #333; }
.button-danger { border-color: #75312d; background: #672a26; color: #fff; }
.button-danger:hover { background: #84352f; }
.button:disabled, button:disabled { border-color: #454545; background: #393939; color: #858585; cursor: not-allowed; }
.table-card { background: var(--surface); }
.table-scroll { background: var(--surface); }
table { color: var(--ink); }
th, td { border-color: var(--line); }
th { background: #303030; color: #ddd; }
tbody tr:hover { background: #2b2b2b; }
code { color: #ffd08c; }
.status-pill { background: #383838; color: #ddd; }
.status-ativo { background: #173d2a; color: #8ee0ae; }
.status-inativo { background: #383838; color: #bbb; }
.status-manutencao { background: #4a371a; color: #f3c46f; }
.alert-error { border-color: #713631; background: #3a211f; color: #ffaaa3; }
.alert-success { border-color: #285b3e; background: #1b3023; color: #a4e6ba; }
.alert-warning { border-color: #705322; background: #382e1b; color: #f1d28d; }
.empty-state { color: var(--muted); }
.empty-state strong { color: var(--ink); }
.form-card { background: var(--surface); }
.form-section { border-color: var(--line); background: #202020; }
.form-section legend { color: var(--ink); }
.form-section legend span { color: var(--brand-highlight); }
.form-section label b, .field-error { color: #ff8d85; }
.lookup-status { color: var(--muted); }
.field:has(.field-error:not(:empty)) input { border-color: #b95149; }
.toggle-control { background: #555; }
.toggle-row input:checked + .toggle-control { background: var(--brand); }
.cnpj-fields { border-color: var(--line); }
.cnpj-fields h3 { color: var(--gold); }
.currency-input { border-color: #484848; background: #1c1c1c; }
.currency-input span { color: var(--gold); }
.discount-field > small, .client-form-footer > p { color: var(--muted); }
.field label, .field-label, .form-stack label { color: #e2e2e2; }
input, select { border-color: #484848; background: #1b1b1b; color: var(--ink); color-scheme: dark; }
input::placeholder { color: #888; }
input:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgb(255 133 0 / 18%); }
.owner-card, .checkbox-row { border-color: var(--line); background: #2a2a2a; color: var(--ink); }
.owner-card span, .checkbox-row small { color: var(--muted); }
.checkbox-list { border-color: var(--line); background: #1d1d1d; }
.checkbox-row:hover { background: #333; }
.checkbox-row input { accent-color: var(--brand); }
.auth-layout { background: radial-gradient(circle at 85% 10%, rgb(255 133 0 / 8%), transparent 32%), var(--bg); }
.login-card { border-color: var(--line); background: var(--surface); box-shadow: none; }
.login-brand { min-height: 74px; margin-bottom: 31px; color: var(--ink); }
.login-brand .brand-logo { width: 168px; height: 112px; }
.login-brand small { color: var(--gold); }
.login-card .muted { color: var(--muted); }
.device-card { border-color: var(--line); background: var(--surface); box-shadow: none; }
.device-icon { background: rgb(255 133 0 / 13%); color: var(--brand-highlight); }
.status-ativo { color: #8ee0ae; }
.status-filter { display: flex; align-items: center; gap: 10px; margin: -8px 0 18px; color: var(--muted); font-size: 13px; }
.status-filter select { min-width: 150px; min-height: 38px; }
.actions-cell, .button-group { display: flex; min-width: 0; flex-wrap: wrap; align-items: center; gap: 9px; }
.actions-cell form { display: inline-flex; min-width: 0; margin: 0; }
.actions-cell .button { white-space: normal; }
.form-card small { color: var(--muted); font-size: 12px; }
.js-swal-flash { display: none; }
.swal2-container { z-index: 2147483000 !important; }
.up-swal-popup { border: 1px solid var(--line); border-radius: 14px; }
.up-swal-title, .up-swal-text { color: var(--ink) !important; }
.up-swal-input { border-color: #484848 !important; background: #1b1b1b !important; color: var(--ink) !important; }
.swal2-actions { gap: 9px; }
.swal2-styled.button { margin: 0; }
.swal2-icon.swal2-success { color: #58c98a; border-color: #58c98a; }
.swal2-icon.swal2-error { color: #ff6b63; border-color: #ff6b63; }
.swal2-icon.swal2-warning { color: #d9a441; border-color: #d9a441; }

@media (max-width: 900px) {
    .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
    .brand-logo { width: 118px; height: 48px; }
    .side-nav a:hover, .side-nav a.active { box-shadow: none; }
}
@media (max-width: 640px) {
    .brand-logo { width: 108px; height: 44px; }
    .login-brand { align-items: flex-start; flex-direction: column; min-height: 0; }
    .login-brand .brand-logo { width: 210px; height: 140px; }
    .form-section { background: #202020; }
    .button-primary { min-height: 44px; }
}

@media (max-width: 900px) {
    .sidebar { position: static; width: auto; min-height: auto; padding: 12px 18px; flex-direction: row; align-items: center; gap: 20px; }
    .side-nav { display: flex; gap: 3px; margin: 0 auto 0 0; }
    .side-nav a { padding: 10px; font-size: 13px; }
    .sidebar-bottom { display: flex; align-items: center; gap: 5px; margin: 0; border: 0; padding: 0; }
    .admin-label { display: none; }
    .main-content { margin-left: 0; }
    .topbar { min-height: 88px; }
}
@media (max-width: 640px) {
    .sidebar { flex-wrap: wrap; gap: 8px 16px; }
    .brand { flex: 1; }
    .side-nav { order: 3; width: 100%; overflow-x: auto; }
    .side-nav a { flex: 0 0 auto; }
    .sidebar-bottom { margin-left: auto; }
    .topbar { min-height: 78px; padding: 17px 20px; }
    .topbar h1 { font-size: 20px; }
    .content-wrap { padding: 24px 18px 38px; }
    .welcome-row, .section-heading { align-items: flex-start; flex-direction: column; }
    .welcome-row .button, .section-heading .button { width: 100%; }
    .stats-grid { grid-template-columns: 1fr; gap: 10px; }
    .stat-card { padding: 17px; }
    .stat-card strong { margin-top: 6px; font-size: 25px; }
    .panel-card { padding: 18px; }
    .table-card { padding: 0; }
    .form-grid { grid-template-columns: 1fr; }
    .field, .field-full { grid-column: 1; }
    .form-card { padding: 21px; }
    .form-section { padding: 16px; }
    .form-actions { flex-direction: column-reverse; }
    .form-actions .button { width: 100%; }
    .login-card { padding: 27px 22px; }
    .actions-cell { align-items: stretch; }
    .actions-cell form, .actions-cell .button { flex: 1 1 145px; }
    .button-group { width: 100%; align-items: stretch; }
    .button-group > .button, .button-group > form { flex: 1 1 180px; }
    .status-filter { margin-top: 0; }
}

.slot-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px; }
.slot-card { padding: 14px; border-color: var(--line); background: var(--surface); transition: border-color .15s ease, background-color .15s ease, opacity .15s ease; }
.slot-card-header { margin-bottom: 10px; }
.slot-card-header h3 { color: var(--ink); font-size: 14px; }
.slot-card .status-pill { background: #353535; color: var(--muted); }
.slot-card .status-pill.status-ativo { background: #183a28; color: #8ee0ae; }
.slot-card .status-pill.status-inativo { background: #38312a; color: #e1bd85; }
.slot-card .status-pill.status-vazia { background: #303030; color: #aaa; }
.slot-summary { display: flex; min-height: 62px; align-items: center; gap: 12px; }
.slot-thumbnail { display: grid; width: 62px; height: 62px; flex: 0 0 62px; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: var(--bg-secondary); object-fit: cover; }
.slot-image-placeholder { color: var(--muted); font-size: 10px; text-align: center; }
.slot-name { overflow: hidden; color: var(--ink); font-size: 14px; text-overflow: ellipsis; }
.slot-empty-copy { font-size: 12px; }
.slot-actions { align-items: center; margin-top: 11px; }
.slot-actions form { display: inline-flex; margin: 0; }
.slot-card.slot-draggable { cursor: grab; }
.slot-card.slot-draggable:active { cursor: grabbing; }
.slot-card.slot-dragging { opacity: .5; }
.slot-card.slot-drop-target { border-color: var(--brand); background: #30271e; box-shadow: inset 0 0 0 1px var(--brand); }
.slot-card textarea { min-height: 80px; }
.fragrance-dialog { width: min(680px, calc(100vw - 28px)); max-width: 680px; max-height: min(88vh, 820px); padding: 0; overflow: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: 0 24px 80px rgb(0 0 0 / 55%); }
.fragrance-dialog::backdrop { background: rgb(0 0 0 / 72%); }
.fragrance-dialog > .swal2-container .swal2-popup,
dialog > .swal2-container .swal2-popup { max-width: min(32rem, calc(100vw - 24px)); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain; }
.fragrance-editor { display: grid; gap: 18px; padding: 22px; }
.fragrance-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.fragrance-dialog-header h2 { margin: 0; color: var(--ink); font-size: 20px; }
.fragrance-dialog-header .eyebrow { margin: 0 0 5px; }
.dialog-close { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-raised); color: var(--ink); font-size: 23px; line-height: 1; cursor: pointer; }
.dialog-close:hover { border-color: var(--gold); }
.fragrance-editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.fragrance-editor-grid .field-full { grid-column: 1 / -1; }
.fragrance-editor-grid textarea { width: 100%; min-height: 84px; padding: 10px 12px; border: 1px solid #484848; border-radius: 8px; outline: none; background: var(--bg-secondary); color: var(--ink); font: inherit; resize: vertical; }
.fragrance-editor-grid textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgb(255 133 0 / 18%); }
.fragrance-editor-grid small { color: var(--muted); font-size: 11px; line-height: 1.5; }
.fragrance-editor-grid .currency-input { min-width: 0; }
.fragrance-editor-grid .currency-input input { min-width: 0; background: transparent; }
.spray-pricing { min-width: 0; margin: 0; padding: 15px; border: 1px solid var(--line); border-radius: 10px; background: #202020; }
.spray-pricing legend { padding: 0 7px; color: var(--ink); font-size: 15px; font-weight: 750; }
.spray-pricing > p { margin: 0 0 12px; font-size: 12px; line-height: 1.5; }
.spray-price-list { display: grid; gap: 8px; }
.spray-price-row { display: grid; grid-template-columns: minmax(94px, 1fr) minmax(75px, .8fr) minmax(120px, 1fr) minmax(96px, auto); align-items: center; gap: 10px; padding: 9px; border: 1px solid var(--line); border-radius: 8px; background: #292929; }
.spray-price-row > strong { color: var(--ink); font-size: 13px; }
.spray-price-input { color: var(--muted); font-size: 11px; font-weight: 650; }
.spray-price-row .currency-input { min-height: 38px; }
.spray-price-row .currency-input span { padding-left: 9px; font-size: 11px; }
.spray-price-row .currency-input input { min-height: 36px; padding: 7px 8px; font-size: 13px; }
.spray-total { text-align: right; white-space: nowrap; }
.spray-option-toggle { display: flex; align-items: center; gap: 8px; color: var(--ink); cursor: pointer; }
.spray-option-toggle input[type="checkbox"] { width: 17px; min-height: 17px; margin: 0; accent-color: var(--brand); }
.spray-option-disabled .spray-option-toggle strong { color: var(--muted); }
.spray-option-status { color: var(--muted); font-size: 10px; }
.spray-stock-field { padding-top: 3px; }
.movement-history { margin-top: 18px; }
.movement-history > summary { color: var(--ink); font-weight: 700; cursor: pointer; }

@media (max-width: 640px) {
    .fragrance-dialog { width: calc(100vw - 20px); max-height: 92vh; }
    dialog > .swal2-container { padding: max(12px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); }
    .fragrance-dialog > .swal2-container .swal2-popup,
    dialog > .swal2-container .swal2-popup { width: min(100%, 32rem); max-height: calc(100vh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
    .fragrance-editor { gap: 14px; padding: 17px; }
    .fragrance-editor-grid { grid-template-columns: 1fr; gap: 13px; }
    .fragrance-editor-grid .field-full { grid-column: 1; }
    .spray-pricing { padding: 11px; }
    .spray-price-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
    .spray-price-input { grid-column: 1; grid-row: 2; }
    .spray-price-row .currency-input { grid-column: 2; grid-row: 2; }
    .spray-price-row > strong:last-child { grid-column: 2; grid-row: 1; }
    .spray-price-row > strong:first-child,
    .spray-price-row > .spray-option-toggle { grid-column: 1; grid-row: 1; }
    .fragrance-editor .slot-actions { justify-content: stretch; }
    .fragrance-editor .slot-actions .button { flex: 1; }
}
