:root {
  --bg: #edf6fc;
  --bg-strong: #d9ebf7;
  --surface: #ffffff;
  --surface-soft: #f8fbfd;
  --surface-tint: #edf7f8;
  --ink: #172033;
  --ink-soft: #334155;
  --muted: #68778b;
  --line: #d9e3ec;
  --line-strong: #c6d4df;
  --accent: #00a8ff;
  --accent-strong: #0077b6;
  --blue: #00a8ff;
  --green: #15956f;
  --amber: #c98316;
  --rose: #d23f57;
  --shadow: 0 18px 45px rgba(45, 64, 87, .12);
  --shadow-soft: 0 10px 30px rgba(45, 64, 87, .09);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  background:
    radial-gradient(circle at 12% 10%, rgba(0, 168, 255, .13), transparent 30%),
    radial-gradient(circle at 88% 6%, rgba(101, 217, 255, .12), transparent 24%),
    linear-gradient(180deg, #f8fcff 0, var(--bg) 360px);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

body.login {
  display: block;
  place-items: center;
  padding: 42px 24px;
  background:
    radial-gradient(circle at 78% 24%, rgba(0, 168, 255, .24), transparent 28%),
    linear-gradient(135deg, #061525, #073153 65%, #006b9e 135%);
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.12;
  font-weight: 900;
  color: var(--ink);
}

h2 {
  font-size: 20px;
  line-height: 1.25;
  color: var(--ink);
}

h3 {
  font-size: 16px;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 14px;
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(6, 21, 37, .98), rgba(7, 40, 63, .97));
  border-right: 1px solid rgba(101, 217, 255, .14);
  box-shadow: 12px 0 34px rgba(4, 16, 27, .18);
  backdrop-filter: blur(18px);
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 10px 18px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, .11);
}

.brand-logo {
  width: 82px;
  height: auto;
  flex: 0 0 auto;
}

.brand strong {
  display: block;
  max-width: 112px;
  overflow: hidden;
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand small {
  display: block;
  max-width: 112px;
  margin-top: 3px;
  overflow: hidden;
  color: #91a7b9;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav {
  display: grid;
  gap: 5px;
  padding-top: 8px;
}

.nav-toggle { display: none; }

.nav a {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 42px;
  border-radius: 8px;
  padding: 10px 12px;
  color: #b8cad7;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}

.nav a::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 10px;
  border-radius: 99px;
  background: #31566f;
  transition: background .16s ease, box-shadow .16s ease;
}

.nav a:hover {
  background: rgba(0, 168, 255, .12);
  color: #65d9ff;
  transform: translateX(2px);
}

.nav a.active {
  background: linear-gradient(135deg, rgba(0, 168, 255, .24), rgba(101, 217, 255, .08));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(101, 217, 255, .22);
}

.nav a.active::before {
  background: #65d9ff;
  box-shadow: 0 0 0 4px rgba(101, 217, 255, .14);
}

.app {
  min-width: 0;
  padding: 24px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 14;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: -24px -24px 24px;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(217, 227, 236, .88);
  background: rgba(247, 251, 255, .92);
  box-shadow: 0 12px 30px rgba(45, 64, 87, .08);
  backdrop-filter: blur(18px);
}

.page-title {
  min-width: 220px;
}

.page-title span {
  display: block;
  margin-bottom: 5px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.topbar-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  flex-wrap: wrap;
}

.market-pill,
.topbar-logout,
.user-pill {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 22px rgba(45, 64, 87, .07);
}

.user-pill {
  padding: 7px 11px 7px 8px;
  gap: 9px;
}

.user-pill > span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #65d9ff);
  color: #fff;
  font-weight: 900;
}

.user-pill div { display: grid; gap: 1px; }
.user-pill strong { color: var(--ink); font-size: 12px; }
.user-pill small { color: var(--muted); font-size: 10px; }

.market-pill {
  min-width: 108px;
  padding: 8px 11px;
}

.market-pill span,
.market-pill small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.market-pill strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.time-pill {
  min-width: 170px;
  flex-direction: row;
  gap: 10px;
  align-items: center;
}

.time-pill strong {
  font-size: 15px;
}

.topbar-logout {
  padding: 9px 13px;
  color: var(--rose);
  font-size: 13px;
  font-weight: 900;
}

.topbar-logout:hover {
  border-color: rgba(210, 63, 87, .28);
  background: #fff4f6;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.split {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.panel,
.stat {
  border: 1px solid rgba(201, 214, 225, .9);
  border-radius: 8px;
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--shadow-soft);
}

.panel {
  overflow: hidden;
}

.panel + .panel,
.section-panel {
  margin-top: 18px;
}

.panel-head {
  padding: 17px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #f7fbfd);
}

.panel-head h1,
.panel-head h2 {
  color: var(--ink);
}

.panel-head p {
  max-width: 760px;
  margin-top: 6px;
  line-height: 1.45;
}

.panel-head-spread,
.table-toolbar,
.action-strip,
.line-items-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.panel-body {
  padding: 18px;
}

.stat {
  position: relative;
  min-height: 112px;
  padding: 17px;
  overflow: hidden;
  border-top: 4px solid var(--accent);
}

.stat::after {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -34px;
  width: 110px;
  height: 110px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(15, 138, 163, .12), rgba(37, 99, 235, .06));
}

