@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --page-bg: #f2f5fb;
  --panel-bg: #ffffff;
  --panel-soft: #f8fbff;
  --text-ink: #11213d;
  --text-muted: #6b7890;
  --line: #dfe8f5;
  --line-strong: #c9d7ea;
  --primary: #0f5bdb;
  --primary-2: #134eb7;
  --primary-soft: #ecf2ff;
  --accent: #0f766e;
  --warning: #d97706;
  --danger: #dc2626;
  --shadow-lg: 0 24px 50px rgba(13, 28, 55, 0.08);
  --shadow-md: 0 10px 28px rgba(16, 33, 61, 0.09);
  --radius-lg: 16px;
  --radius-md: 11px;
  --radius-sm: 8px;
  --side: 260px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body > aside, body > .shell { visibility: hidden; }
.app-ready > aside, .app-ready > .shell { visibility: visible; }
.auth-required > aside, .auth-required > .shell { visibility: hidden; }
.login-gate { position: fixed; inset: 0; z-index: 500; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 20% 10%, #173c72 0, #0b1d38 45%, #071426 100%); }
.login-card { width: min(440px, 100%); display: grid; gap: 18px; padding: 30px; border: 1px solid rgba(255,255,255,.18); border-radius: 20px; background: rgba(255,255,255,.97); box-shadow: 0 30px 80px rgba(0,0,0,.32); }
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand .brand-mark { width: 48px; height: 48px; display: grid; place-items: center; overflow: hidden; border-radius: 14px; }
.login-brand .brand-mark img { width: 48px; height: 48px; object-fit: cover; border-radius: 14px; }
.login-brand strong, .login-brand small { display: block; }
.login-brand strong { font-size: 17px; }
.login-brand small { margin-top: 3px; color: var(--text-muted); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.login-card h1 { margin-bottom: 5px; }
.login-card p { margin: 0; color: var(--text-muted); font-size: 12px; }
.login-card .button { width: 100%; justify-content: center; min-height: 46px; }
.login-error { padding: 11px 12px; border: 1px solid #fecaca; border-radius: 10px; background: #fff1f2; color: #b91c1c; font-size: 12px; }

body {
  margin: 0;
  font-family: 'Inter', 'Segoe UI', sans-serif;
  color: var(--text-ink);
  background: radial-gradient(circle at top left, #f8faff 0%, var(--page-bg) 44%, #ebf1fb 100%);
  font-size: 15px;
  overflow-y: auto;
}

button, input, select, textarea {
  font: inherit;
}

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

button {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  background: var(--panel-bg);
  color: inherit;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #9ec4ff;
  outline-offset: 2px;
}

button:hover { transform: translateY(-1px); }

svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

#shade { display: none; }

body.menu-open #shade {
  position: fixed;
  inset: 0;
  background: rgba(7, 20, 39, .5);
  z-index: 30;
  display: block;
}

aside {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--side);
  padding: 22px 16px;
  background: linear-gradient(180deg, #0c1b35 0%, #0f2645 100%);
  color: #d6e2f5;
  display: flex;
  flex-direction: column;
  z-index: 40;
  transition: transform .22s ease;
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 6px 26px;
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  min-width: 0;
  font-size: 18px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.brand > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.brand-mark {
  flex: 0 0 43px;
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: 32px;
  line-height: 1;
  background: linear-gradient(145deg, #1a6bff 0%, #58a4ff 100%);
  box-shadow: 0 8px 16px rgba(19, 87, 225, 0.32);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}

.brand-small {
  display: block;
  margin-top: -2px;
  letter-spacing: 1.45px;
  font-size: 9px;
  color: #9cb2d4;
  font-weight: 600;
}

.workspace {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 12px 12px;
  border-radius: 12px;
  margin: 0 4px 24px;
  color: #d9e5ff;
}

.workspace-icon {
  width: 33px;
  height: 33px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.13);
  font-weight: 700;
}

.workspace small { display: block; color: #a5badf; font-size: 12px; margin-top: 2px; }
.workspace-chevron { margin-left: auto; opacity: .9; }

.nav-caption {
  margin: 0 8px 10px;
  font-size: 10px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: #9bb3d0;
}

nav { display: grid; gap: 6px; min-height: 0; overflow-y: auto; overflow-x: hidden; padding-right: 4px; scrollbar-width: thin; scrollbar-color: rgba(174,194,221,.35) transparent; }
nav::-webkit-scrollbar { width: 5px; }
nav::-webkit-scrollbar-thumb { border-radius: 99px; background: rgba(174,194,221,.35); }

nav button {
  border: 0;
  background: transparent;
  color: #aec2dd;
  text-align: left;
  border-radius: 12px;
  padding: 12px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
}

nav button svg {
  flex: 0 0 20px;
  color: #b5c6e2;
}

nav button:hover,
nav button.active {
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
}

nav button.active svg { color: #9bc3ff; }

nav button.active { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14); }
nav .count {
  margin-left: auto;
  font-size: 11px;
  color: #d1deef;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
}
.sidebar-access-block { display: grid; gap: 8px; margin: 8px 4px; padding: 14px; border: 1px solid rgba(255,255,255,.14); border-radius: 12px; background: rgba(220,38,38,.12); color: #fff; }
.sidebar-access-block svg { color: #fca5a5; }
.sidebar-access-block strong { font-size: 12px; }
.sidebar-access-block small { color: #b8c8df; font-size: 10px; line-height: 1.45; }
.access-denied { min-height: 360px; display: grid; place-items: center; padding: 30px; text-align: center; }
.access-denied svg { width: 38px; height: 38px; color: var(--danger); }
.access-denied h2 { margin: 14px 0 8px; }
.access-denied p { margin: 0; color: var(--text-muted); }

.sidebar-bottom {
  margin-top: auto;
  padding: 24px 8px 8px;
  font-size: 12px;
  color: #8ba1c5;
}

.environment {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  margin-bottom: 7px;
}
.environment span:first-child { width: 7px; height: 7px; border-radius: 50%; background: #55a9ff; display: inline-block; }
.environment b { font-size: 10px; background: rgba(255,255,255,.12); padding: 2px 6px; border-radius: 4px; }

.sidebar-bottom p { line-height: 1.5; margin: 0; }
.sidebar-bottom p span { color: #7487aa; }

.shell { margin-left: var(--side); min-height: 100vh; }

header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 84px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
}

.header-left { display: flex; align-items: center; gap: 14px; }

.breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: .02em;
}
.breadcrumb span { margin: 0 12px; color: #a4b5d4; }
.breadcrumb b {
  color: #1a2d4d;
  font-weight: 700;
}

.header-actions,
.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.icon-button {
  border: 1px solid var(--line);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #fff;
  color: #61718b;
}

.search-button {
  border: 1px solid var(--line);
  background: #fff;
  height: 38px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #667999;
  font-size: 13px;
  padding: 0 13px;
}

.notification { position: relative; }
.notification i {
  position: absolute;
  top: 9px; right: 8px;
  width: 6px; height: 6px;
  background: #ff7f4a;
  border-radius: 99px;
}

.header-divider { width: 1px; height: 30px; background: var(--line); }

.profile-button {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 5px 10px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #e9f2ff, #d4e4ff);
  color: #17468f;
  font-weight: 700;
  font-size: 12px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.profile-label {
  text-align: left;
  font-weight: 600;
  font-size: 13px;
}
.profile-label small {
  display: block;
  margin-top: 2px;
  color: #7789a4;
  font-weight: 500;
  font-size: 11px;
}

.profile-menu {
  position: fixed;
  top: 76px;
  right: 22px;
  z-index: 60;
  width: 196px;
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 15px;
  background: var(--panel-bg);
  box-shadow: 0 20px 45px rgba(13, 28, 55, .18);
}
.profile-menu[hidden] { display: none; }
.profile-shortcuts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.profile-shortcut { min-height: 78px; padding: 10px 6px; border-color: var(--line); background: var(--panel-soft); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; color: #263a59; font-size: 10px; line-height: 1.25; text-align: center; }
.profile-shortcut svg { width: 20px; height: 20px; }
.profile-shortcut.is-primary { color: #fff; border-color: var(--primary); background: linear-gradient(145deg, var(--primary), #356fff); }
.profile-shortcut.is-danger { color: var(--danger); }

.profile-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; }
.profile-photo-panel { min-height: 440px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel-soft); text-align: center; }
.profile-photo-preview { width: 120px; height: 120px; margin: 0 auto 14px; border-radius: 12px; display: grid; place-items: center; overflow: hidden; background: linear-gradient(145deg, #0c64ea, #134eb7); color: #fff; font-size: 31px; }
.profile-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.profile-upload-button { position: relative; display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; min-height: 48px; margin-top: 8px; padding: 11px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; color: #233a5c; cursor: pointer; }
.profile-upload-button.primary { color: #fff; border-color: var(--primary); background: linear-gradient(145deg, var(--primary), #356fff); }
.profile-upload-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.profile-photo-panel > small { display: block; margin-top: 12px; color: var(--text-muted); font-size: 9px; line-height: 1.6; }
.profile-tabs { display: flex; gap: 9px; padding: 0 0 14px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.profile-tabs button { display: inline-flex; align-items: center; gap: 7px; border-color: var(--line); font-size: 11px; font-weight: 750; }
.profile-tabs button.active { color: #fff; border-color: var(--primary); background: var(--primary); }
.profile-pane[hidden] { display: none; }
.profile-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.profile-address { grid-column: 1 / -1; padding: 15px; border: 1px solid #9dbcf0; border-radius: 13px; background: #fbfdff; }
.profile-address-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 12px; }
.profile-address-head small, .profile-address-head strong { display: block; }
.profile-address-head small { color: var(--primary); font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.profile-address-head strong { margin-top: 5px; font-size: 14px; }
.profile-address-status { padding: 7px 10px; border-radius: 999px; background: #e8f8ed; color: #14833b; font-size: 9px; font-weight: 800; white-space: nowrap; }
.address-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 5px; margin-bottom: 12px; border-radius: 11px; background: #eaf0f8; }
.address-mode button { border: 0; background: transparent; font-size: 10px; }
.address-mode button.active { background: #fff; color: var(--primary); box-shadow: 0 3px 10px rgba(20, 54, 102, .08); }
.selected-address { margin-top: 10px; padding: 12px; border: 1px solid #d3e2f5; border-radius: 10px; background: #f2f7fd; }
.selected-address small, .selected-address strong { display: block; }
.selected-address small { color: #6e819c; font-size: 9px; letter-spacing: .08em; }
.selected-address strong { margin-top: 5px; font-size: 11px; line-height: 1.45; }
.profile-note { grid-column: 1 / -1; }
.password-rules { grid-column: 1 / -1; padding: 12px 14px; border-radius: 10px; background: var(--panel-soft); color: var(--text-muted); font-size: 10px; line-height: 1.55; }

.mobile-toggle { display: none; }

main {
  max-width: 1600px;
  margin: 0 auto;
  padding: 26px 30px 92px;
}

.preview-note {
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
  color: #73839f;
  font-size: 11px;
}

.preview-note > span:first-child { letter-spacing: 1px; }

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.eyebrow { font-size: 10px; letter-spacing: 1.5px; color: var(--primary); font-weight: 700; }

h1 {
  margin: 8px 0 7px;
  font-size: 30px;
  letter-spacing: -0.03em;
  color: #12213b;
  font-weight: 800;
}

.page-heading p { margin: 0; color: var(--text-muted); font-size: 13px; }

.page-actions { display: flex; align-items: center; gap: 10px; }

.button {
  border-color: var(--line);
  background: #fff;
  color: #233a5c;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  white-space: nowrap;
}

.button.primary {
  background: linear-gradient(120deg, var(--primary), #0e56b8);
  color: #fff;
  border: 1px solid var(--primary);
  box-shadow: 0 8px 24px rgba(15, 81, 184, 0.2);
}

.stats,
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.stat,
.kpi-card {
  background: var(--panel-bg);
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 17px;
  box-shadow: var(--shadow-md);
}

.stat-chip {
  font-size: 11px;
  color: #2f5fd8;
  background: #edf4ff;
  border: 1px solid #d2e2ff;
  border-radius: 999px;
  padding: 2px 8px;
  font-weight: 700;
}

.stat-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #5f6f86;
  font-size: 13px;
  font-weight: 600;
}

.stat-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #eff5ff;
  color: #2b6fe0;
  display: grid;
  place-items: center;
}

.stat-value {
  margin: 10px 0 2px;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.stat-bottom { color: var(--text-muted); font-size: 12px; }

.trend {
  margin-top: 10px;
  display: flex;
  align-items: baseline;
  gap: 9px;
  color: #5f7494;
  font-size: 12px;
}

.trend b { color: var(--accent); font-weight: 700; }

.kpi-card .mini-chart {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  height: 72px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(90deg, #f7faff 0%, #fff 100%);
}

.kpi-card .mini-chart .bars {
  position: absolute;
  inset: 16px 14px 12px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  align-items: end;
  gap: 6px;
}

.kpi-card .mini-chart .bars span {
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, #2d6eea 0%, #5f8ff1 100%);
  opacity: .95;
}

.hero-dashboard {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
}

.card {
  background: var(--panel-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.card-heading {
  padding: 17px 19px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.card-heading h2 {
  margin: 0;
  font-size: 15px;
  color: #1e3152;
}

.card-heading p {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

#content > * + * { margin-top: 16px; }

.table-toolbar,
.renewal,
.activity,
.audit-mini {
  padding: 14px 18px;
}

.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.premium-toolbar {
  position: sticky;
  top: 0;
  background: var(--panel-bg);
  z-index: 2;
}

table { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }

thead th {
  text-align: left;
  color: #687690;
  font-size: 11px;
  font-weight: 700;
  padding: 12px 16px;
  background: var(--panel-soft);
  border-bottom: 1px solid var(--line);
}

tbody tr {
  cursor: pointer;
  border-bottom: 1px solid #edf1f8;
}

tbody tr:hover { background: var(--panel-soft); }

td {
  padding: 13px 16px;
  vertical-align: middle;
}

.table-scroll { overflow: auto; }

.table-search { position: relative; }
.table-search input {
  padding: 10px 12px 10px 34px;
  min-width: 255px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}
.table-search svg { position: absolute; left: 10px; top: 10px; color: #7384a0; }

.table-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.page-size-control { display: flex; grid-auto-flow: column; align-items: center; gap: 7px; color: var(--text-muted); font-size: 10px; }
.page-size-control select { width: 68px; height: 38px; padding: 6px 8px; }

.table-footer {
  border-top: 1px solid var(--line);
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #73819a;
  font-size: 12px;
}

.pagination { display: flex; gap: 8px; }
.pagination button {
  background: #fff;
  border: 1px solid var(--line);
  min-width: 32px;
  height: 32px;
  border-radius: 8px;
}
.pagination #prev:disabled,
.pagination #next:disabled { opacity: .4; cursor: not-allowed; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.badge.gray { background: #eef1f7; color: #5f728d; }
.badge.blue { background: #e6eeff; color: #3f6ed7; }
.badge.warning { background: #fff4df; color: #9e6a18; }
.badge.red { background: #ffe9e6; color: #b63a30; }

.table-scroll table { min-width: 940px; }

.datagrid thead th {
  position: sticky;
  top: 0;
  background: var(--panel-soft);
  z-index: 3;
}

.kpi-chart { height: 230px; padding: 10px 14px 18px; }
.kpi-chart .bars {
  height: 100%;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  align-items: end;
  gap: 10px;
  padding: 0 6px;
}
.kpi-chart .bars span {
  border-radius: 10px 10px 2px 2px;
  background: linear-gradient(180deg, #4c8ef6 0%, #4f79db 100%);
}

.audit-mini { display: grid; gap: 10px; }
.audit-mini .log-item {
  padding: 11px 12px;
  border-radius: 10px;
  background: #f9fbff;
  border: 1px solid #edf1fb;
}

.activity { display: grid; gap: 10px; }
.activity-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  padding: 12px 13px;
  border: 1px solid #e8eef8;
  border-radius: 11px;
  background: var(--panel-soft);
  line-height: 1.45;
}
.activity-item small { display: block; margin-top: 4px; color: var(--text-muted); font-size: 11px; }
.activity-dot { width: 30px; height: 30px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); border-radius: 9px; }

.document,
.detail-grid,
.form-grid {
  display: grid;
  gap: 14px;
}

.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-top: 4px; }
label { display: grid; gap: 8px; font-size: 12px; color: #4e5e7a; font-weight: 600; }
input, select, textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text-ink);
  font-size: 14px;
}
textarea { min-height: 72px; }

.detail-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 4px 0 16px;
}

.detail-grid > div {
  min-width: 0;
  padding: 14px 15px;
  border: 1px solid #e7edf7;
  border-radius: 12px;
  background: linear-gradient(145deg, #fbfdff, #f6f9fe);
}

.detail-grid small {
  display: block;
  margin-bottom: 7px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.35;
}

.detail-grid strong {
  display: block;
  color: var(--text-ink);
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.form-section-title {
  grid-column: 1 / -1;
  font-size: 11px;
  letter-spacing: 0.07em;
  font-weight: 800;
  color: #315ea0;
  text-transform: uppercase;
  margin-bottom: 2px;
}

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

#dialog {
  width: min(1140px, calc(100% - 56px));
  max-height: 92vh;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--panel-bg);
  box-shadow: var(--shadow-lg);
  padding: 0;
  color: var(--text-ink);
  overflow: hidden;
}
#dialog.profile-dialog { width: min(900px, calc(100% - 40px)); }

dialog::backdrop {
  background: rgba(8, 16, 32, 0.48);
  backdrop-filter: blur(4px);
}

.dialog-top {
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: linear-gradient(180deg, #fff, #fbfdff);
}

.dialog-top h2 { margin: 0 0 5px; font-size: 20px; letter-spacing: -.02em; }
.dialog-top small { display: block; color: var(--text-muted); line-height: 1.4; }

#dialog-body { padding: 20px 22px 24px; overflow: auto; max-height: calc(92vh - 82px); }

#dialog[open] { animation: modal-in .18s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }

.tabs {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  overflow: auto;
  padding-bottom: 8px;
}

.tabs button {
  border: 0;
  background: transparent;
  padding: 10px 12px;
  color: #6f829d;
  font-weight: 600;
  font-size: 13px;
  border-bottom: 2px solid transparent;
}

.tabs button.active {
  color: var(--primary);
  border-color: var(--primary);
}

.choice-list { display: grid; gap: 10px; }
.choice-list button {
  background: #f8fbff;
  border: 1px solid var(--line);
  padding: 14px;
  border-radius: 12px;
  text-align: left;
}
.subsection-heading { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin: 8px 0 10px; }
.subsection-heading strong { color: var(--text-ink); font-size: 14px; }
.subsection-heading small { color: var(--text-muted); font-size: 11px; }
.request-summary { display: flex !important; align-items: center; justify-content: space-between; gap: 14px; }
.request-summary span:first-child { min-width: 0; }
.request-summary strong, .request-summary small { display: block; }
.request-summary small { margin-top: 5px; color: var(--text-muted); font-size: 10px; }

.text-button {
  background: #f4f8ff !important;
  border: 1px solid var(--line);
  border-radius: 999px !important;
  color: #2f4f97;
  padding: 6px 12px !important;
  font-size: 12px;
  font-weight: 700;
}

.text-button:hover {
  border-color: #b6ceff;
  background: #eef5ff !important;
}

.info-box {
  border: 1px solid #dbe7fa;
  background: linear-gradient(120deg, #f8fbff 0%, #fff 90%);
  border-radius: 10px;
  padding: 14px;
  font-size: 13px;
}

.document {
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px dashed #e3eaf7;
}
.document:last-child { border-bottom: 0; }

.document .document-text {
  flex: 1;
}
.document strong { font-size: 14px; }
.document small { display: block; margin-top: 6px; color: var(--text-muted); font-size: 12px; }

.settings-body { padding: 18px 20px; }
.loading-line { color: var(--text-muted); font-size: 13px; }
.settings-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 20px;
}
.settings-form label { padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-soft); }
.settings-form label small { color: var(--text-muted); font-weight: 500; line-height: 1.4; }
.settings-form input { width: 100%; height: 44px; }
.field-wide, .settings-actions { grid-column: 1 / -1; }
.settings-actions { display: flex; justify-content: flex-end; padding-top: 2px; }
.security-pill { padding: 6px 10px; border-radius: 999px; color: #17614f; background: #e7f8f2; border: 1px solid #c9eee1; font-size: 11px; font-weight: 700; }
.catalog-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 18px; }
.catalog-grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.catalog-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: linear-gradient(145deg, #fbfdff, var(--panel-soft)); }
.catalog-icon { width: 38px; height: 38px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); border-radius: 11px; }
.catalog-item small, .catalog-item strong, .catalog-item p { display: block; min-width: 0; }
.catalog-item small { color: var(--text-muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.catalog-item strong { margin-top: 4px; font-size: 14px; }
.catalog-item p { margin: 5px 0 0; color: var(--text-muted); font-size: 11px; line-height: 1.45; }

.package-contract-note { display: grid; gap: 5px; margin-bottom: 18px; }
.package-contract-note strong { color: #17365f; }
.package-contract-note span { color: var(--text-muted); line-height: 1.5; }
.package-form .field-wide { grid-column: 1 / -1; }
.package-form label small { color: var(--text-muted); font-weight: 500; line-height: 1.45; }
.check-field {
  display: flex;
  align-items: center;
  align-self: end;
  min-height: 44px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
}
.check-field input { width: 17px; height: 17px; margin: 0; accent-color: var(--primary); }
.upload-drop { padding: 15px; border: 1px dashed #aec6ec; border-radius: 12px; background: #f8fbff; }
.upload-drop input { padding: 8px; background: #fff; }
.package-table-wrap { overflow: auto; }
.package-table { min-width: 1040px; }
.package-table td { vertical-align: top; }
.package-table td > strong { display: block; color: #18355f; font-size: 12px; }
.package-table td > small { display: block; max-width: 220px; margin-top: 5px; color: var(--text-muted); font-size: 10px; white-space: normal; line-height: 1.4; }
.contract-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  padding: 13px 18px;
  border-top: 1px solid var(--line);
  background: var(--panel-soft);
}
.contract-strip span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel-bg); color: #536985; font-size: 10px; font-weight: 700; }
.contract-strip svg { width: 14px; height: 14px; color: var(--primary); }

.module-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.module-title span:last-child { padding: 5px 9px; border-radius: 999px; color: var(--primary); background: var(--primary-soft); font-size: 10px; letter-spacing: 0; text-transform: none; }
.module-selector { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.module-option {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-bg);
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.module-option:hover { border-color: #a8c5f3; background: #f8fbff; }
.module-option:has(input:checked) { border-color: #78a8ef; background: #f1f7ff; box-shadow: inset 0 0 0 1px rgba(15, 91, 219, .08); }
.module-option input { position: absolute; opacity: 0; pointer-events: none; }
.module-check { width: 20px; height: 20px; border: 1px solid #b8c7dc; border-radius: 6px; background: #fff; display: grid; place-items: center; }
.module-option:has(input:checked) .module-check { border-color: var(--primary); background: var(--primary); }
.module-option:has(input:checked) .module-check::after { content: '✓'; color: #fff; font-size: 13px; font-weight: 800; }
.module-copy { min-width: 0; }
.module-copy strong { display: block; color: var(--text-ink); font-size: 12px; line-height: 1.35; }
.module-copy small { display: block; margin-top: 4px; color: var(--text-muted); font-size: 9px; line-height: 1.4; overflow-wrap: anywhere; }
.module-copy em { display: block; margin-top: 7px; color: #57708f; font-size: 9px; font-style: normal; font-weight: 600; }
.module-option.is-required .module-copy em { color: #a56612; }
.module-option.is-required .module-copy em::before { content: 'Zorunlu · '; }
.module-option.is-system { border-color: #8eb4ed; background: #edf5ff; cursor: default; }
.module-option.is-system .module-copy em { color: #245b9e; }
.module-option:has(input:disabled) .module-check { box-shadow: 0 0 0 3px rgba(15, 91, 219, .08); }
.module-summary { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid #d8e5f7; border-radius: 11px; background: #f7faff; }
.module-summary strong { white-space: nowrap; color: #254e87; font-size: 11px; }
.module-summary span { color: var(--text-muted); font-size: 10px; line-height: 1.55; overflow-wrap: anywhere; }
.dependency-selector { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.compact-check { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 9px; align-items: center; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-soft); cursor: pointer; }
.compact-check input { width: 17px; height: 17px; margin: 0; accent-color: var(--primary); }
.compact-check small { grid-column: 2; color: var(--text-muted); font-weight: 500; }
.standard-module-selector .module-option { background: #f4f8fd; border-color: #c8d9ef; }
.standard-module-selector .module-copy em { color: #2363a8; font-weight: 750; }
.pricing-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 12px; border: 1px solid #d7e4f5; border-radius: 12px; background: #f7faff; }
.pricing-summary > div { display: flex; justify-content: space-between; gap: 12px; align-items: center; min-width: 0; padding: 10px 12px; border-radius: 9px; background: #fff; }
.pricing-summary span { color: var(--text-muted); font-size: 10px; font-weight: 700; }
.pricing-summary strong { color: var(--text-ink); font-size: 13px; white-space: nowrap; }
.pricing-summary .pricing-grand { background: var(--primary); }
.pricing-summary .pricing-grand span, .pricing-summary .pricing-grand strong { color: #fff; }
.custom-package-builder { padding: 16px; border: 1px solid #cddcf0; border-radius: 14px; background: #f8fbff; }
.custom-package-builder[hidden] { display: none; }
.custom-package-builder h4 { margin: 16px 0 9px; color: #234d84; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.custom-package-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.custom-package-head strong, .custom-package-head small { display: block; }
.custom-package-head strong { color: var(--text-ink); font-size: 14px; }
.custom-package-head small { margin-top: 4px; color: var(--text-muted); font-size: 10px; }
.custom-package-head > span { padding: 6px 9px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: 10px; font-weight: 800; white-space: nowrap; }
.customer-plan-preview { margin-top: 8px; overflow: hidden; border: 1px solid #b9cfed; border-radius: 15px; background: linear-gradient(145deg, #f8fbff, #eef5ff); box-shadow: 0 10px 24px rgba(23, 67, 125, .08); }
.customer-plan-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; border-bottom: 1px solid #cfdef1; background: rgba(255,255,255,.72); }
.customer-plan-preview-head small, .customer-plan-preview-head strong, .customer-plan-preview-head div > span { display: block; }
.customer-plan-preview-head small { color: var(--primary); font-size: 9px; font-weight: 800; letter-spacing: .09em; }
.customer-plan-preview-head strong { margin-top: 5px; color: var(--text-ink); font-size: 17px; }
.customer-plan-preview-head div > span { margin-top: 4px; color: var(--text-muted); font-size: 10px; }
.customer-price-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 14px; }
.customer-module-preview { margin: 0 14px 14px; padding: 13px; border: 1px solid #d7e4f5; border-radius: 12px; background: rgba(255,255,255,.78); }
.customer-module-preview > div:first-child { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; color: var(--text-ink); font-size: 10px; }
.customer-module-preview > div:first-child span { color: var(--primary); font-weight: 800; }
.preview-module-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.preview-module-list > span { display: block; min-width: 0; padding: 9px 10px; border: 1px solid #dbe6f5; border-radius: 9px; background: #fff; color: var(--text-ink); font-size: 10px; font-weight: 750; }
.preview-module-list small { display: block; margin-top: 4px; color: var(--text-muted); font-size: 8px; font-weight: 600; }
.preview-module-list .empty-module-preview { grid-column: 1 / -1; color: var(--text-muted); font-weight: 600; text-align: center; }
.contract-price-preview { margin: 12px 0 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-bg); }
.contract-price-preview table { width: 100%; border-collapse: collapse; }
.contract-price-preview th, .contract-price-preview td { padding: 9px 14px; border-bottom: 1px solid var(--line); text-align: left; font-size: 10px; }
.contract-price-preview th { color: #58708e; background: var(--panel-soft); text-transform: uppercase; letter-spacing: .05em; }
.contract-price-preview .pricing-summary { margin: 12px; }
.upload-button { position: relative; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-weight: 650; }
.upload-button input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.geo-address-field { padding: 15px; border: 1px solid #a9c5ef; border-radius: 13px; background: #f9fbff; }
.geo-field-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.geo-field-head small, .geo-field-head strong { display: block; }
.geo-field-head small { color: var(--primary); font-size: 9px; letter-spacing: .08em; }
.geo-field-head strong { margin-top: 4px; color: var(--text-ink); font-size: 13px; }
.geo-field-head > span { padding: 6px 9px; border-radius: 999px; background: #eaf7ee; color: #16813c; font-size: 9px; font-weight: 800; }
.geo-results { margin-top: 9px; max-height: 190px; overflow: auto; }
.geo-address-complement { display: grid; grid-template-columns: minmax(0, 2fr) minmax(90px, .7fr) minmax(90px, .7fr); gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed #cfdcf0; }
.geo-address-complement[hidden] { display: none !important; }
.geo-address-complement label { min-width: 0; }
.geo-address-complement input { width: 100%; min-width: 0; }
.dealer-performance { margin: 14px 0 18px; padding: 18px; border: 1px solid #cfe0f5; border-radius: 14px; background: linear-gradient(145deg, #f8fbff, #eef5ff); }
.performance-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.performance-head small { color: var(--primary); font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.performance-head h3 { margin: 5px 0 4px; font-size: 19px; }
.performance-head p { max-width: 720px; margin: 0; color: var(--text-muted); font-size: 10px; line-height: 1.5; }
.performance-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.performance-grid > div { padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-bg); }
.performance-grid span, .performance-grid strong, .performance-grid small { display: block; }
.performance-grid span { color: var(--text-muted); font-size: 10px; }
.performance-grid strong { margin-top: 5px; font-size: 17px; }
.performance-grid small { margin-top: 7px; color: var(--text-muted); font-size: 9px; line-height: 1.4; }
.progress { height: 7px; margin-top: 10px; overflow: hidden; border-radius: 999px; background: #e5edf7; }
.progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), #4d8fff); }
.policy-note { padding: 14px 16px; border: 1px solid #d4e3f6; border-radius: 12px; background: #f7faff; }
.policy-note strong { color: #214a84; font-size: 12px; }
.policy-note p { margin: 6px 0 0; color: var(--text-muted); font-size: 10px; font-weight: 500; line-height: 1.55; }
.inline-table { overflow: auto; }
.dashboard-distribution { overflow: visible; }
.distribution-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 22px; align-items: center; padding: 22px; }
.master-donut { position: relative; width: 220px; aspect-ratio: 1; margin: auto; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--donut)); box-shadow: inset 0 0 0 1px rgba(14, 41, 82, .06), 0 16px 34px rgba(25, 57, 105, .12); }
.master-donut::after { content: ''; position: absolute; inset: 25%; border-radius: 50%; background: var(--panel-bg); box-shadow: 0 0 0 1px var(--line); }
.master-donut > div { position: relative; z-index: 1; text-align: center; }
.master-donut strong, .master-donut small { display: block; }
.master-donut strong { font-size: 30px; color: var(--text-ink); }
.master-donut small { margin-top: 4px; color: var(--text-muted); font-size: 10px; }
.donut-stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.donut-stat { position: relative; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-soft); display: flex; align-items: center; gap: 12px; }
.mini-donut { flex: 0 0 52px; width: 52px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at center, var(--panel-bg) 52%, transparent 54%), conic-gradient(var(--slice) var(--value), #e5edf7 0); }
.mini-donut strong { font-size: 13px; }
.donut-stat > div:nth-child(2) strong, .donut-stat > div:nth-child(2) small { display: block; }
.donut-stat > div:nth-child(2) strong { color: var(--text-ink); font-size: 11px; }
.donut-stat > div:nth-child(2) small { margin-top: 4px; color: var(--text-muted); font-size: 9px; line-height: 1.35; }
.chart-tooltip { position: absolute; left: 50%; bottom: calc(100% + 8px); z-index: 20; width: max-content; max-width: 230px; padding: 8px 10px; border-radius: 8px; background: #10213c; color: #fff; font-size: 9px; line-height: 1.4; opacity: 0; pointer-events: none; transform: translate(-50%, 5px); transition: .16s ease; box-shadow: 0 8px 20px rgba(6, 18, 38, .2); }
.donut-stat:hover .chart-tooltip, .donut-stat:focus .chart-tooltip, .master-donut:hover .chart-tooltip { opacity: 1; transform: translate(-50%, 0); }

footer {
  position: fixed;
  left: calc(var(--side) + 20px);
  right: 20px;
  bottom: 10px;
  z-index: 15;
  min-height: 46px;
  padding: 0 18px;
  color: #90a0b9;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(15, 31, 56, .07);
}
.footer-dot { margin: 0 8px; }

.toast {
  position: fixed;
  inset: auto auto 24px 50%;
  margin: 0;
  border: 0;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(24px);
  background: #0f1e36;
  color: #fff;
  border-radius: 10px;
  padding: 14px 20px;
  font-size: 13px;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 14px 35px rgba(8, 19, 38, 0.25);
  transition: 0.22s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.empty-state {
  padding: 36px;
  text-align: center;
  color: #7b8ca6;
}

body.dark {
  --page-bg: #0c1625;
  --panel-bg: #132238;
  --panel-soft: #18283e;
  --text-ink: #dbe8fc;
  --text-muted: #98a9c4;
  --line: #273a55;
  --line-strong: #304763;
  --shadow-lg: 0 24px 50px rgba(1, 8, 20, 0.55);
  --shadow-md: 0 8px 22px rgba(2, 14, 31, 0.5);
}
body.dark .header-actions .icon-button,
body.dark .search-button,
body.dark .profile-button,
body.dark .profile-menu,
body.dark .button,
body.dark th,
body.dark .table-footer,
body.dark input,
body.dark select,
body.dark textarea { background: var(--panel-bg); color: #d9e4f7; }

@media (max-width: 1400px) {
  :root { --side: 248px; }
  .stats, .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-dashboard { grid-template-columns: 1fr; }
}

@media (max-width: 1100px) {
  .shell { margin-left: 0; }
  aside { transform: translateX(-100%); width: 248px; }
  body.menu-open aside { transform: translateX(0); }
  .mobile-toggle { display: grid; }
  .breadcrumb { display: none; }
  footer { left: 12px; right: 12px; }
}

@media (max-width: 900px) {
  main { padding: 18px 16px; }
  header { padding: 0 14px; height: 72px; }
  .page-heading { display: block; }
  .page-actions { margin-top: 10px; justify-content: space-between; }
  h1 { font-size: 28px; }
  .stats, .kpi-grid { grid-template-columns: 1fr; }
  .kpi-grid { gap: 10px; }
  .table-toolbar { flex-direction: column; align-items: stretch; }
  .table-search input { width: 100%; }
  .table-scroll table, .datagrid { min-width: 0; }
  .detail-grid { grid-template-columns: 1fr; }
  #dialog,
  .table-scroll {
    border-radius: 0;
  }
  #dialog { width: calc(100% - 12px); height: 100%; max-height: none; border-radius: 0; }
  .dialog-top, #dialog-body { padding: 16px; }
  #dialog-body { max-height: calc(100vh - 76px); }
  .settings-form, .catalog-grid, .catalog-grid.compact { grid-template-columns: 1fr; }
  .module-selector { grid-template-columns: 1fr; }
  .pricing-summary { grid-template-columns: 1fr; }
  .customer-price-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .preview-module-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .custom-package-head { align-items: flex-start; flex-direction: column; }
  .profile-menu { top: 66px; right: 10px; width: min(196px, calc(100vw - 20px)); }
  .profile-layout { grid-template-columns: 1fr; }
  .profile-photo-panel { min-height: auto; }
  .profile-fields { grid-template-columns: 1fr; }
  .profile-address, .profile-note, .password-rules { grid-column: auto; }
  footer { min-height: 52px; padding: 8px 12px; gap: 8px; }
  .distribution-layout { grid-template-columns: 1fr; }
  .donut-stat-grid { grid-template-columns: 1fr; }
  footer > span:last-child { text-align: right; }
  .dependency-selector { grid-template-columns: 1fr; }
  .field-wide, .settings-actions, .package-form .field-wide { grid-column: auto; }
  .document { grid-template-columns: 1fr; }
}

/* Mobile control plane layout */
@media (max-width: 700px) {
  body { font-size: 14px; overflow-x: hidden; }
  .shell { width: 100%; min-width: 0; }
  aside { width: min(86vw, 310px); padding: 18px 12px; overflow-y: auto; overscroll-behavior: contain; }
  .brand { margin-bottom: 18px; font-size: 25px; }
  .brand-mark { width: 39px; height: 39px; }
  .workspace { margin-bottom: 17px; }
  nav { padding-bottom: 18px; }
  nav button { min-height: 44px; }
  .sidebar-bottom { position: static; margin-top: auto; padding-top: 16px; }

  header { height: 62px; padding: 0 10px; gap: 8px; }
  .header-left, .header-actions { gap: 6px; min-width: 0; }
  .icon-button { width: 38px; height: 38px; padding: 8px; flex: 0 0 38px; }
  .search-button { width: 38px; height: 38px; padding: 8px; justify-content: center; }
  .search-button > span:last-of-type, .search-button kbd { display: none; }
  .header-divider { display: none; }
  .profile-button { min-width: 42px; height: 40px; padding: 3px; }
  .profile-button .profile-label, .profile-button > span:last-child { display: none; }
  .avatar { width: 34px; height: 34px; }
  .profile-menu { top: 58px; right: 8px; width: 196px; }

  main { width: 100%; min-width: 0; padding: 14px 10px 86px; }
  .preview-note { margin: 0 2px 12px; font-size: 9px; }
  .preview-note > span:last-child { display: none; }
  .page-heading { margin-bottom: 14px; }
  .eyebrow { font-size: 9px; }
  h1 { margin-top: 6px; font-size: 24px; }
  .page-heading p { font-size: 12px; line-height: 1.45; }
  .page-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .page-actions .button { min-width: 0; justify-content: center; padding-inline: 9px; }

  .card { min-width: 0; border-radius: 13px; }
  .card-heading { align-items: flex-start; flex-direction: column; padding: 14px; }
  .card-heading > .button, .card-heading > .table-controls { width: 100%; }
  .card-heading > .button { justify-content: center; }
  .table-toolbar { padding: 12px; }
  .premium-toolbar { position: static; }
  .table-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .table-controls .button, .page-size-control { width: 100%; justify-content: center; }
  .page-size-control select { flex: 1; }
  .table-search { width: 100%; }
  .table-search input { min-width: 0; width: 100%; }

  .table-scroll { overflow: visible; padding: 0 10px 10px; background: transparent; }
  .table-scroll table.datagrid { display: block; width: 100%; min-width: 0; white-space: normal; }
  .table-scroll table.datagrid thead { display: none; }
  .table-scroll table.datagrid tbody { display: grid; gap: 10px; width: 100%; }
  .table-scroll table.datagrid tbody tr { display: block; width: 100%; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-bg); box-shadow: 0 5px 14px rgba(16, 33, 61, .05); }
  .table-scroll table.datagrid tbody td { display: grid; grid-template-columns: minmax(92px, .8fr) minmax(0, 1.2fr); gap: 10px; align-items: center; width: 100%; padding: 10px 12px; border-bottom: 1px solid #edf1f8; text-align: right; overflow-wrap: anywhere; }
  .table-scroll table.datagrid tbody td::before { content: attr(data-label); color: var(--text-muted); font-size: 10px; font-weight: 750; text-align: left; text-transform: uppercase; letter-spacing: .035em; }
  .table-scroll table.datagrid tbody td:last-child { border-bottom: 0; }
  .table-scroll table.datagrid tbody td .text-button { justify-self: end; }
  .table-scroll table.datagrid tbody tr.empty-row td { display: block; padding: 0; }
  .table-scroll table.datagrid tbody tr.empty-row td::before { content: none; }
  .empty-state { padding: 28px 14px; }
  .table-footer { align-items: center; padding: 11px 12px; }

  .distribution-layout { padding: 16px 12px; gap: 18px; }
  .master-donut { width: min(210px, 72vw); }
  .donut-stat { padding: 10px; }
  .chart-tooltip { max-width: min(230px, 80vw); white-space: normal; }
  .detail-grid { gap: 10px; }
  .detail-grid > div { padding: 12px; }
  .form-grid { grid-template-columns: 1fr; gap: 12px; }
  .form-grid, .form-grid > *, .settings-form, .settings-form > * { min-width: 0; width: 100%; }
  .form-grid input, .form-grid select, .form-grid textarea,
  .settings-form input, .settings-form select, .settings-form textarea { min-width: 0; max-width: 100%; width: 100%; }
  .form-section-title { grid-column: auto; }
  .settings-form { padding: 12px; gap: 12px; }
  .settings-form label { padding: 12px; }
  .settings-actions, .modal-actions { display: grid; grid-template-columns: 1fr; width: 100%; }
  .settings-actions .button, .modal-actions .button { width: 100%; justify-content: center; }
  .catalog-grid { padding: 12px; }
  .catalog-item { grid-template-columns: auto minmax(0, 1fr); }
  .catalog-item > :last-child { grid-column: 1 / -1; width: 100%; }
  .module-option { min-width: 0; }
  .module-copy strong, .module-copy small, .module-copy em { overflow-wrap: anywhere; }
  .pricing-summary { padding: 9px; }
  .dealer-performance { padding: 13px; }
  .performance-head { flex-direction: column; }
  .performance-grid { grid-template-columns: 1fr; }

  .geo-address-field, .profile-address { padding: 12px; }
  .geo-address-complement { grid-template-columns: 1fr; }
  .geo-field-head, .profile-address-head { align-items: flex-start; flex-direction: column; }
  .address-mode { grid-template-columns: 1fr; }
  .profile-tabs { overflow-x: auto; scrollbar-width: thin; }
  .profile-tabs button { flex: 0 0 auto; }
  .profile-photo-preview { width: 104px; height: 104px; }

  #dialog, #dialog.profile-dialog { width: 100%; height: 100dvh; max-width: none; max-height: none; margin: 0; border: 0; border-radius: 0; }
  .dialog-top { position: sticky; top: 0; z-index: 5; min-height: 68px; padding: 13px 12px; }
  .dialog-top h2 { font-size: 17px; }
  .dialog-top small { font-size: 10px; }
  #dialog-body { max-height: calc(100dvh - 68px); padding: 14px 12px calc(20px + env(safe-area-inset-bottom)); }
  .tabs { margin-inline: -12px; padding-inline: 12px; }
  .tabs button { flex: 0 0 auto; padding: 9px 10px; }
  .document .button { width: 100%; justify-content: center; }
  .inline-table { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
  .inline-table table.datagrid { min-width: 640px; }

  footer { left: 8px; right: 8px; bottom: 6px; min-height: 50px; padding: 7px 10px; flex-direction: column; justify-content: center; align-items: flex-start; font-size: 9px; }
  footer > span:last-child { width: 100%; text-align: left; }
  .toast { bottom: 66px; width: calc(100% - 20px); padding: 12px 14px; text-align: center; }
}

@media (max-width: 380px) {
  #theme { display: none; }
  .page-actions { grid-template-columns: 1fr; }
  .table-controls { grid-template-columns: 1fr; }
  .table-footer { align-items: flex-start; flex-direction: column; gap: 9px; }
  .pagination { width: 100%; justify-content: flex-end; }
}

@media (orientation: landscape) and (max-height: 520px) and (max-width: 950px) {
  aside { overflow-y: auto; }
  .sidebar-bottom { display: none; }
  #dialog, #dialog.profile-dialog { height: 100dvh; }
  main { padding-bottom: 60px; }
  footer { min-height: 38px; flex-direction: row; align-items: center; justify-content: space-between; }
  footer > span:last-child { width: auto; text-align: right; }
  .toast { bottom: 50px; }
}

.ws-banner-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 70px;
  padding: 15px 17px;
  border: 1px solid #bcd3ff;
  border-left: 5px solid #1768e5;
  border-radius: 13px;
  background: linear-gradient(135deg, #f4f8ff, #eaf2ff);
  color: #102746;
}
.ws-banner-preview > div { min-width: 0; }
.ws-banner-preview strong, .ws-banner-preview span { display: block; overflow-wrap: anywhere; }
.ws-banner-preview strong { margin-bottom: 5px; font-size: 14px; }
.ws-banner-preview span { color: #4c6485; font-size: 12px; line-height: 1.5; }
.ws-banner-preview a, .ws-banner-preview em {
  flex: 0 0 auto;
  color: #1559c6;
  font-size: 11px;
  font-style: normal;
  font-weight: 750;
  text-decoration: none;
}
.ws-banner-preview.success { border-color: #9ee4c3; border-left-color: #11975c; background: linear-gradient(135deg, #f0fff7, #e6faef); }
.ws-banner-preview.warning { border-color: #f5d38c; border-left-color: #d88a00; background: linear-gradient(135deg, #fffbeb, #fff3d3); }
.ws-banner-preview.critical { border-color: #f4a8ad; border-left-color: #d83b46; background: linear-gradient(135deg, #fff5f5, #ffe8e9); }
.button.danger { border-color: #f0b8bc; background: #fff4f4; color: #c32632; }
.notification-quick-list button { display: flex; align-items: center; gap: 11px; }
.notification-quick-list button svg { width: 19px; height: 19px; flex: 0 0 auto; }
.notification-quick-list button span { min-width: 0; }
.notification-quick-list button strong, .notification-quick-list button small { display: block; }
.notification-quick-list button small { margin-top: 4px; color: var(--text-muted); }

@media (max-width: 640px) {
  .ws-banner-preview { align-items: flex-start; flex-direction: column; gap: 10px; padding: 13px; }
  .ws-banner-preview a, .ws-banner-preview em { width: 100%; }
}
