:root {
  --bg: #07090d;
  --sidebar: #11151d;
  --panel: #111318;
  --panel-2: #15181f;
  --ink: #ffffff;
  --muted: #8b93a7;
  --line: #2a2f3b;
  --primary: #087dff;
  --green: #00d084;
  --red: #ff2e64;
  --yellow: #ffd32a;
  --purple: #8b3dff;
  --cyan: #05d8ff;
  --shadow: none;
  --card-bg: #151920;
  --card-hover: #1d3764;
  --input-bg: #0b0d12;
  --surface-soft: #17212f;
  --sidebar-line: #202530;
  --sidebar-line-2: #24384d;
  --sidebar-footer-bg: #111a26;
  --sidebar-footer-line: #263650;
  --logout-color: #dbe5f5;
  --logout-line: #344966;
  --sysbar-line: #1d2028;
  --sysbar-color: #ba214a;
  --btn-primary-bg: #00a96b;
  --btn-primary-hover: #00c47c;
  --block-title-bg: #15161b;
  --block-title-line: #2b2f39;
  --block-title-accent: #7436ff;
  --money-bg: #171a20;
  --money-line: #303542;
  --money-text: #b8c0cf;
  --chart-bg: #12151b;
  --th-bg: #151920;
  --td-color: #e7eaf0;
  --seg-bg: #171b24;
  --seg-active: #243551;
  --dialog-bg: var(--panel);
  --dialog-color: #fff;
  --scrollbar-thumb: rgba(255,255,255,.08);
  --icon-btn-bg: #202633;
  --badge-bg: #ff2e64;
  --premium-badge: #10d987;
  font-family: Inter, Segoe UI, Roboto, Arial, sans-serif;
  transition: background .25s, color .25s, border-color .25s;
}

.light-theme {
  --bg: #f0f2f5;
  --sidebar: #ffffff;
  --panel: #ffffff;
  --panel-2: #f8f9fb;
  --ink: #1a1d23;
  --muted: #6b7280;
  --line: #e2e5ea;
  --primary: #087dff;
  --green: #059669;
  --red: #dc2626;
  --yellow: #d97706;
  --purple: #7c3aed;
  --cyan: #0891b2;
  --shadow: 0 1px 3px rgba(0,0,0,.05);
  --card-bg: #ffffff;
  --card-hover: #e8f0fe;
  --input-bg: #ffffff;
  --surface-soft: #f3f5f8;
  --sidebar-line: #e2e5ea;
  --sidebar-line-2: #e2e5ea;
  --sidebar-footer-bg: #f3f5f8;
  --sidebar-footer-line: #e2e5ea;
  --logout-color: #4b5563;
  --logout-line: #d1d5db;
  --sysbar-line: #e2e5ea;
  --sysbar-color: #6b7280;
  --btn-primary-bg: #059669;
  --btn-primary-hover: #047857;
  --block-title-bg: #ffffff;
  --block-title-line: #e2e5ea;
  --block-title-accent: #7c3aed;
  --money-bg: #f8f9fb;
  --money-line: #e2e5ea;
  --money-text: #6b7280;
  --chart-bg: #ffffff;
  --th-bg: #f3f5f8;
  --td-color: #1a1d23;
  --seg-bg: #f0f2f5;
  --seg-active: #087dff;
  --dialog-bg: #ffffff;
  --dialog-color: #1a1d23;
  --scrollbar-thumb: rgba(0,0,0,.15);
  --icon-btn-bg: #e2e5ea;
  --badge-bg: #dc2626;
  --premium-badge: #059669;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  display: grid;
  grid-template-columns: 180px 1fr;
  font-size: 12px;
}

body.locked {
  overflow: hidden;
}

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

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  padding: 20px;
  background: radial-gradient(circle at 20% 10%, #0e4085 0 18%, transparent 38%), #05070a;
}

body.locked .login-screen {
  display: grid;
}