.stat:nth-child(4n + 2) {
  border-top-color: var(--green);
}

.stat:nth-child(4n + 3) {
  border-top-color: var(--amber);
}

.stat:nth-child(4n + 4) {
  border-top-color: var(--blue);
}

.stat span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.stat strong {
  position: relative;
  z-index: 1;
  color: var(--ink);
  font-size: clamp(21px, 2vw, 27px);
  font-weight: 900;
  line-height: 1.16;
}

.stat small {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 10px 11px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(15, 138, 163, .62);
  box-shadow: 0 0 0 4px rgba(15, 138, 163, .12);
}

select:disabled,
input:disabled,
textarea:disabled {
  background: #f3f7fa;
  color: var(--muted);
}

.search-input {
  width: min(360px, 100%);
  background: #fff;
}

.input-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.lookup-status {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.lookup-status.success {
  color: var(--green);
}

.lookup-status.warn {
  color: var(--amber);
}

.lookup-status.error {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--rose);
}

button,
.button {
  min-height: 38px;
  width: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 13px;
  background: linear-gradient(135deg, var(--accent), #16a085);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.1;
  box-shadow: 0 12px 24px rgba(15, 138, 163, .18);
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease, border-color .14s ease;
}

button:hover,
.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(15, 138, 163, .22);
}

button:active,
.button:active {
  transform: translateY(0);
}

.secondary-button {
  border-color: var(--line);
  background: #fff;
  color: var(--ink-soft);
  box-shadow: none;
}

.secondary-button:hover {
  border-color: rgba(15, 138, 163, .32);
  background: #f0f8fa;
  color: var(--accent-strong);
  box-shadow: 0 10px 22px rgba(45, 64, 87, .07);
}

.danger-button {
  border-color: rgba(210, 63, 87, .26);
  background: #fff;
  color: var(--rose);
  box-shadow: none;
}

.danger-button:hover {
  background: #fff4f6;
  box-shadow: 0 10px 22px rgba(210, 63, 87, .10);
}

.small-button {
  min-height: 32px;
  padding: 7px 10px;
  font-size: 12px;
}

.icon-button {
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 23px;
  line-height: 1;
  box-shadow: none;
}

.icon-button:hover {
  background: #eef7f8;
  color: var(--accent-strong);
  box-shadow: none;
}

.table-link {
  color: var(--accent-strong);
  font-weight: 900;
}

.table-link:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f2f7fb;
  color: #526376;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
}

td {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.35;
}

tbody tr {
  background: #fff;
  transition: background .14s ease;
}

tbody tr:hover {
  background: #f8fcfd;
}

td small,
.accounts-table small,
.products-table small,
.bank-card small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.42;
}

.accounts-table {
  min-width: 1040px;
}

.products-table {
  min-width: 1120px;
}

.commercial-table {
  min-width: 1180px;
}

.table-toolbar,
.action-strip {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.action-strip {
  border-bottom: 0;
}

.inline-actions,
.action-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  min-width: 0;
}

.action-row {
  justify-content: flex-end;
}

.inline-form {
  display: inline-flex;
  gap: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 25px;
  border-radius: 999px;
  padding: 4px 10px;
  background: #e7f7f3;
  color: #087156;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.warn-badge {
  background: #fff3dc;
  color: #995b00;
}

.danger-badge {
  background: #fff0f3;
  color: var(--rose);
}

