:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #302d20;
  background: #faf9f2;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; font-size: 14px; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
[hidden] { display: none !important; }

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(ellipse at 18% 12%, rgba(222, 214, 176, .32), transparent 34%),
    linear-gradient(145deg, #faf9f2, #f3f0e5 70%, #fbfaf6);
}
.login-card {
  width: min(100%, 420px);
  padding: 35px 36px 27px;
  border: 1px solid #e8e3d4;
  border-radius: 17px;
  background: rgba(255, 254, 250, .96);
  box-shadow: 0 18px 55px rgba(58, 50, 23, .09);
}
.login-brand { padding: 0 0 31px; }
.login-card h1 { margin-bottom: 0; font-size: 30px; }
.login-intro { margin: 8px 0 24px; color: #928a71; font-size: 13px; line-height: 1.55; }
.login-form { display: grid; gap: 15px; }
.login-form label { display: grid; gap: 7px; color: #696247; font-size: 11px; font-weight: 750; }
.login-form input { min-height: 47px; font-size: 14px; }
.login-submit { min-height: 46px; margin-top: 2px; font-size: 12px; }
.login-message { min-height: 0; margin: -4px 0 0; color: #a74d3e; font-size: 12px; line-height: 1.5; }
.login-message:empty { display: none; }
.login-footnote { display: flex; align-items: center; gap: 8px; margin-top: 22px; color: #9d967e; font-size: 10px; }
.login-footnote .dot { background: #699374; }

.shell { min-height: 100vh; display: flex; }
.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex: 0 0 246px;
  flex-direction: column;
  height: 100vh;
  padding: 27px 17px 20px;
  background: #fffef9;
  border-right: 1px solid #ece8d9;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 7px 38px; text-decoration: none; }
.brand-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: #fffef5;
  background: #716222;
  font: italic 27px Georgia, serif;
}
.brand strong { display: block; color: #3e381d; font: 22px Georgia, serif; letter-spacing: .2px; }
.brand small { display: block; margin-top: 3px; color: #a39b7e; font-size: 9px; font-weight: 750; letter-spacing: 1.15px; }
.nav-caption { padding: 0 11px 9px; color: #aaa48f; font-size: 10px; font-weight: 800; letter-spacing: 1.15px; }
.nav-gap { margin-top: 29px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 0;
  padding: 11px 12px;
  border-radius: 9px;
  color: #786f51;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.nav-item > span:first-child { width: 18px; color: #a69b6b; font-size: 17px; text-align: center; }
.nav-item:hover { background: #f7f4e8; color: #4a421f; }
.nav-item.active { color: #51471d; background: #f3efdf; }
.nav-item.active > span:first-child { color: #766625; }
.demo-badge { margin-left: auto; color: #86752e; font-size: 9px; font-weight: 800; letter-spacing: .6px; }
.sidebar-note { margin-top: auto; padding: 15px; border: 1px solid #eee9d9; border-radius: 11px; background: #faf8ef; color: #92896b; font-size: 11px; line-height: 1.65; }
.sidebar-note strong { display: block; margin: 5px 0 2px; color: #62572b; font-size: 12px; }
.sidebar-note span { color: #a29a80; }

.content { min-width: 0; flex: 1; background: linear-gradient(145deg, #faf9f2, #f8f6ec 58%, #fffdfa); }
.topbar {
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 42px;
  border-bottom: 1px solid #ece8dc;
  background: rgba(255, 254, 249, .92);
  color: #9b947b;
  font-size: 13px;
}
.topbar strong { color: #554b27; font-weight: 650; }
.crumb { padding: 0 9px; color: #c9c2a9; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.logout-button { padding: 7px 10px; border: 1px solid #e5dfcd; border-radius: 7px; color: #766b49; background: transparent; font-size: 10px; font-weight: 700; }
.logout-button:hover { background: #f7f4e9; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #756526; background: #f1eddb; font: 17px Georgia, serif; }
.mobile-nav { display: none; }
.container { width: min(100%, 1320px); margin: 0 auto; padding: 37px 42px 25px; }
.heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 23px; }
.eyebrow { margin-bottom: 7px; color: #887634; font-size: 10px; font-weight: 800; letter-spacing: 1.25px; }
.eyebrow span { padding: 0 3px; color: #c1b68e; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; color: #38331f; font: 30px Georgia, "Times New Roman", serif; letter-spacing: -.5px; }
.heading p, .section-title p { margin: 6px 0 0; color: #928a71; font-size: 13px; line-height: 1.55; }
.test-tag, .small-tag { white-space: nowrap; padding: 7px 11px; border: 1px solid #e8e1c8; border-radius: 20px; color: #77672b; background: #f8f5e8; font-size: 10px; font-weight: 750; }
.test-tag { display: inline-flex; align-items: center; gap: 7px; }
.dot { display: inline-block; width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: #a79755; }
.notice { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 20px; padding: 14px 16px; border: 1px solid #eee3c5; border-radius: 10px; color: #796a3e; background: #fffaf0; font-size: 12px; line-height: 1.65; }
.notice strong { color: #5e512d; }
.notice-icon { display: grid; width: 21px; height: 21px; flex: 0 0 21px; place-items: center; border: 1px solid #c6ad63; border-radius: 50%; color: #8d7631; font-weight: 800; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin-bottom: 19px; }
.stat, .card { border: 1px solid #ebe7da; border-radius: 12px; background: #fffefb; box-shadow: 0 4px 16px rgba(58, 50, 23, .035); }
.stat { min-width: 0; padding: 17px 19px; }
.stat-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #827a62; font-size: 12px; font-weight: 650; }
.stat-icon, .section-icon { display: grid; flex: 0 0 auto; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: #8d7b3b; background: #f4f0e2; font-size: 16px; }
.stat-icon.green { color: #55816b; background: #edf5ed; }
.stat-icon.amber { color: #a68136; background: #fff5e3; }
.stat > strong { display: block; margin-top: 4px; color: #433c23; font: 27px Georgia, serif; }
.stat > small { color: #aaa38e; font-size: 10px; }

#message { min-height: 0; margin: 0; color: #a74d3e; font-size: 12px; }
#message:not(:empty) { margin: 0 0 15px; padding: 10px 13px; border: 1px solid #efd6cf; border-radius: 8px; background: #fff5f1; }
#message.success { border-color: #d7e8d8; color: #4a7759; background: #f2f8f0; }
.card { min-width: 0; padding: 21px; }
.connection-card { margin-bottom: 17px; }
.section-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 19px; }
.section-title .eyebrow { margin-bottom: 4px; }
h2 { margin-bottom: 0; color: #403a25; font: 19px Georgia, "Times New Roman", serif; letter-spacing: -.2px; }
h3 { margin-bottom: 12px; color: #625a3e; font-size: 11px; font-weight: 800; letter-spacing: .35px; }
.section-icon { width: 36px; height: 36px; color: #837239; background: #f4f0e2; font-size: 19px; }
.connection-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.connection-status { display: flex; min-width: 0; flex: 1; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 9px; background: #f7f6ef; }
.connection-status .dot { background: #a69b74; }
.connection-status strong { display: block; color: #706744; font-size: 12px; }
.connection-status small { display: block; margin-top: 3px; color: #a39c83; font-size: 10px; }
.connection-status.online { background: #f0f7ef; }
.connection-status.online .dot { background: #5e9870; }
.connection-status.online strong { color: #4f795a; }
.connection-status.offline { background: #fff5ec; }
.connection-status.offline .dot { background: #c48a45; }
.connection-status.offline strong { color: #9a6d35; }
.connection-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.token-field { display: block; max-width: 480px; margin-top: 15px; color: #71694f; font-size: 11px; font-weight: 700; }
.token-field input { margin-top: 6px; }
.token-field small { display: block; margin-top: 5px; color: #a49d86; font-size: 10px; font-weight: 400; }

.workspace { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, .95fr); align-items: start; gap: 17px; margin-bottom: 17px; }
.form-card { padding: 22px; }
.data-form { display: grid; gap: 17px; }
.form-section { padding-top: 1px; }
.form-section + .form-section { padding-top: 15px; border-top: 1px solid #f0ede4; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 11px; }
.field-grid label, .token-field { display: flex; flex-direction: column; gap: 6px; }
.field-grid label { min-width: 0; color: #696247; font-size: 11px; font-weight: 700; }
.optional { margin-left: 4px; color: #a9a28d; font-size: 10px; font-weight: 400; }
input, select, textarea {
  width: 100%;
  min-width: 0;
  min-height: 41px;
  padding: 9px 11px;
  border: 1px solid #e6e1d3;
  border-radius: 8px;
  outline: none;
  color: #403c2e;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 80px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #b6b09e; }
input:focus, select:focus, textarea:focus { border-color: #b0a16a; box-shadow: 0 0 0 3px rgba(176, 161, 106, .14); }
.full-width { grid-column: 1 / -1; }
.input-suffix { display: flex; align-items: center; min-height: 41px; padding: 0 10px; border: 1px solid #e6e1d3; border-radius: 8px; background: #fff; }
.input-suffix:focus-within { border-color: #b0a16a; box-shadow: 0 0 0 3px rgba(176, 161, 106, .14); }
.input-suffix input { min-height: 39px; padding: 8px 0; border: 0; box-shadow: none; }
.input-suffix span { color: #a39b80; font-size: 10px; font-weight: 600; }
.primary-button, .secondary-button {
  min-height: 41px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 750;
  transition: background .15s, border-color .15s, transform .15s;
}
.primary-button { color: #fffef7; background: #746426; border-color: #746426; }
.primary-button:hover { background: #5d511d; border-color: #5d511d; }
.secondary-button { display: inline-flex; align-items: center; justify-content: center; color: #665a2d; background: #fffefb; border-color: #e4dec9; text-decoration: none; }
.secondary-button:hover { background: #f8f5e9; border-color: #d5cba9; }
.text-button { min-height: 34px; padding: 5px 8px; border: 0; color: #857438; background: transparent; font-size: 11px; font-weight: 700; }
.text-button:hover { color: #5b4f20; background: #f7f4e9; }
.form-footnote { margin: -7px 0 0; color: #9e977f; font-size: 10px; line-height: 1.55; }

.records-card { margin-bottom: 17px; }
.records-card .section-title { align-items: center; margin-bottom: 13px; }
.records-list { display: grid; }
.records-empty { padding: 20px 10px 16px; color: #958d75; text-align: center; font-size: 11px; }
.records-empty strong { display: block; margin-top: 7px; color: #6d654b; font-size: 12px; }
.records-empty p { margin: 5px 0 0; }
.empty-icon { display: grid; width: 36px; height: 36px; margin: 0 auto; place-items: center; border-radius: 10px; color: #9b8b51; background: #f5f1e4; font-size: 18px; }
.business-premise-record, .invoice { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 14px 0; border-top: 1px solid #f0ede4; }
.business-premise-record:first-child, .invoice:first-child { border-top: 0; }
.record-main { min-width: 0; }
.record-main strong { display: block; color: #514a32; font-size: 12px; }
.record-main small { display: block; margin-top: 5px; color: #99927c; font-size: 10px; overflow-wrap: anywhere; }
.record-side { flex: 0 0 auto; text-align: right; }
.record-amount { display: block; color: #514a32; font-size: 12px; font-weight: 800; }
.status { display: inline-block; margin-top: 5px; padding: 4px 8px; border-radius: 20px; color: #75672d; background: #f5f0df; font-size: 9px; font-weight: 800; }
.status.confirmed, .status.registered { color: #4e795b; background: #edf5ed; }
.status.pending, .status.inflight { color: #99732d; background: #fff5e3; }
.status.unknown, .status.rejected, .status.blocked { color: #a34f3e; background: #fff0ec; }
.record-actions { display: flex; flex: 1 0 100%; flex-wrap: wrap; gap: 7px; margin-top: 0; }
.record-actions button { min-height: 32px; font-size: 10px; }
.state-help { margin: 5px 0 9px; color: #8f876f; font-size: 10px; }
.state-help summary { cursor: pointer; font-weight: 700; }
.state-help p { margin: 8px 0 0; line-height: 1.6; }
footer { padding: 12px 0 5px; color: #aaa38c; font-size: 10px; text-align: center; }
.mobile-nav { display: none; }

@media (max-width: 1050px) {
  .sidebar { flex-basis: 218px; }
  .topbar { padding: 0 27px; }
  .container { padding: 30px 27px 22px; }
  .workspace { grid-template-columns: minmax(0, 1fr) minmax(320px, .95fr); }
  .form-card { padding: 18px; }
}
@media (max-width: 820px) {
  .sidebar { display: none; }
  .topbar { height: 58px; padding: 0 18px; }
  .mobile-nav { display: flex; gap: 8px; overflow-x: auto; padding: 9px 16px; border-bottom: 1px solid #ece8dc; background: #fffef9; }
  .mobile-nav a { flex: 0 0 auto; padding: 7px 10px; border-radius: 20px; color: #756a47; background: #f5f2e7; font-size: 10px; font-weight: 700; text-decoration: none; }
  .container { padding: 26px 18px 20px; }
  .workspace { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .login-screen { padding: 18px; }
  .login-card { padding: 29px 23px 24px; border-radius: 14px; }
  .login-brand { padding-bottom: 26px; }
  .topbar { font-size: 11px; }
  .topbar-right { gap: 7px; }
  .topbar-right .small-tag { padding: 6px 8px; font-size: 9px; }
  .logout-button { padding: 6px 7px; font-size: 9px; }
  .avatar { width: 30px; height: 30px; }
  .heading { align-items: flex-start; flex-direction: column; gap: 12px; }
  h1 { font-size: 26px; }
  .stats { gap: 8px; }
  .stat { padding: 12px 10px; }
  .stat-label { min-height: 30px; font-size: 9px; }
  .stat-icon { display: none; }
  .stat > strong { font-size: 22px; }
  .stat > small { font-size: 9px; }
  .card { padding: 16px; }
  .connection-row { align-items: stretch; flex-direction: column; }
  .connection-actions { justify-content: space-between; }
  .field-grid { grid-template-columns: 1fr; }
  .full-width { grid-column: auto; }
  .business-premise-record, .invoice { flex-direction: column; }
  .record-side { text-align: left; }
}
