:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #2C3E50;
  background: #f4f7f6;
  font-synthesis: none;
  --navy: #123f45;
  --navy-2: #185158;
  --teal: #0F5D5E;
  --teal-dark: #0B494A;
  --teal-soft: #e2f0ee;
  --amber: #D4A574;
  --red: #E74C3C;
  --red-soft: #fdebea;
  --green: #27AE60;
  --green-soft: #e5f6ec;
  --blue-soft: #e5eef7;
  --ink: #2C3E50;
  --muted: #687780;
  --line: #dbe3df;
  --surface: #fff;
  --surface-2: #f7f9f8;
  --radius: 14px;
  --shadow: 0 6px 26px rgba(20, 47, 55, .08);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: #f4f7f6; }
body { margin: 0; min-width: 320px; min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:disabled, input:disabled, select:disabled { cursor: not-allowed; opacity: .55; }
a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3, .stat-card strong { font-family: Inter, ui-sans-serif, system-ui, sans-serif; }
h1 { font-size: clamp(1.55rem, 3vw, 2.15rem); line-height: 1.15; letter-spacing: -.035em; }
h2 { font-size: 1.13rem; letter-spacing: -.015em; }
h3 { font-size: 1rem; }
small { color: var(--muted); }
.muted { color: var(--muted); }
.negative { color: var(--red) !important; }
.positive { color: var(--green) !important; }
.full { width: 100%; }
.span-2 { grid-column: 1 / -1; }

.shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 40; inset: 0 auto 0 0; width: 264px; display: flex; flex-direction: column; background: var(--navy); color: #effaf6; box-shadow: 8px 0 40px rgba(8, 30, 38, .12); }
.sidebar-brand { min-height: 86px; padding: 20px 18px; display: flex; align-items: center; gap: 11px; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar-brand > div:nth-child(2) { min-width: 0; display: flex; flex-direction: column; }
.sidebar-brand strong { font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-brand span { color: #9eb8b4; font-size: .7rem; margin-top: 2px; }
.brand-mark { width: 54px; height: 54px; border-radius: 17px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, var(--teal), #18a687); box-shadow: 0 8px 24px rgba(8,127,106,.23); flex: 0 0 auto; }
.brand-mark.small { width: 40px; height: 40px; border-radius: 12px; }
.sidebar nav { padding: 16px 11px; overflow-y: auto; display: grid; gap: 3px; scrollbar-width: thin; }
.sidebar nav a { display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 10px 12px; border-radius: 9px; text-decoration: none; color: #b9ceca; font-size: .88rem; font-weight: 500; transition: .16s ease; }
.sidebar nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar nav a.active { color: #fff; background: linear-gradient(90deg, rgba(14,151,126,.42), rgba(14,151,126,.16)); box-shadow: inset 3px 0 var(--teal); }
.sidebar-foot { padding: 12px; margin-top: auto; border-top: 1px solid rgba(255,255,255,.1); display: grid; gap: 10px; }
.connection { font-size: .7rem; color: #aec4c0; display: flex; align-items: center; gap: 7px; padding: 0 6px; }
.connection span { width: 7px; height: 7px; border-radius: 50%; background: #51d39a; box-shadow: 0 0 0 3px rgba(81,211,154,.12); }
.connection.offline span { background: #f16e7a; box-shadow: 0 0 0 3px rgba(241,110,122,.12); }
.profile-chip { display: flex; align-items: center; gap: 9px; background: rgba(255,255,255,.07); padding: 10px; border-radius: 11px; }
.profile-chip .avatar { width: 34px; height: 34px; border-radius: 10px; background: #e1a338; color: var(--navy); display: grid; place-items: center; font-weight: 800; }
.profile-chip > div:nth-child(2) { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.profile-chip strong { font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-chip span { color: #a8c0bb; font-size: .65rem; margin-top: 2px; }
.profile-chip button, .mobile-close { border: 0; background: transparent; color: #b9ceca; padding: 5px; display: grid; }
.content { min-height: 100vh; margin-left: 264px; padding: 34px clamp(22px, 3.5vw, 56px) 70px; }
.mobile-menu, .mobile-close, .sidebar-scrim { display: none; }

.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-header h1 { margin-bottom: 7px; }
.page-header p { color: var(--muted); margin: 0; max-width: 680px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 9px; }
.filters > label { font-size: .7rem; color: var(--muted); gap: 3px; }
.filters input, .filters select { min-height: 39px; padding: 8px 10px; }

label { display: flex; flex-direction: column; gap: 6px; color: #48575e; font-size: .8rem; font-weight: 600; }
input, select, textarea { width: 100%; min-height: 42px; border: 1px solid #ccd7d3; border-radius: 9px; background: #fff; color: var(--ink); padding: 9px 11px; outline: none; transition: border .15s, box-shadow .15s; }
textarea { resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(8,127,106,.11); }
.check-label { flex-direction: row; align-items: center; gap: 8px; padding-top: 23px; }
.check-label input { width: 18px; min-height: 18px; accent-color: var(--teal); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.form-section { padding: 18px 0; border-bottom: 1px solid var(--line); }
.form-section:first-child { padding-top: 0; }
.form-section h3 { margin-bottom: 14px; color: var(--teal-dark); }
.field-error { color: var(--red); font-weight: 600; }

.btn { min-height: 40px; border: 1px solid transparent; border-radius: 9px; padding: 9px 14px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-weight: 700; font-size: .82rem; text-decoration: none; transition: transform .12s, background .12s, border .12s; }
.btn:not(:disabled):active { transform: translateY(1px); }
.btn-primary { color: #fff; background: var(--teal); border-color: var(--teal); box-shadow: 0 4px 14px rgba(8,127,106,.16); }
.btn-primary:hover { background: var(--teal-dark); }
.btn-secondary { background: #fff; border-color: #cbd6d2; color: #34464e; }
.btn-secondary:hover { border-color: #8da49c; background: #f8faf9; }
.btn-ghost { background: transparent; color: var(--teal-dark); }
.btn-ghost:hover { background: var(--teal-soft); }
.btn-danger { color: var(--red); background: var(--red-soft); border-color: #f1c6ca; }
.btn-danger:hover { background: #f7d9dc; }
.btn-small { min-height: 33px; padding: 6px 9px; font-size: .74rem; }
.btn-large { min-height: 49px; padding: 12px 18px; font-size: .9rem; }
.icon-btn { width: 35px; height: 35px; border: 0; border-radius: 8px; display: grid; place-items: center; color: #52636a; background: #eef2f0; flex: 0 0 auto; }
.icon-btn:hover { background: #e2e9e6; }
.icon-btn.danger { color: var(--red); background: var(--red-soft); }

.panel, .card { background: var(--surface); border: 1px solid #e1e7e4; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.panel + .panel { margin-top: 20px; }
.table-panel { padding: 0; overflow: hidden; }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.panel-title h2, .panel-title h3 { margin: 0; display: flex; align-items: center; gap: 8px; }
.panel-title > span { min-width: 27px; height: 27px; border-radius: 9px; background: var(--teal-soft); color: var(--teal-dark); display: grid; place-items: center; font-size: .75rem; font-weight: 700; }
.two-column { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); gap: 20px; margin-top: 20px; }
.two-column > .panel { margin-top: 0; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 18px; }
.stat-grid.operational { margin-top: 0; }
.stat-card { min-height: 118px; display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid #e0e7e4; border-radius: 13px; padding: 17px; box-shadow: 0 4px 18px rgba(25,59,64,.055); }
.stat-card .stat-icon { width: 43px; height: 43px; border-radius: 12px; flex: 0 0 auto; display: grid; place-items: center; background: var(--teal-soft); color: var(--teal); }
.stat-card p { margin: 0 0 5px; color: var(--muted); font-size: .75rem; }
.stat-card strong { display: block; font-size: clamp(1.05rem, 1.7vw, 1.45rem); color: var(--navy); line-height: 1.15; overflow-wrap: anywhere; }
.stat-card small { display: block; margin-top: 6px; font-size: .67rem; }
.stat-card.stat-warn .stat-icon { background: #fff1dd; color: #b9750f; }
.alert-list { display: grid; gap: 8px; }
.alert-row { display: flex; gap: 10px; align-items: center; padding: 11px 12px; border-radius: 10px; background: #f8faf9; border-left: 3px solid #d7e2de; }
.alert-row.priority-1 { background: #fff8ed; border-left-color: var(--amber); }
.alert-row svg { color: var(--amber); flex: 0 0 auto; }
.alert-row div { display: flex; flex-direction: column; gap: 2px; }
.alert-row strong { font-size: .82rem; }
.alert-row small { text-transform: capitalize; }
.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.quick-action { min-height: 86px; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; text-decoration: none; font-size: .78rem; font-weight: 700; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); color: var(--navy); }
.quick-action svg { color: var(--teal); }
.quick-action:hover { border-color: #8cc5b7; background: var(--teal-soft); }

.toolbar { display: flex; gap: 10px; margin-bottom: 16px; }
.search-box { max-width: 520px; flex: 1; position: relative; }
.search-box svg { position: absolute; z-index: 1; left: 12px; top: 12px; color: #78908a; }
.search-box input { padding-left: 40px; }
.toolbar > select { width: auto; min-width: 155px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .78rem; }
th { background: #f3f6f5; color: #61716f; text-align: left; text-transform: uppercase; letter-spacing: .045em; font-size: .62rem; font-weight: 800; padding: 11px 13px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 13px; border-bottom: 1px solid #edf1ef; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfcfc; }
td strong, td small { display: block; }
td small { margin-top: 3px; }
.row-actions { display: flex; gap: 5px; align-items: center; justify-content: flex-end; white-space: nowrap; }
.status { display: inline-flex; align-items: center; width: fit-content; padding: 5px 8px; border-radius: 999px; font-size: .62rem; font-weight: 800; text-transform: capitalize; white-space: nowrap; background: #edf1f0; color: #566662; }
.status-active, .status-completed, .status-approved, .status-received, .status-healthy, .status-posted, .status-paid { background: var(--green-soft); color: var(--green); }
.status-reported, .status-requested, .status-submitted, .status-partially-received, .status-partial { background: #fff0d9; color: #9b630b; }
.status-verified, .status-ordered, .status-dispatched, .status-manager, .status-supervisor { background: var(--blue-soft); color: #2a6396; }
.status-rejected, .status-reversed, .status-cancelled, .status-inactive, .status-out, .status-disputed { background: var(--red-soft); color: var(--red); }
.status-low, .status-credit, .status-worker { background: #fff0d9; color: #9b630b; }

.empty-state { min-height: 205px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: #73837f; padding: 30px; }
.empty-state svg { color: #9eb0ab; margin-bottom: 10px; }
.empty-state strong { color: #465a58; }
.empty-state p { max-width: 430px; margin: 6px 0 15px; font-size: .8rem; }
.loading { min-height: 180px; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: .84rem; }
.spin { animation: spin .8s linear infinite; color: var(--teal); }
@keyframes spin { to { transform: rotate(360deg); } }
.error-panel, .info-callout, .warning-callout { display: flex; align-items: flex-start; gap: 11px; padding: 12px 14px; border-radius: 10px; margin: 13px 0; }
.error-panel { color: #8f2933; background: var(--red-soft); border: 1px solid #f4cdd1; }
.error-panel svg, .info-callout svg, .warning-callout svg { flex: 0 0 auto; margin-top: 1px; }
.error-panel div { flex: 1; }
.error-panel strong { font-size: .8rem; }
.error-panel p { margin: 2px 0 0; font-size: .76rem; }
.info-callout { color: #225f66; background: #e8f4f5; border: 1px solid #cae5e6; }
.warning-callout { color: #875a12; background: #fff5e4; border: 1px solid #f4ddb7; }
.info-callout p, .warning-callout p { margin: 0; font-size: .79rem; line-height: 1.45; }

.modal-backdrop { position: fixed; z-index: 100; inset: 0; background: rgba(10,28,34,.66); backdrop-filter: blur(3px); padding: 24px; display: grid; place-items: center; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 48px); overflow: hidden; background: #fff; border-radius: 16px; box-shadow: 0 24px 80px rgba(6,24,30,.3); display: flex; flex-direction: column; }
.modal-wide { width: min(980px, 100%); }
.modal > header { min-height: 62px; padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.modal > header h2 { margin: 0; font-size: 1.05rem; }
.modal-body { padding: 20px; overflow: auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 18px; }
.detail-list > div, .receipt-meta > div, .receipt-totals > div { display: flex; justify-content: space-between; gap: 10px; }
.detail-list dt, .receipt-meta dt, .receipt-totals dt { color: var(--muted); }
.detail-list dd, .receipt-meta dd, .receipt-totals dd { margin: 0; text-align: right; font-weight: 600; }
.document-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
.document-heading h3 { margin-bottom: 4px; }
.document-heading p { color: var(--muted); font-size: .76rem; margin-bottom: 3px; }
.document-total { display: flex; justify-content: flex-end; align-items: baseline; gap: 14px; border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; color: var(--muted); }
.document-total strong { font: 800 1.25rem Inter, ui-sans-serif, system-ui, sans-serif; color: var(--navy); }

.login-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.1fr) minmax(420px, .9fr); background: #fff; }
.login-art { min-height: 100vh; padding: clamp(38px, 7vw, 90px); color: #fff; display: flex; align-items: center; background: radial-gradient(circle at 80% 18%, rgba(24,166,135,.32), transparent 30%), linear-gradient(145deg, #0c252e, #123e49 62%, #087f6a); position: relative; overflow: hidden; }
.login-art::after { content: ""; position: absolute; width: 460px; height: 460px; right: -190px; bottom: -210px; border: 70px solid rgba(255,255,255,.055); border-radius: 50%; }
.login-art-inner { position: relative; z-index: 1; max-width: 580px; }
.login-art-inner > span { display: block; margin: 18px 0 52px; font-size: .75rem; font-weight: 800; letter-spacing: .14em; color: #afd5cc; }
.login-art h1 { font-size: clamp(2.8rem, 5vw, 5rem); letter-spacing: -.065em; line-height: .98; margin-bottom: 28px; }
.login-art p { max-width: 480px; color: #bdd2ce; font-size: 1rem; line-height: 1.6; }
.login-panel { display: grid; place-items: center; padding: 40px; }
.login-form { width: min(400px, 100%); display: grid; gap: 19px; }
.login-form h2 { font-size: 1.8rem; margin: 6px 0; }
.login-form p { color: var(--muted); }
.login-form > small { text-align: center; }
.mobile-brand { display: none; }
.eyebrow { color: var(--teal); font-size: .67rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.password-field { position: relative; }
.password-field > svg { position: absolute; left: 12px; top: 12px; color: #79908b; }
.password-field input { padding-left: 39px; padding-right: 42px; }
.password-field button { position: absolute; right: 7px; top: 6px; width: 32px; height: 32px; border: 0; background: transparent; color: #657873; }
.form-error { padding: 11px 13px; color: var(--red); background: var(--red-soft); border-radius: 8px; font-size: .8rem; }
.center-screen { min-height: 100vh; padding: 30px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.center-screen > p { max-width: 550px; color: var(--muted); }
.password-card { width: min(460px, 100%); display: grid; gap: 15px; text-align: left; padding: 30px; }
.password-card .brand-mark { margin-bottom: 6px; }
.password-card h1 { margin-bottom: 0; }
.password-card p { color: var(--muted); }
.help-text { font-size: .75rem; }
.config-error code { background: #e8eeeb; padding: 2px 5px; border-radius: 4px; }

.checkout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(390px, .85fr); gap: 18px; align-items: start; }
.product-picker { min-height: 650px; }
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.product-card { min-height: 150px; border: 1px solid var(--line); border-radius: 11px; padding: 13px; background: #fff; text-align: left; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; transition: border .12s, transform .12s, box-shadow .12s; }
.product-card:not(:disabled):hover { border-color: #84c4b5; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(8,127,106,.09); }
.product-card:disabled { background: #f3f5f4; }
.product-card strong { font-size: .82rem; line-height: 1.25; }
.product-card small { font-size: .66rem; }
.product-card > div:last-child { width: 100%; margin-top: auto; display: flex; flex-direction: column; gap: 3px; }
.product-card b { color: var(--teal-dark); font-size: .9rem; }
.product-card span:last-child { color: var(--muted); font-size: .62rem; }
.category-tag { padding: 3px 6px; border-radius: 5px; background: var(--teal-soft); color: var(--teal-dark) !important; font-size: .58rem !important; text-transform: uppercase; font-weight: 800; }
.cart-panel { position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow-y: auto; }
.cart-lines { display: grid; gap: 10px; }
.cart-line { border: 1px solid var(--line); border-radius: 10px; padding: 11px; }
.cart-line-title { display: flex; justify-content: space-between; gap: 10px; }
.cart-line-title strong, .cart-line-title small { display: block; }
.cart-line-title small { margin-top: 3px; }
.cart-controls { display: grid; grid-template-columns: .8fr 1.25fr 1fr; gap: 7px; margin-top: 10px; }
.cart-controls label, .cart-line > label { font-size: .66rem; }
.cart-controls input, .cart-controls select, .cart-line > label select { min-height: 36px; padding: 7px; }
.stepper { display: flex; }
.stepper input { border-radius: 0; text-align: center; min-width: 55px; padding-inline: 3px; }
.stepper button { width: 30px; border: 1px solid #ccd7d3; background: #f5f7f6; display: grid; place-items: center; }
.stepper button:first-child { border-radius: 8px 0 0 8px; }
.stepper button:last-child { border-radius: 0 8px 8px 0; }
.line-total { display: block; text-align: right; margin-top: 8px; color: var(--navy); }
.checkout-fields, .payment-block { display: grid; gap: 10px; border-top: 1px solid var(--line); margin-top: 15px; padding-top: 15px; }
.payment-line { display: grid; grid-template-columns: 1fr .8fr minmax(100px, 1.1fr) auto; gap: 6px; }
.payment-line > * { min-height: 38px; }
.checkout-total { margin: 16px -20px; padding: 16px 20px; background: #f2f8f6; display: grid; grid-template-columns: 1fr auto; align-items: baseline; }
.checkout-total strong { font: 800 1.6rem Inter, ui-sans-serif, system-ui, sans-serif; color: var(--navy); }
.checkout-total small { grid-column: 1 / -1; text-align: right; margin-top: 3px; }

.receipt { width: min(680px, 100%); margin: auto; color: #18252b; background: #fff; padding: 26px; border: 1px dashed #aebdb8; }
.receipt > header { text-align: center; padding-bottom: 16px; border-bottom: 2px solid #24363d; }
.receipt > header h2 { margin-bottom: 3px; }
.receipt > header p { margin: 2px 0; font-size: .76rem; }
.receipt > header > strong { display: block; margin-top: 10px; letter-spacing: .1em; font-size: .7rem; }
.receipt-meta { display: grid; gap: 5px; padding: 14px 0; margin: 0; font-size: .72rem; }
.receipt-lines { border-block: 1px solid #9faeaa; }
.receipt-lines th { background: transparent; color: #33464e; padding-inline: 7px; }
.receipt-lines td { padding: 9px 7px; }
.receipt-lines th:not(:first-child), .receipt-lines td:not(:first-child) { text-align: right; }
.receipt-totals { width: min(330px, 100%); margin: 14px 0 14px auto; display: grid; gap: 5px; font-size: .75rem; }
.receipt-totals .grand { border-top: 1px solid #879690; padding-top: 7px; margin-top: 3px; font-size: 1rem; }
.receipt-warning { text-align: center; color: var(--red); border: 2px solid var(--red); padding: 9px; font-weight: 800; }
.receipt footer { border-top: 1px dashed #aebdb8; padding-top: 14px; text-align: center; font-size: .72rem; }

.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.entity-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 4px 17px rgba(25,59,64,.05); padding: 16px; }
.entity-card > div:first-child { min-height: 45px; display: flex; justify-content: space-between; gap: 10px; }
.entity-card h3 { margin: 0; }
.entity-card > div:first-child > span:not(.status) { color: var(--muted); font-size: .68rem; text-transform: capitalize; }
.entity-card dl { display: grid; gap: 7px; margin: 13px 0; padding-block: 12px; border-block: 1px solid #eef2f0; }
.entity-card dl div { display: flex; justify-content: space-between; gap: 10px; font-size: .73rem; }
.entity-card dt { color: var(--muted); }
.entity-card dd { margin: 0; text-align: right; font-weight: 600; }
.card-list { display: grid; gap: 10px; }
.document-card { min-height: 82px; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 18px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; box-shadow: 0 3px 14px rgba(25,59,64,.045); }
.document-card h3 { margin: 4px 0; }
.document-card h3 span { color: var(--teal); margin-inline: 5px; }
.document-card.damage-card > div:nth-child(2) { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

.line-editor { display: grid; gap: 9px; }
.line-editor-row { display: grid; grid-template-columns: minmax(180px, 2fr) .7fr .7fr .8fr auto; align-items: end; gap: 7px; background: #f8faf9; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.line-editor-row.transfer-edit { grid-template-columns: minmax(200px, 2fr) minmax(140px, 1fr) .8fr auto; }
.receive-line { border: 1px solid var(--line); border-radius: 10px; padding: 9px; background: #f8faf9; }
.receive-line .line-editor-row { padding: 0; border: 0; }
.receive-line > small { display: block; text-align: right; margin-top: 7px; }
.lot-fields { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed #d2dcd8; }

.receive-confirm { margin-top: 18px; padding: 15px; border: 1px solid #cfe1db; border-radius: 11px; background: #f4faf8; }
.receive-confirm h3 { margin-bottom: 4px; }
.receive-check { display: grid; grid-template-columns: minmax(170px, 1fr) auto 110px 110px; gap: 10px; align-items: end; border-top: 1px solid #dce9e5; padding: 10px 0; }
.receive-check > span { color: var(--muted); font-size: .72rem; align-self: center; }
.damage-detail { display: grid; grid-template-columns: 1fr minmax(250px, .8fr); gap: 20px; }
.evidence-photo { width: 100%; max-height: 420px; object-fit: contain; border-radius: 10px; background: #eef2f0; }
.photo-placeholder { min-height: 220px; border: 1px dashed #bdcbc6; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--muted); }
.file-input { min-height: 76px; border: 1px dashed #9fb9b1; border-radius: 10px; padding: 16px; flex-direction: row; align-items: center; color: var(--teal-dark); background: #f5faf8; cursor: pointer; }
.file-input input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.count-table input { min-width: 120px; }
.closing-grid { align-items: start; }
.closing-grid > .panel { margin: 0; }
.closing-summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 14px 0; }
.closing-summary > div { background: #f5f8f7; border-radius: 9px; padding: 10px; display: flex; flex-direction: column; }
.closing-summary span { color: var(--muted); font-size: .66rem; }
.closing-summary strong { margin-top: 3px; }
.reconcile-lines { display: grid; gap: 8px; margin-bottom: 14px; }
.reconcile-row { display: grid; grid-template-columns: 1fr 130px 130px; align-items: end; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; }
.reconcile-row > div:first-child { display: flex; flex-direction: column; }
.reconcile-row span { color: var(--muted); font-size: .67rem; }
.reconcile-row > div:last-child { font-size: .71rem; font-weight: 700; padding-bottom: 10px; text-align: right; }
.closing-list { display: grid; gap: 6px; max-height: 600px; overflow-y: auto; }
.closing-list > button { width: 100%; border: 1px solid var(--line); border-radius: 9px; background: #fff; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px; padding: 11px; text-align: left; }
.closing-list > button:hover { background: var(--surface-2); }
.closing-list > button > div { display: flex; flex-direction: column; gap: 3px; }

.tabs { display: flex; gap: 4px; margin: 18px 0 10px; overflow-x: auto; }
.tabs button { border: 0; border-radius: 8px; padding: 9px 13px; background: transparent; color: var(--muted); font-weight: 700; font-size: .78rem; white-space: nowrap; }
.tabs button.active { color: var(--teal-dark); background: var(--teal-soft); }
.audit-json-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.audit-json-grid section { min-width: 0; }
.audit-json-grid pre { min-height: 170px; max-height: 360px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; background: #122830; color: #d5e9e3; border-radius: 9px; padding: 12px; font: .68rem/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; }
.credential-box { background: #eef7f4; border: 1px solid #cbe5dc; border-radius: 11px; padding: 15px; }
.credential-box p { margin: 0 0 12px; display: flex; flex-direction: column; gap: 3px; }
.credential-box p:last-child { margin-bottom: 0; }
.credential-box span { color: var(--muted); font-size: .68rem; }
.credential-box strong { font: 700 .9rem ui-monospace, monospace; overflow-wrap: anywhere; }

.toast-stack { position: fixed; z-index: 300; right: 18px; bottom: 18px; width: min(390px, calc(100% - 36px)); display: grid; gap: 8px; }
.toast { min-height: 52px; display: flex; align-items: center; gap: 9px; padding: 11px 12px; border-radius: 11px; color: #fff; background: #173b45; box-shadow: 0 12px 36px rgba(8,28,35,.25); font-size: .78rem; }
.toast-success svg { color: #6de1b0; }
.toast-error svg { color: #ff8d98; }
.toast span { flex: 1; }
.toast button { border: 0; background: transparent; color: #c4d5d1; display: grid; }

@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .checkout { grid-template-columns: minmax(0, 1fr) 400px; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .line-editor-row { grid-template-columns: 2fr .7fr .7fr; }
  .line-editor-row > :nth-last-child(-n+2) { grid-row: 2; }
  .lot-fields { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-104%); transition: transform .2s ease; }
  .sidebar-open { transform: translateX(0); }
  .sidebar-scrim { display: block; position: fixed; z-index: 35; inset: 0; border: 0; background: rgba(10,28,34,.58); }
  .mobile-close { display: grid; margin-left: auto; }
  .mobile-menu { display: grid; place-items: center; position: fixed; z-index: 30; top: 13px; left: 13px; width: 42px; height: 42px; border: 1px solid #d7e1dd; border-radius: 11px; background: #fff; color: var(--navy); box-shadow: var(--shadow); }
  .content { margin-left: 0; padding: 76px 20px 60px; }
  .checkout { grid-template-columns: 1fr; }
  .cart-panel { position: static; max-height: none; }
  .login-screen { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-panel { min-height: 100vh; }
  .mobile-brand { display: flex; align-items: center; gap: 9px; color: var(--teal-dark); }
  .two-column { grid-template-columns: 1fr; }
  .audit-json-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .content { padding-inline: 13px; }
  .page-header { flex-direction: column; gap: 13px; }
  .page-actions, .filters { width: 100%; justify-content: stretch; }
  .filters > *, .filters > label { flex: 1 1 130px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { min-height: 104px; padding: 12px; gap: 9px; }
  .stat-card .stat-icon { width: 35px; height: 35px; }
  .stat-card .stat-icon svg { width: 19px; }
  .stat-card strong { font-size: .95rem; }
  .panel { padding: 14px; }
  .product-picker { min-height: 0; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 7px; }
  .product-card { min-height: 135px; padding: 10px; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal { width: 100%; max-height: 94vh; border-radius: 17px 17px 0 0; }
  .modal-body { padding: 15px; }
  .modal-actions { position: sticky; bottom: -15px; background: #fff; border-top: 1px solid var(--line); padding: 12px 0 15px; }
  .cart-controls { grid-template-columns: 1fr 1.2fr; }
  .cart-controls label:last-child { grid-column: 1 / -1; }
  .payment-line { grid-template-columns: 1fr 1fr auto; }
  .payment-line input:nth-of-type(2) { grid-column: 1 / 3; }
  .card-grid { grid-template-columns: 1fr; }
  .document-card { grid-template-columns: 1fr auto; gap: 9px; }
  .document-card > .row-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .line-editor-row, .line-editor-row.transfer-edit { grid-template-columns: 1fr 1fr; }
  .line-editor-row > * { grid-row: auto !important; }
  .line-editor-row label:first-child { grid-column: 1 / -1; }
  .lot-fields { grid-template-columns: 1fr 1fr; }
  .receive-check { grid-template-columns: 1fr 1fr; }
  .receive-check > strong { grid-column: 1 / -1; }
  .damage-detail { grid-template-columns: 1fr; }
  .detail-list { grid-template-columns: 1fr; }
  .reconcile-row { grid-template-columns: 1fr 1fr; }
  .reconcile-row > div:last-child { grid-column: 1 / -1; padding: 0; text-align: left; }
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
  .login-panel { padding: 24px; }
  .receipt { padding: 14px; }
}

@media print {
  @page { margin: 8mm; size: auto; }
  body * { visibility: hidden !important; }
  .receipt, .receipt * { visibility: visible !important; }
  .receipt { position: absolute; left: 0; top: 0; width: 100%; max-width: none; border: 0; padding: 0; }
  .modal-backdrop { position: static; background: #fff; padding: 0; }
}

/* Dweniva Ops 5.0 product and SaaS controls */
.dweniva-logo { display: inline-flex; align-items: center; gap: 10px; width: fit-content; color: var(--teal-dark); }
.dweniva-logo img { width: 42px; height: 42px; display: block; }
.dweniva-logo > span { display: inline-flex; align-items: baseline; gap: 7px; }
.dweniva-logo strong { font-size: 1.1rem; letter-spacing: -.035em; }
.dweniva-logo b { padding: 3px 6px; border-radius: 6px; font-size: .57rem; letter-spacing: .08em; background: var(--amber); color: var(--navy); }
.dweniva-logo.inverse { color: #fff; }
.dweniva-logo.inverse b { color: var(--navy); }
.dweniva-logo.compact > span { display: none; }
.sidebar-brand { min-height: 78px; }
.sidebar-brand .dweniva-logo img { width: 36px; height: 36px; }
.sidebar-brand .dweniva-logo strong { font-size: 1rem; }
.tenant-card { margin: 12px 12px 2px; padding: 11px 12px; border: 1px solid rgba(255,255,255,.1); border-radius: 11px; background: rgba(255,255,255,.055); display: grid; gap: 4px; }
.tenant-card > span { color: #9eb8b4; font-size: .61rem; text-transform: uppercase; letter-spacing: .08em; }
.tenant-card > strong { font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tenant-card > small { color: #a9c0bd; font-size: .63rem; }
.tenant-select { position: relative; }
.tenant-select select { min-height: 34px; padding: 6px 30px 6px 8px; border-color: rgba(255,255,255,.15); background: rgba(0,0,0,.13); color: #fff; font-size: .75rem; }
.tenant-select option { color: var(--ink); }
.tenant-select svg { position: absolute; right: 8px; top: 9px; }
.sidebar nav a.platform-nav { margin-top: 8px; border-top: 1px solid rgba(255,255,255,.1); border-radius: 0 0 9px 9px; color: #f0cda7; }
.subscription-banner { margin: -10px 0 22px; padding: 11px 14px; border-radius: 11px; display: flex; gap: 10px; align-items: flex-start; background: #eef7f5; border: 1px solid #cae3de; color: var(--teal-dark); }
.subscription-banner > div { display: grid; gap: 2px; }
.subscription-banner strong { font-size: .78rem; }
.subscription-banner span { font-size: .71rem; }
.subscription-banner.state-past_due { color: #875a12; background: #fff5e4; border-color: #f4ddb7; }
.subscription-banner.state-read_only, .subscription-banner.state-suspended, .subscription-banner.state-cancelled { color: #8f2933; background: var(--red-soft); border-color: #f4cdd1; }
.status-trial { background: #fff0d9; color: #9b630b; }
.status-read-only, .status-past-due, .status-suspended, .status-cancelled { background: var(--red-soft); color: var(--red); }
.status-resolved { background: var(--green-soft); color: var(--green); }
.status-reversal { background: #f0e8f8; color: #7543a1; }

.mobile-brand-logo { display: none; }
.eyebrow.light { color: #d7ebe7; }
.login-art { background: radial-gradient(circle at 82% 18%, rgba(212,165,116,.22), transparent 30%), linear-gradient(145deg, #0a3839, #0F5D5E 64%, #174f50); }
.login-art-inner > span { margin: 26px 0 46px; color: #c4dcda; }
.login-proof { margin-top: 36px; max-width: 460px; display: flex; gap: 12px; padding: 14px; border: 1px solid rgba(255,255,255,.15); border-radius: 12px; background: rgba(0,0,0,.09); }
.login-proof svg { color: #f0cda7; flex: 0 0 auto; }
.login-proof span { display: grid; gap: 3px; }
.login-proof strong { font-size: .8rem; }
.login-proof small { color: #c4dcda; line-height: 1.4; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 10px; background: #eef2f0; }
.auth-tabs button { min-height: 37px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: .76rem; font-weight: 800; }
.auth-tabs button.active { background: #fff; color: var(--teal-dark); box-shadow: 0 2px 8px rgba(20,47,55,.08); }
.form-grid.compact { gap: 10px; }
.password-hint { margin-top: -10px; color: var(--muted); }
.password-hint.valid { color: var(--green); }
.verification-card { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 25px 12px; }
.verification-card > svg { width: 44px; height: 44px; color: var(--green); }
.verification-card h2, .verification-card p { margin: 0; }
.password-rules { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 14px; margin: 0; padding-left: 18px; color: var(--muted); font-size: .7rem; }
.password-rules li.met { color: var(--green); }
.password-card > .dweniva-logo { margin-bottom: 4px; }

.onboarding-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, .8fr) minmax(560px, 1.2fr); background: #fff; }
.onboarding-copy { padding: clamp(35px, 6vw, 76px); color: #fff; background: linear-gradient(150deg, #0a3839, #0F5D5E); display: flex; flex-direction: column; justify-content: center; }
.onboarding-copy > .eyebrow { margin-top: 60px; }
.onboarding-copy h1 { max-width: 560px; margin: 12px 0 20px; font-size: clamp(2.5rem, 4.7vw, 4.7rem); line-height: 1; letter-spacing: -.06em; }
.onboarding-copy > p { max-width: 530px; color: #c4dcda; line-height: 1.65; }
.onboarding-benefits { display: grid; gap: 12px; margin-top: 38px; }
.onboarding-benefits > div { display: flex; gap: 12px; align-items: flex-start; }
.onboarding-benefits svg { color: #f0cda7; flex: 0 0 auto; }
.onboarding-benefits span { display: grid; gap: 3px; }
.onboarding-benefits strong { font-size: .82rem; }
.onboarding-benefits small { color: #b9d2cf; line-height: 1.4; }
.onboarding-panel { min-height: 100vh; padding: 38px clamp(25px, 5vw, 70px); overflow-y: auto; }
.onboarding-form { width: min(760px, 100%); margin: auto; }
.onboarding-form > header { margin-bottom: 25px; }
.onboarding-form > header h2 { margin: 6px 0; font-size: 1.8rem; }
.onboarding-form > header p { color: var(--muted); }
.onboarding-form .form-section h3 { display: flex; align-items: center; gap: 7px; }
.plan-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.plan-picker button { min-height: 105px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; text-align: left; display: grid; gap: 4px; }
.plan-picker button.selected { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(15,93,94,.1); background: #f6fbfa; }
.plan-picker span { display: flex; align-items: center; gap: 5px; color: var(--teal-dark); font-weight: 800; }
.plan-picker strong { font-size: .84rem; }
.plan-picker small { font-size: .66rem; }
.onboarding-actions { margin-top: 24px; display: flex; justify-content: space-between; gap: 10px; }

.settings-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.settings-summary article { min-height: 92px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #fff; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow); }
.settings-summary article > svg { color: var(--teal); }
.settings-summary article > div { flex: 1; display: grid; gap: 2px; }
.settings-summary span { color: var(--muted); font-size: .65rem; }
.settings-summary strong { font-size: .92rem; }
.settings-summary small { font-size: .67rem; }
.settings-tabs { margin-top: 0; }
.panel-title > div > h2 { margin-bottom: 3px; }
.panel-title > div > p { margin: 0; color: var(--muted); font-size: .75rem; }
.panel-actions { margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.panel-actions > p, .panel-actions > span { margin: 0; max-width: 620px; font-size: .72rem; }
.risk-setting { color: #8f5d18; }
.export-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; }
.export-card > svg { color: var(--teal); }
.export-card h2 { margin-bottom: 6px; }
.export-card p { margin-bottom: 6px; color: var(--muted); line-height: 1.5; }

.import-panel { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr); gap: 18px; }
.file-drop { min-height: 190px; padding: 24px; border: 2px dashed #9ec2bb; border-radius: 12px; background: #f5faf9; align-items: center; justify-content: center; text-align: center; color: var(--teal-dark); cursor: pointer; }
.file-drop span { color: var(--muted); font-size: .7rem; font-weight: 500; }
.file-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.import-guidance { display: flex; align-items: flex-start; gap: 12px; padding: 18px; border-radius: 12px; background: #f8faf9; }
.import-guidance > svg { color: var(--amber); flex: 0 0 auto; }
.import-guidance p { margin: 5px 0 0; color: var(--muted); font-size: .77rem; line-height: 1.55; }
.import-guidance code { color: var(--teal-dark); }
.import-result { display: inline-flex !important; width: auto !important; height: auto !important; gap: 5px; padding: 7px 10px !important; }
.import-result.valid { background: var(--green-soft) !important; color: var(--green) !important; }
.import-result.invalid { background: var(--red-soft) !important; color: var(--red) !important; }
.import-result svg { width: 15px; }
.dispute-resolution h3 { display: flex; align-items: center; gap: 6px; }

.credit-aging { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.credit-aging .stat-card { min-height: 103px; }
.platform-guard { margin-top: -8px; }
.account-unavailable { gap: 8px; }

@media (max-width: 1100px) {
  .onboarding-screen { grid-template-columns: 1fr; }
  .onboarding-copy { min-height: auto; padding-block: 42px; }
  .onboarding-copy > .eyebrow { margin-top: 32px; }
  .onboarding-copy h1 { font-size: 2.7rem; }
  .onboarding-benefits { grid-template-columns: repeat(3, 1fr); }
  .onboarding-panel { min-height: auto; }
  .credit-aging { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .mobile-brand-logo { display: inline-flex; }
  .login-form { width: min(460px, 100%); }
  .onboarding-benefits { grid-template-columns: 1fr; }
  .import-panel { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .dweniva-logo img { width: 36px; height: 36px; }
  .onboarding-panel { padding: 28px 18px; }
  .onboarding-copy { padding: 30px 22px; }
  .onboarding-copy h1 { font-size: 2.3rem; }
  .plan-picker { grid-template-columns: 1fr; }
  .onboarding-actions { flex-direction: column-reverse; }
  .onboarding-actions .btn { width: 100%; }
  .settings-summary { grid-template-columns: 1fr; }
  .export-card { grid-template-columns: 1fr; }
  .panel-actions { align-items: stretch; flex-direction: column; }
  .panel-actions .btn { width: 100%; }
  .credit-aging { grid-template-columns: 1fr 1fr; }
  .password-rules { grid-template-columns: 1fr; }
}

/* Dweniva Ops 5.1 monthly close and hash-evidenced journal */
.month-close-filters { align-items: end; }
.month-close-hero { margin-bottom: 16px; padding: 22px; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 26px; align-items: center; background: linear-gradient(135deg, #f8fbfa 0%, #fff 58%, #fff8ed 100%); border-color: #d7e6e3; }
.month-close-identity { display: flex; align-items: flex-start; gap: 16px; }
.month-close-identity h2 { margin: 3px 0 8px; font-size: clamp(1.35rem, 2.4vw, 2rem); letter-spacing: -.035em; }
.month-close-identity p:not(.eyebrow) { margin: 0; max-width: 720px; color: var(--muted); line-height: 1.55; }
.month-close-icon { width: 58px; height: 58px; border-radius: 16px; background: var(--teal); color: #fff; display: grid; place-items: center; flex: 0 0 auto; box-shadow: 0 10px 25px rgba(15,93,94,.18); }
.month-close-icon svg { width: 29px; height: 29px; }
.month-close-controls { display: grid; gap: 12px; }
.month-close-controls textarea { min-height: 78px; }
.month-close-button { width: 100%; min-height: 46px; }
.month-summary-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.month-journal-stat .stat-icon { background: #eef7f5; color: var(--teal); }
.month-close-grid { margin: 16px 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.readiness-list { display: grid; gap: 9px; }
.readiness-row { padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; display: flex; align-items: center; gap: 10px; }
.readiness-row > span { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; }
.readiness-row > div { display: grid; gap: 2px; }
.readiness-row strong { font-size: .78rem; }
.readiness-row small { color: var(--muted); font-size: .68rem; }
.readiness-row.ready { border-color: #cce5dc; background: #f5fbf8; }
.readiness-row.ready > span { background: var(--green-soft); color: var(--green); }
.readiness-row.blocked { border-color: #f1d9b8; background: #fffaf1; }
.readiness-row.blocked > span { background: #fff0d9; color: #a66b0d; }
.missing-days { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 13px; }
.missing-days h3 { margin: 0 0 8px; font-size: .78rem; }
.missing-days > div { display: grid; grid-template-columns: 105px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: .7rem; }
.missing-days span, .missing-days small { color: var(--muted); }
.journal-contents { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.journal-contents > div { padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; display: flex; justify-content: space-between; align-items: center; gap: 10px; background: #fafcfb; }
.journal-contents span { color: var(--muted); font-size: .7rem; }
.journal-contents strong { color: var(--teal-dark); font-size: .86rem; }
.month-history { margin-top: 16px; }
.hash-code { display: inline-block; max-width: 155px; padding: 4px 7px; border-radius: 6px; background: #f1f4f3; color: var(--teal-dark); font-size: .65rem; white-space: nowrap; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.btn-small { min-height: 31px; padding: 6px 9px; font-size: .67rem; }
.confirmation-stack { display: grid; gap: 13px; }
.confirmation-stack > p { margin: 0; line-height: 1.55; }
.confirmation-emblem { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; color: var(--teal); background: #eef7f5; margin: 0 auto 3px; }
.note-preview { padding: 11px 12px; border-left: 3px solid var(--amber); background: #fff9f0; }
.note-preview p { margin: 4px 0 0; font-size: .75rem; }
.status-ready { background: var(--green-soft); color: var(--green); }
.status-action-required { background: #fff0d9; color: #9b630b; }
.status-closed { background: #e5f2ef; color: var(--teal-dark); }
.status-reopened { background: #f0e8f8; color: #7543a1; }

@media (max-width: 1100px) {
  .month-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .month-close-hero { grid-template-columns: 1fr; }
}

@media (max-width: 850px) {
  .month-close-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .month-close-filters { width: 100%; grid-template-columns: 1fr; }
  .month-close-filters > * { width: 100%; }
  .month-close-hero { padding: 17px; }
  .month-close-identity { flex-direction: column; }
  .month-summary-grid { grid-template-columns: 1fr 1fr; }
  .journal-contents { grid-template-columns: 1fr; }
  .missing-days > div { grid-template-columns: 1fr; gap: 3px; }
  .row-actions { min-width: 180px; }
}
.launch-plan-card { padding: 17px; border: 1px solid #b8d6d0; border-radius: 12px; background: linear-gradient(135deg, #f4faf8, #fffaf2); display: grid; gap: 6px; box-shadow: 0 8px 24px rgba(15,93,94,.07); }
.launch-plan-card > span { display: flex; align-items: center; gap: 7px; color: var(--teal-dark); font-weight: 850; }
.launch-plan-card > strong { font-size: 1.25rem; color: var(--navy); }
.launch-plan-card > small { color: var(--muted); }
.launch-plan-card > p { margin: 5px 0 0; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: .72rem; line-height: 1.5; }

/* ===== app splash (shown while JS modules load) ===== */
#app-splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  background: linear-gradient(165deg, #0F5D5E 0%, #0B494A 55%, #073d3e 100%);
  opacity: 1;
  transition: opacity .45s ease, visibility .45s ease;
}
#app-splash.app-splash-hide { opacity: 0; visibility: hidden; pointer-events: none; }
.app-splash-mark {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: #ffffff;
}
.app-splash-word {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -.02em;
}
.app-splash-tag {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .62);
}
.app-splash-bar {
  width: 148px;
  height: 3px;
  border-radius: 99px;
  overflow: hidden;
  background: rgba(255, 255, 255, .16);
}
.app-splash-bar span {
  display: block;
  width: 40%;
  height: 100%;
  border-radius: 99px;
  background: #E8C9A0;
  animation: app-splash-slide 1.15s cubic-bezier(.4, 0, .2, 1) infinite;
}
@keyframes app-splash-slide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(380%); }
}
.app-splash-note {
  margin: 0;
  min-height: 18px;
  color: rgba(255, 255, 255, .75);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 12.5px;
  letter-spacing: .01em;
  opacity: 0;
  transition: opacity .4s ease;
}
.app-splash-note.app-splash-note-show { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .app-splash-bar span { animation-duration: 2.6s; }
}

/* forgot-password link on login form */
.linklike {
  background: none;
  border: none;
  padding: 2px 0;
  color: var(--teal);
  font-size: .82rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.linklike:hover { color: var(--teal-dark); }

/* ===== notification center ===== */
.notif-root { position: fixed; top: 14px; right: 16px; z-index: 70; }
.notif-fab {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--navy);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.notif-fab:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(20,47,55,.16); }
.notif-badge {
  position: absolute;
  top: -5px;
  right: -6px;
  min-width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  color: #fff;
  font-size: .66rem;
  font-weight: 800;
  background: var(--red);
  border-radius: 99px;
}
.notif-panel {
  position: absolute;
  top: 54px;
  right: 0;
  width: min(400px, calc(100vw - 28px));
  max-height: min(520px, calc(100vh - 90px));
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(12,40,46,.22);
}
.notif-panel > header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  font-size: .92rem;
}
.notif-markall {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  color: var(--teal);
  font-size: .74rem;
  font-weight: 700;
  background: var(--teal-soft);
  border: none;
  border-radius: 8px;
}
.notif-empty { padding: 30px 20px; color: var(--muted); font-size: .84rem; text-align: center; }
.notif-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 11px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: #f2f9f7; box-shadow: inset 3px 0 0 var(--teal); }
.notif-kind {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
}
.notif-kind.low_stock { color: #a05a12; background: #fdf3e3; }
.notif-kind.morning_briefing { color: #155e75; background: #e3f2fa; }
.notif-body { display: grid; gap: 3px; min-width: 0; }
.notif-body strong { font-size: .85rem; letter-spacing: -.01em; }
.notif-body span { color: var(--muted); font-size: .78rem; line-height: 1.45; }
.notif-wa {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding: 6px 10px;
  color: #0d6e4f !important;
  font-size: .74rem;
  font-weight: 700;
  background: #e5f6ec;
  border-radius: 8px;
}
.notif-wa:hover { background: #d2eedd; }
.notif-item time { color: var(--muted); font-size: .68rem; white-space: nowrap; }
@media (max-width: 720px) { .notif-root { top: 10px; right: 10px; } }

.notif-push {
  position: sticky;
  bottom: 0;
  width: 100%;
  padding: 11px 16px;
  color: var(--teal);
  font-size: .8rem;
  font-weight: 700;
  background: var(--surface);
  border: none;
  border-top: 1px solid var(--line);
  text-align: left;
}
.notif-push:hover { background: var(--teal-soft); }
.notif-push.active { color: #0d6e4f; background: #e5f6ec; }
.notif-push.disabled { color: var(--muted); cursor: not-allowed; }

/* ===== update-available banner ===== */
.update-banner {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 95;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 28px);
  padding: 11px 14px;
  color: var(--ink);
  font-size: .82rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(12,40,46,.25);
}
.update-banner span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.update-banner button {
  padding: 7px 13px;
  color: #fff;
  font-size: .76rem;
  font-weight: 800;
  white-space: nowrap;
  background: var(--teal);
  border: none;
  border-radius: 8px;
}
.update-banner button:hover { background: var(--teal-dark); }

/* Keep frozen transaction fields aligned with the surrounding form. */
fieldset.form-grid, fieldset.line-editor { min-width: 0; margin: 0; padding: 0; border: 0; }
fieldset:disabled input, fieldset:disabled select, fieldset:disabled textarea { cursor: not-allowed; opacity: .72; }