.success-badge {
  background: #e8f8ee;
  color: #0f7b47;
}

.danger {
  color: var(--rose);
}

.muted {
  color: var(--muted);
}

.notice,
.error {
  border-radius: 8px;
  padding: 12px 14px;
  font-weight: 900;
}

.notice {
  margin-bottom: 18px;
  border: 1px solid rgba(21, 149, 111, .26);
  background: #eaf8f2;
  color: #0e7055;
}

.error {
  margin-bottom: 12px;
  border: 1px solid rgba(210, 63, 87, .24);
  background: #fff4f6;
  color: var(--rose);
}

.catalog-tabs,
.module-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.catalog-tabs {
  padding: 14px 18px 0;
}

.module-tabs {
  padding: 12px 18px;
}

.catalog-tab,
.module-tabs a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  padding: 9px 12px;
  background: #fff;
  color: var(--ink-soft);
  font-weight: 900;
  white-space: nowrap;
  box-shadow: none;
}

.module-tabs a {
  border-radius: 8px;
}

.catalog-tab.active,
.module-tabs a.active {
  border-color: rgba(15, 138, 163, .24);
  background: linear-gradient(135deg, #e6f7f8, #eef6ff);
  color: var(--accent-strong);
}

.module-tabs span {
  min-width: 22px;
  border-radius: 999px;
  padding: 2px 7px;
  background: rgba(15, 138, 163, .13);
  color: var(--accent-strong);
  font-size: 12px;
  text-align: center;
}

.catalog-tab-panel[hidden],
.modal-split > article[hidden] {
  display: none;
}

.tab-panels {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.compact-upload {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(160px, 1.2fr) auto;
  gap: 8px;
  min-width: 520px;
}

.compact-upload input,
.match-grid select,
.match-grid input {
  min-width: 0;
  padding: 8px;
  font-size: 12px;
}

.match-grid {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(180px, 1.2fr) minmax(200px, 1.4fr) minmax(110px, .8fr) auto;
  gap: 8px;
  align-items: center;
}

.detail-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  margin-bottom: 18px;
}

.detail-title {
  min-width: 0;
}

.detail-title h2 {
  margin-top: 8px;
  font-size: 24px;
  overflow-wrap: anywhere;
}

.detail-title p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.back-link {
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(300px, .9fr) minmax(320px, 1.1fr);
  gap: 18px;
  margin-bottom: 18px;
}

.info-list,
.compact-list {
  display: grid;
}

.info-list {
  gap: 14px;
}

.compact-list {
  gap: 10px;
}

.info-list span,
.compact-list span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.info-list strong {
  display: block;
  margin-top: 4px;
  line-height: 1.45;
}

.account-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: linear-gradient(180deg, #ffffff, #f8fbfd);
}

.account-preview .info-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 16px;
}

.account-preview .info-list div {
  min-width: 0;
}

.account-preview .info-list div:last-child {
  grid-column: 1 / -1;
}

.account-preview .info-list span {
  font-size: 11px;
}

.account-preview .info-list strong {
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.list-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff;
}

.line-items-head {
  margin-top: 18px;
}