.login-box {
  width: min(430px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 26px;
  display: grid;
  gap: 14px;
}

.login-box h1 {
  font-size: 24px;
  margin: 4px 0 0;
}

.sidebar {
  min-height: 100vh;
  background: var(--sidebar);
  border-right: 1px solid var(--sidebar-line);
  color: var(--ink);
  padding: 8px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: linear-gradient(145deg, #1c9dff, #2450c7);
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #06101f;
}

.brand strong {
  display: block;
  font-size: 20px;
  line-height: 1;
  color: var(--red);
}

.brand span,
.sidebar-footer span,
.eyebrow,
.muted,
.breadcrumb {
  color: var(--muted);
}

.brand span,
.sidebar-footer span {
  display: block;
  font-size: 10px;
  margin-top: 2px;
}

.profile-card {
  min-height: 84px;
  border: 1px solid var(--sidebar-line-2);
  border-radius: 7px;
  background: var(--surface-soft);
  padding: 10px;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 9px;
  align-items: center;
}

.avatar,
.system-icons button:last-child {
  border-radius: 50%;
  background: linear-gradient(135deg, #ff244f, #17202b 55%, #18a7ff);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.avatar {
  width: 34px;
  height: 34px;
  font-size: 10px;
  cursor: pointer;
  position: relative; overflow: hidden;
}
.avatar img {
  width: 100%; height: 100%; object-fit: cover;
  position: absolute; inset: 0;
}
.system-icons button:last-child { position: relative; overflow: hidden; }
.system-icons button:last-child img {
  width: 100%; height: 100%; object-fit: cover;
  position: absolute; inset: 0;
}

.profile-card strong {
  display: block;
  font-size: 8px;
  color: var(--ink);
}

.profile-card span {
  display: inline-block;
  margin: 5px 0;
  color: var(--premium-badge);
  border: 1px solid var(--premium-badge);
  border-radius: 3px;
  padding: 2px 4px;
  font-size: 7px;
}

.profile-card small {
  display: block;
  color: var(--muted);
  font-size: 8px;
}

.nav-label {
  margin: 18px 8px 0;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 9px;
  position: relative;
}

.nav-label::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 88px;
  right: 0;
  height: 1px;
  background: var(--sidebar-line);
}

.nav {
  display: grid;
  gap: 7px;
}

.nav-item {
  width: 100%;
  border: 0;
  border-radius: 6px;
  color: var(--ink);
  background: transparent;
  padding: 9px 10px;
  text-align: left;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.nav-item:hover,
.nav-item.active {
  background: var(--card-hover);
  color: var(--ink);
}

.sidebar-footer {
  margin-top: auto;
  padding: 10px;
  border: 1px solid var(--sidebar-footer-line);
  border-radius: 7px;
  background: var(--sidebar-footer-bg);
}

.logout {
  margin-top: 9px;
  border: 1px solid var(--logout-line);
  border-radius: 6px;
  background: transparent;
  color: var(--logout-color);
  padding: 7px 9px;
  cursor: pointer;
  width: 100%;
}

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

.systembar {
  min-height: 47px;
  border-bottom: 1px solid var(--sysbar-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.system-icons {
  display: flex;
  gap: 14px;
  align-items: center;
}

.system-icons button {
  position: relative;
  border: 0;
  background: transparent;
  color: var(--sysbar-color);
  cursor: pointer;
  min-width: 18px;
  min-height: 18px;
  font-weight: 800;
}

.system-icons strong {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--badge-bg);
  color: #fff;
  min-width: 15px;
  min-height: 15px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 9px;
}

.system-icons button:last-child {
  width: 24px;
  height: 24px;
  font-size: 8px;
}

.topbar,
.section-head,
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar {
  min-height: 48px;
  margin: 0 0 0;
}

.breadcrumb {
  margin: 3px 0 0;
  font-size: 9px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 17px;
}

h2 {
  margin-bottom: 6px;
  font-size: 16px;
}

.count-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-left: 8px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--card);
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  vertical-align: middle;
}

.stock-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr)) auto;
  gap: 6px;
  align-items: stretch;
  margin: 0 0 10px;
}