.line-items {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.line-item {
  display: grid;
  grid-template-columns: 1.1fr 1.2fr .55fr .55fr .75fr .55fr .7fr .7fr auto;
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: linear-gradient(180deg, #fff, #fbfdff);
  box-shadow: 0 8px 24px rgba(45, 64, 87, .06);
}

.currency-line-item {
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  align-items: stretch;
}

.currency-line-item .line-catalog-field,
.currency-line-item label:nth-of-type(2) {
  grid-column: span 2;
}

.currency-line-item .line-catalog-field {
  grid-column: span 3;
}

.selected-catalog-preview {
  display: block;
  margin-top: 6px;
  min-height: 18px;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.selected-catalog-preview[hidden] {
  display: none;
}

.currency-line-item .line-total,
.currency-line-item button {
  min-width: 0;
}

.currency-line-item .js-remove-line {
  align-self: end;
}

.line-total {
  min-height: 42px;
  display: grid;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--surface-soft);
}

.line-total span,
.quote-total-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.line-total strong,
.quote-total-box strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.quote-total-box {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  margin: 16px 0;
  flex-wrap: wrap;
}

.quote-total-box div {
  min-width: 190px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(45, 64, 87, .06);
}

.quote-item-mini {
  display: grid;
  gap: 3px;
  margin-bottom: 8px;
}

.quote-item-mini span {
  color: var(--muted);
  font-size: 12px;
}

.bank-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 14px;
}

.bank-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
  background: linear-gradient(180deg, #fff, #f8fcfd);
  box-shadow: 0 8px 24px rgba(45, 64, 87, .06);
}

.bank-card strong {
  color: var(--ink);
  font-size: 18px;
}

.bank-card b {
  color: var(--accent-strong);
  font-size: 24px;
}

.bank-card span {
  display: block;
  color: var(--muted);
}

.check-row {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 9px;
  color: var(--ink-soft);
}

.check-row input {
  width: auto;
  min-height: auto;
}

.currency-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.currency-summary article,
.permission-grid-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.currency-summary span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.currency-summary strong {
  font-size: 18px;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px 12px;
  align-items: start;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 32, 51, .44);
  backdrop-filter: blur(4px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(880px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid rgba(201, 214, 225, .95);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(23, 32, 51, .24);
}

.modal-card-wide {
  width: min(1120px, calc(100vw - 32px));
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #f7fbfd);
}

.modal-card form {
  padding: 18px;
}

.modal-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.wide-field {
  grid-column: 1 / -1;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
  flex-wrap: wrap;
}

.modal-open {
  overflow: hidden;
}

.login-shell {
  position: relative;
  width: min(1080px, 100%);
  min-height: calc(100vh - 84px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(380px, .8fr);
  align-items: stretch;
  overflow: hidden;
  border: 1px solid rgba(101, 217, 255, .24);
  border-radius: 24px;
  background: rgba(5, 24, 39, .82);
  box-shadow: 0 40px 110px rgba(0, 0, 0, .42);
}

.login-showcase {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(42px, 7vw, 82px);
  overflow: hidden;
  color: #fff;
  background: linear-gradient(145deg, rgba(3, 20, 33, .94), rgba(0, 91, 139, .72));
}

.login-showcase::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 420px;
  height: 420px;
  right: -170px;
  bottom: -170px;
  border-radius: 50%;
  border: 70px solid rgba(101, 217, 255, .11);
  box-shadow: 0 0 0 45px rgba(0, 168, 255, .07);
}

.login-grid-art {
  position: absolute;
  inset: 0;
  z-index: -2;
  opacity: .18;
  background-image: linear-gradient(rgba(101,217,255,.28) 1px, transparent 1px), linear-gradient(90deg, rgba(101,217,255,.28) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(135deg, #000, transparent 78%);
}

.login-showcase img { width: min(280px, 78%); margin-bottom: 46px; }
.login-showcase > span { color: #65d9ff; font-size: 11px; font-weight: 900; letter-spacing: 1.6px; text-transform: uppercase; }
.login-showcase h1 { max-width: 560px; margin-top: 14px; color: #fff; font-size: clamp(36px, 5vw, 62px); letter-spacing: -.04em; }
.login-showcase p { max-width: 590px; margin-top: 20px; color: #b8d5e4; font-size: 16px; line-height: 1.7; }
.login-features { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 30px; }
.login-features b { padding: 9px 12px; border: 1px solid rgba(101,217,255,.2); border-radius: 8px; background: rgba(4,22,36,.48); color: #d9f4ff; font-size: 11px; }

.login-card {
  width: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  border-color: rgba(101, 217, 255, .26);
  box-shadow: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-card .panel-head {
  text-align: center;
}

.login-brand {
  padding: 36px 38px 22px;
  background: #fff;
  color: var(--ink);
}

.login-brand img {
  width: min(240px, 88%);
  height: auto;
  margin-bottom: 20px;
}

.login-brand span {
  display: block;
  margin-bottom: 8px;
  color: #65d9ff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

.login-brand h1 {
  color: var(--ink);
  font-size: 38px;
}

.login-brand p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.login-card .panel-body { padding: 10px 38px 38px; }
.login-card form { display: grid; gap: 16px; }
.login-card button { width: 100%; margin-top: 4px; min-height: 48px; }
.mobile-install { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); text-align: center; }
.mobile-install button { min-height: 42px; }
.mobile-install small { display: block; margin-top: 9px; color: var(--muted); font-size: 11px; line-height: 1.45; }

/* 2026 kurumsal mavi arayüz düzeni */
@media (min-width: 1181px) {
  .topbar {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) auto;
  }
  .topbar-tools { width: auto; flex-wrap: nowrap; }
}

.page-title h1 {
  max-width: 100%;
  font-size: clamp(23px, 2.25vw, 36px);
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.panel,
.stat {
  border-color: #cfe1ee;
  box-shadow: 0 14px 34px rgba(18, 83, 124, .09);
}

.panel-head { background: linear-gradient(180deg, #fff, #f3f9fd); }
.stat { border-top: 4px solid #00a8ff !important; }
.stat::after { background: linear-gradient(135deg, rgba(0,168,255,.12), rgba(101,217,255,.04)); }
.stat strong { color: #071c30; }

button,
.button {
  background: linear-gradient(135deg, #008fd5, #00a8ff);
  box-shadow: 0 8px 18px rgba(0, 143, 213, .18);
}

.secondary-button {
  background: #fff;
  color: #087eb7;
  border-color: #c8deeb;
  box-shadow: none;
}

.secondary-button:hover { background: #edf8ff; border-color: #8bc9e8; }
.table-wrap { border-color: #d1e2ed; }
th { background: #edf6fc; color: #27465c; }
tbody tr:hover td { background: #f1f9fe; }
.module-tabs a.active { color: #007db9; border-color: #00a8ff; background: #e9f8ff; }
.detail-hero { align-items: flex-start; }
.detail-hero h1,
.detail-hero h2 { max-width: 100%; overflow-wrap: anywhere; line-height: 1.16; }
.detail-hero .action-row { flex: 0 0 auto; }
.inline-sync-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inline-sync-form select { min-width: 190px; }
.document-create-actions { justify-content: flex-end; }

@media (max-width: 1180px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-tools {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 980px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .login-shell { grid-template-columns: 1fr; }
  .login-showcase { min-height: 330px; padding: 42px; }
  .login-showcase img { margin-bottom: 28px; }

  .brand {
    padding-bottom: 12px;
  }

  .nav {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }

  .nav-toggle {
    display: block;
    width: 100%;
    min-height: 42px;
    margin-top: 4px;
    border: 1px solid rgba(101,217,255,.24);
    border-radius: 8px;
    background: rgba(0,168,255,.12);
    color: #dff6ff;
    font-weight: 900;
  }

  .sidebar .nav { display: none; }
  body.nav-open .sidebar .nav { display: grid; }

  .app {
    padding: 18px;
  }

  .topbar {
    margin: -18px -18px 18px;
    padding: 14px 18px;
  }

  .split,
  .detail-grid,
  .modal-split {
    grid-template-columns: 1fr;
  }

  .detail-hero {
    display: grid;
  }

  .action-row {
    justify-content: flex-start;
  }

  .table-toolbar,
  .action-strip {
    display: grid;
    align-items: stretch;
  }

  .search-input {
    width: 100%;
  }

  .compact-upload,
  .match-grid,
  .line-item,
  .currency-line-item {
    grid-template-columns: 1fr;
  }

  .quote-total-box {
    display: grid;
    justify-content: stretch;
  }
}

@media (max-width: 680px) {
  .grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .wide-field {
    grid-column: auto;
  }

  .market-pill,
  .topbar-logout {
    flex: 1 1 130px;
  }

  body.login { padding: 0; }
  .login-shell { min-height: 100vh; border: 0; border-radius: 0; }
  .login-showcase { min-height: 285px; padding: 32px 24px; }
  .login-showcase h1 { font-size: 34px; }
  .login-showcase p { font-size: 14px; }
  .login-features { display: none; }
  .login-brand { padding: 30px 24px 18px; }
  .login-card .panel-body { padding: 8px 24px 30px; }
  .user-pill { order: -1; width: 100%; justify-content: flex-start; }

  .modal {
    padding: 12px;
  }

  .modal-card,
  .modal-card-wide {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
  }

  th,
  td {
    padding: 12px;
  }
}

@media print {
  body {
    display: block;
    background: #fff;
  }

  .sidebar,
  .topbar,
  .action-row,
  .action-strip,
  .module-tabs,
  .catalog-tabs,
  button,
  .button {
    display: none !important;
  }

  .app {
    padding: 0;
  }

  .panel,
  .stat {
    box-shadow: none;
    border-color: #ddd;
  }
}