.stock-summary-featured {
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.client-count-summary {
  grid-template-columns: repeat(3, minmax(120px, 1fr));
}

.stock-summary div {
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  padding: 8px 10px;
}

.stock-summary span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.stock-summary strong {
  display: block;
  margin-top: 4px;
  color: var(--primary);
  font-size: 20px;
}

.stock-summary button {
  min-height: 54px;
  align-self: stretch;
}

.message-template-panel textarea {
  min-height: 86px;
  resize: vertical;
}

.top-actions {
  display: flex;
  gap: 8px;
  align-items: end;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.search-box {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.search-box input,
.field input,
.field select,
.field textarea,
.referral input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--input-bg);
  color: var(--ink);
  padding: 9px 10px;
  outline: none;
}

.search-box input {
  min-width: min(330px, 42vw);
}

.button,
.icon-button {
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 9px 12px;
  cursor: pointer;
  min-height: 34px;
  font-weight: 800;
  font-size: 10px;
}

.button.primary {
  background: var(--btn-primary-bg);
  color: #fff;
}

.button.primary:hover {
  background: var(--btn-primary-hover);
}

.button.ghost,
.button.small {
  background: var(--card-bg);
  border-color: var(--line);
  color: var(--ink);
}

.install-app-btn {
  border-color: rgba(0, 208, 132, .45);
  color: var(--green);
}

.login-box .install-app-btn {
  width: 100%;
}

.button.small {
  min-height: 30px;
  padding: 6px 10px;
}

.pickup-btn.active {
  border-color: var(--red);
  color: var(--red);
  background: rgba(255, 46, 100, .08);
}

.pickup-flag {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin-left: 6px;
  padding: 2px 7px;
  border: 1px solid rgba(255, 46, 100, .55);
  border-radius: 6px;
  background: rgba(255, 46, 100, .12);
  color: var(--red);
  font-size: 10px;
  font-weight: 900;
}

.icon-button {
  width: 34px;
  min-height: 34px;
  padding: 0;
  background: var(--icon-btn-bg);
  color: var(--ink);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.referral {
  min-height: 52px;
  margin: 0 0 9px;
  padding: 10px 9px 10px 12px;
  background: rgba(0,208,132,.08);
  border-radius: 8px;
  color: var(--green);
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 10px;
}

.referral-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(0,208,132,.2);
  display: grid;
  place-items: center;
  color: var(--green);
  font-weight: 900;
}

.referral strong {
  color: var(--green);
  display: block;
  font-size: 11px;
}

.referral span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.referral-actions {
  display: flex;
  gap: 4px;
}

.referral input {
  background: var(--input-bg);
  color: var(--green);
  border-color: var(--green);
  width: 185px;
  min-height: 30px;
  padding: 7px 10px;
}

.block-title {
  min-height: 32px;
  border: 1px solid var(--block-title-line);
  border-left: 3px solid var(--block-title-accent);
  border-radius: 6px;
  background: var(--block-title-bg);
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-weight: 800;
  margin-bottom: 10px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 9px;
  margin-bottom: 10px;
}

.metric,
.panel,
.table,
.billing-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: var(--shadow);
}

.metric {
  min-height: 100px;
  padding: 13px 13px 10px;
  position: relative;
  overflow: hidden;
}

.metric::before,
.metric::after {
  content: "";
  position: absolute;
}

.metric::before {
  inset: 0 auto 0 0;
  width: 2px;
  background: var(--primary);
}

.metric::after {
  right: -21px;
  top: -22px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(8, 125, 255, 0.16);
}

.metric.green::before {
  background: var(--green);
}

.metric.green::after {
  background: rgba(0, 208, 132, 0.16);
}

.metric.red::before {
  background: var(--red);
}

.metric.red::after {
  background: rgba(255, 46, 100, 0.17);
}

.metric.yellow::before {
  background: var(--yellow);
}

.metric.yellow::after {
  background: rgba(255, 211, 42, 0.16);
}

.metric-icon {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: rgba(8, 125, 255, 0.23);
  color: #80bdff;
  display: grid;
  place-items: center;
  margin-bottom: 8px;
}

.metric.green .metric-icon {
  background: rgba(0, 208, 132, 0.21);
  color: var(--green);
}

.metric.red .metric-icon {
  background: rgba(255, 46, 100, 0.22);
  color: var(--red);
}

.metric.yellow .metric-icon {
  background: rgba(255, 211, 42, 0.22);
  color: var(--yellow);
}

.metric small {
  position: absolute;
  right: 11px;
  top: 14px;
  min-width: 50px;
  text-align: center;
  border-radius: 999px;
  background: rgba(8, 125, 255, 0.25);
  color: #2d8bff;
  padding: 4px 7px;
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
}

.metric.green small {
  color: var(--green);
  background: rgba(0, 208, 132, 0.16);
}

.metric.red small {
  color: var(--red);
  background: rgba(255, 46, 100, 0.18);
}

.metric.yellow small {
  color: var(--yellow);
  background: rgba(255, 211, 42, 0.18);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-bottom: 4px;
  font-weight: 800;
}

.metric strong {
  display: block;
  font-size: 24px;
  line-height: 1;
  color: #0d82ff;
}

.metric.green strong {
  color: var(--green);
}

.metric.red strong {
  color: var(--red);
}

.metric.yellow strong {
  color: var(--yellow);
}

.metric em {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  font-size: 8px;
  font-style: normal;
}

.dashboard-grid,
.report-grid,
.settings-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 9px;
}

.dashboard-grid.dense .panel {
  min-height: 250px;
}

.report-grid,
.settings-grid {
  grid-template-columns: minmax(0, 1fr) minmax(330px, 0.75fr);
}

.panel {
  padding: 12px 10px;
  min-width: 0;
}

.panel-head h2 {
  margin: 0;
}

.stack {
  display: grid;
  gap: 8px;
}

.due-panel {
  margin-top: 10px;
}

.due-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--card-bg);
}

.due-row strong,
.client-name {
  display: block;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(114, 63, 255, 0.25);
  color: #9b66ff;
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.tag.purple {
  background: rgba(114, 63, 255, 0.22);
  color: #a970ff;
}

.tag.danger {
  background: rgba(255, 46, 100, 0.16);
  color: var(--red);
}

.tag.warning {
  background: rgba(255, 211, 42, 0.18);
  color: var(--yellow);
}

.tag.success {
  background: rgba(0, 208, 132, 0.16);
  color: var(--green);
}

.money-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 8px;
  margin-top: 12px;
}

.money-grid div,
.due-mini div {
  min-height: 37px;
  border: 1px solid var(--money-line);
  border-radius: 5px;
  background: var(--money-bg);
  display: grid;
  place-items: center;
  padding: 6px;
}

.money-grid strong,
.due-mini strong {
  color: var(--green);
  font-size: 13px;
  line-height: 1;
}

.money-grid span,
.due-mini span {
  color: var(--money-text);
  font-size: 7px;
  margin-top: 3px;
}

.money-grid.compact {
  margin-top: 14px;
}

.danger-text {
  color: var(--red) !important;
}

.blue-text {
  color: var(--primary) !important;
}

.due-mini {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin: 12px 0;
}

.due-mini strong {
  color: var(--yellow);
  font-size: 14px;
}

.chart-wrap {
  height: 148px;
  border: 1px solid var(--money-line);
  border-radius: 6px;
  background: var(--chart-bg);
  padding: 8px;
}

canvas {
  width: 100%;
  height: 100%;
}

.table {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

th,
td {
  padding: 12px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0;
  background: var(--th-bg);
}

td {
  color: var(--td-color);
}

td span {
  color: var(--muted);
}

tr:last-child td {
  border-bottom: 0;
}

tr.needs-pickup td {
  background: rgba(255, 46, 100, .08);
  box-shadow: inset 3px 0 0 var(--red);
}

.pickup-section {
  margin-top: 14px;
  border: 1px solid rgba(255, 46, 100, .45);
  border-radius: 8px;
  background: rgba(255, 46, 100, .05);
  padding: 10px;
}

.pickup-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.pickup-section-head strong {
  color: var(--red);
  font-size: 13px;
}

.pickup-section-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.row-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.row-actions .button {
  min-height: 30px;
  padding: 6px 9px;
  font-size: 10px;
}

.bk-indicator {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 4px; vertical-align: middle;
}
.bk-indicator.green { background: var(--green); box-shadow: 0 0 6px var(--green); }
.bk-indicator.red { background: var(--red); box-shadow: 0 0 6px var(--red); animation: bkBlink .8s ease-in-out infinite; }
@keyframes bkBlink { 0%,100%{opacity:1} 50%{opacity:.3} }

.segmented {
  background: var(--seg-bg);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 4px;
  display: flex;
  gap: 4px;
}

.segmented button {
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  padding: 7px 11px;
  cursor: pointer;
  font-weight: 800;
}

.segmented button.active {
  background: var(--seg-active);
  color: var(--ink);
}

.billing-list,
.report-list,
.export-actions,
.roadmap {
  display: grid;
  gap: 10px;
}

.integration-status {
  min-height: 44px;
  margin: 0 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.integration-status strong {
  color: var(--ink);
}

.integration-status.ok {
  border-color: rgba(0, 208, 132, .35);
  background: rgba(0, 208, 132, .07);
}

.settings-status-list {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.settings-status-list div {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--card-bg);
  padding: 7px 9px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.settings-status-list span {
  color: var(--muted);
}

.settings-status-list strong {
  color: var(--primary);
  text-align: right;
}

.billing-card {
  padding: 13px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.billing-card p {
  color: var(--muted);
  margin-bottom: 0;
}

.whatsapp {
  background: var(--btn-primary-bg);
  color: #fff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  min-height: 34px;
  padding: 8px 11px;
  font-weight: 900;
}

.report-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.roadmap {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.roadmap span {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: var(--card-bg);
  font-weight: 800;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

dialog {
  border: 0;
  border-radius: 8px;
  padding: 0;
  width: min(920px, calc(100vw - 24px));
  background: var(--dialog-bg);
  color: var(--dialog-color);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.52);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.62);
}

.modal {
  padding: 20px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

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

.field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

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

.field textarea {
  min-height: 86px;
  resize: vertical;
}

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

.empty-state {
  padding: 24px;
  text-align: center;
  color: var(--muted);
}

.empty-state strong {
  display: block;
  color: var(--ink);
  margin-bottom: 6px;
}

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

  .metrics,
  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  body {
    display: block;
  }

  .sidebar {
    min-height: auto;
    position: static;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app {
    padding: 0 14px 18px;
  }

  .referral,
  .topbar,
  .section-head,
  .billing-card {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .referral-actions,
  .top-actions {
    justify-content: stretch;
    flex-direction: column;
  }

  .search-box,
  .search-box input,
  .referral input,
  .button {
    width: 100%;
  }

  .report-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .stock-summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .nav,
  .form-grid,
  .roadmap,
  .metrics,
  .dashboard-grid,
  .money-grid {
    grid-template-columns: 1fr;
  }

  .due-mini {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media print {
  .sidebar,
  .topbar,
  .section-head,
  .export-actions,
  .button,
  .row-actions,
  .systembar {
    display: none !important;
  }

  body {
    display: block;
    background: #fff;
    color: #000;
  }

  .app,
  .panel,
  .table {
    box-shadow: none;
    border: 0;
    padding: 0;
  }
}

/* ============================================================
   JARVIS - IRON MAN STYLE ASSISTANT
   ============================================================ */

/* Floating Action Button */
#jarvisFab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(145deg, #1a8aff, #0a4dbf);
  color: #fff;
  font-size: 24px;
  font-weight: 900;
  cursor: pointer;
  z-index: 9999;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 24px rgba(10, 77, 191, 0.5);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: "Segoe UI", Arial, sans-serif;
}

#jarvisFab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 32px rgba(10, 77, 191, 0.7);
}

#jarvisFab.active {
  transform: scale(0.9);
  box-shadow: 0 0 40px rgba(10, 77, 191, 0.3);
}

.jarvis-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(26, 138, 255, 0.3);
  animation: jarvisPulse 2s ease-in-out infinite;
}

@keyframes jarvisPulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.15); opacity: 0.2; }
}

/* Main Panel */
.jarvis-panel {
  position: fixed;
  bottom: 92px;
  right: 24px;
  width: 380px;
  height: 560px;
  max-height: calc(100vh - 120px);
  background: linear-gradient(170deg, rgba(12, 18, 30, 0.97), rgba(6, 10, 20, 0.98));
  border: 1px solid rgba(26, 138, 255, 0.25);
  border-radius: 16px;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(10, 77, 191, 0.1), inset 0 1px 0 rgba(26, 138, 255, 0.1);
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(20px);
}

.jarvis-panel.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: all;
}

.jarvis-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(26, 138, 255, 0.5), transparent);
}

/* Header */
.jarvis-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  border-bottom: 1px solid rgba(26, 138, 255, 0.12);
  flex-shrink: 0;
}

.jarvis-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.jarvis-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a8aff, #0a4dbf);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 0 20px rgba(26, 138, 255, 0.3);
  font-family: "Segoe UI", Arial, sans-serif;
}

.jarvis-brand strong {
  display: block;
  font-size: 15px;
  color: #e8edf5;
  font-weight: 800;
  letter-spacing: 1px;
}

.jarvis-brand span {
  display: block;
  font-size: 9px;
  color: rgba(26, 138, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 1px;
}

.jarvis-header-actions {
  display: flex;
  gap: 4px;
}

.jarvis-icon-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 13px;
  transition: all 0.2s;
}

.jarvis-icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.jarvis-icon-btn.listening {
  background: rgba(255, 46, 100, 0.2);
  color: #ff2e64;
  animation: jarvisVoicePulse 0.8s ease-in-out infinite;
}

@keyframes jarvisVoicePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 46, 100, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(255, 46, 100, 0); }
}

/* Status Bar */
.jarvis-status {
  padding: 6px 16px;
  font-size: 9px;
  color: rgba(0, 208, 132, 0.7);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.jarvis-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00d084;
  box-shadow: 0 0 8px rgba(0, 208, 132, 0.5);
  animation: jarvisDotBlink 1.5s ease-in-out infinite;
}

@keyframes jarvisDotBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Alerts */
.jarvis-alerts {
  padding: 8px 16px 0;
  display: grid;
  gap: 4px;
  flex-shrink: 0;
}

.jarvis-alert-item {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 10px;
  background: rgba(255, 46, 100, 0.1);
  border: 1px solid rgba(255, 46, 100, 0.2);
  color: #ff6b8a;
  font-weight: 600;
}

.jarvis-alert-item.success {
  background: rgba(0, 208, 132, 0.08);
  border-color: rgba(0, 208, 132, 0.15);
  color: rgba(0, 208, 132, 0.8);
}

/* Messages Area */
.jarvis-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.06) transparent;
}

.jarvis-messages::-webkit-scrollbar {
  width: 4px;
}

.jarvis-messages::-webkit-scrollbar-track {
  background: transparent;
}

.jarvis-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
}

.jarvis-msg {
  display: flex;
  animation: jarvisMsgIn 0.3s ease-out;
}

@keyframes jarvisMsgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.jarvis-msg.jarvis-user {
  justify-content: flex-end;
}

.jarvis-msg-content {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.5;
}

.jarvis-bot .jarvis-msg-content {
  background: rgba(26, 138, 255, 0.08);
  border: 1px solid rgba(26, 138, 255, 0.15);
  color: #d0d8e8;
  border-bottom-left-radius: 4px;
}

.jarvis-user .jarvis-msg-content {
  background: rgba(0, 208, 132, 0.1);
  border: 1px solid rgba(0, 208, 132, 0.15);
  color: #c0e8d8;
  border-bottom-right-radius: 4px;
}

.jarvis-msg-content strong {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  color: rgba(26, 138, 255, 0.7);
}

.jarvis-msg-content p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}

.jarvis-msg-content p strong {
  display: inline;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
  color: #5ca8ff;
}

/* Typing Indicator */
.jarvis-typing {
  padding: 4px 16px 0;
  display: none;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
}

.jarvis-typing.active {
  display: flex;
}

.jarvis-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(26, 138, 255, 0.4);
  animation: jarvisTypingBounce 1.2s ease-in-out infinite;
}

.jarvis-typing span:nth-child(2) { animation-delay: 0.2s; }
.jarvis-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes jarvisTypingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

/* Input Area */
.jarvis-input-area {
  display: flex;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
  align-items: end;
}

.jarvis-input-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.jarvis-input-wrap input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: #e8edf5;
  padding: 10px 14px;
  font-size: 12px;
  outline: none;
  transition: border-color 0.2s;
}

.jarvis-input-wrap input:focus {
  border-color: rgba(26, 138, 255, 0.4);
}

.jarvis-input-wrap input::placeholder {
  color: rgba(255, 255, 255, 0.2);
}

.jarvis-quick-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.jarvis-quick-actions button {
  border: 1px solid rgba(26, 138, 255, 0.15);
  border-radius: 4px;
  background: rgba(26, 138, 255, 0.06);
  color: rgba(26, 138, 255, 0.6);
  padding: 3px 8px;
  font-size: 9px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  font-weight: 600;
}

.jarvis-quick-actions button:hover {
  background: rgba(26, 138, 255, 0.15);
  color: rgba(26, 138, 255, 0.9);
  border-color: rgba(26, 138, 255, 0.3);
}

.jarvis-send-btn {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(145deg, #1a8aff, #0a4dbf);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.jarvis-send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 16px rgba(26, 138, 255, 0.4);
}

/* Scan line effect on panel */
.jarvis-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(26, 138, 255, 0.015) 2px,
    rgba(26, 138, 255, 0.015) 4px
  );
  pointer-events: none;
  border-radius: 16px;
}

/* Glow border animation */
@keyframes jarvisBorderGlow {
  0%, 100% { border-color: rgba(26, 138, 255, 0.25); }
  50% { border-color: rgba(26, 138, 255, 0.45); }
}

/* Responsive */
@media (max-width: 480px) {
  .jarvis-panel {
    right: 8px;
    left: 8px;
    bottom: 80px;
    width: auto;
    height: calc(100vh - 100px);
    max-height: none;
    border-radius: 12px;
  }

  #jarvisFab {
    bottom: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
    font-size: 20px;
  }
}
