:root {
  color-scheme: light;
  --ink: #13201d;
  --muted: #68766f;
  --line: #dce5df;
  --panel: #ffffff;
  --soft: #f4f8f5;
  --control: #ffffff;
  --subpanel: #f8fbf9;
  --hover: #edf3ef;
  --danger-soft: #fff7f7;
  --danger-badge: #fee4e2;
  --ok-badge: #dcfae6;
  --brand: #16423c;
  --brand-2: #d79a36;
  --danger: #b42318;
  --ok: #207a4d;
  --shadow: 0 18px 50px rgba(22, 66, 60, 0.12);
}

body.theme-dark {
  color-scheme: dark;
  --ink: #e7edf0;
  --muted: #9dacb6;
  --line: #2b3b46;
  --panel: #16232d;
  --soft: #0d1720;
  --control: #101c25;
  --subpanel: #1b2a35;
  --hover: #213442;
  --danger-soft: #3a1f24;
  --danger-badge: #5a2730;
  --ok-badge: #173b2b;
  --brand: #7dd3c7;
  --brand-2: #f0b35a;
  --danger: #ff8b80;
  --ok: #72d99a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--soft);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.hidden {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(19, 32, 29, 0.58), rgba(19, 32, 29, 0.34)),
    url("https://images.unsplash.com/photo-1518569656558-1f25e69d93d7?auto=format&fit=crop&w=1600&q=80") center/cover;
}

.login-panel {
  width: min(460px, 100%);
  padding: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow);
}

.theme-dark .login-panel {
  background: rgba(22, 35, 45, 0.95);
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  overflow: hidden;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 22px;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.55rem, 3vw, 2.3rem);
}

h3 {
  margin-bottom: 0;
  font-size: 1.05rem;
}

.login-form,
.form-panel,
.settings-form {
  display: grid;
  gap: 14px;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 0.9rem;
}

.checkbox-field input {
  width: 18px;
  min-height: 18px;
  flex: 0 0 18px;
  padding: 0;
  accent-color: var(--brand);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--control);
  color: var(--ink);
}

button[type="submit"],
.login-form button {
  min-height: 46px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

.form-error {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 0.9rem;
}

.login-note,
.biometric-note {
  display: grid;
  gap: 8px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 0.86rem;
}

.biometric-note {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--hover);
}

.biometric-note strong {
  color: var(--ink);
}

code {
  width: fit-content;
  padding: 5px 7px;
  border-radius: 6px;
  background: var(--hover);
  color: var(--brand);
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 22px;
  background: var(--panel);
  border-right: 1px solid var(--line);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-brand span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.82rem;
}

.nav-list {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.nav-item,
.ghost-button,
.small-button,
.file-button {
  min-height: 40px;
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  font-weight: 800;
}

.nav-item.active,
.nav-item:hover,
.ghost-button:hover,
.small-button:hover,
.file-button:hover {
  background: var(--hover);
}

.sidebar-footer {
  display: grid;
  gap: 8px;
  margin-top: auto;
}

.mobile-menu-toggle,
.drawer-close,
.mobile-drawer-overlay,
.mobile-today-pill,
.mobile-date-placeholder,
.mobile-date-icon,
.metric-icon {
  display: none;
}

.date-input-wrap {
  display: block;
  position: relative;
}

.empty-icon {
  display: none;
}

.main-content {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 24px;
}

.dashboard-title-area {
  min-width: 0;
  flex: 1 1 260px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.session-pill {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--control);
}

.session-pill span {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
}

.dashboard-header-actions {
  display: none;
  width: min(100%, 320px);
  margin-top: 2px;
}

.main-content:has(#dashboardView.active) .dashboard-header-actions {
  display: block;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.metric-grid,
.content-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.content-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  margin-top: 14px;
}

.metric-grid.admin-stock-only .metric-card-stock {
  grid-column: 1 / -1;
}

.dashboard-chart {
  margin-top: 14px;
}

.dashboard-filter {
  display: none;
  margin-left: auto;
  align-items: flex-end;
  gap: 8px;
}

.stock-filter-form {
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 0 0 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.stock-filter-form:not(.hidden) {
  display: flex;
}

.filter-toggle-btn {
  margin-left: auto;
  flex-shrink: 0;
  white-space: nowrap;
}

.main-content:has(#dashboardView.active) .dashboard-filter {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  width: 352px;
  max-width: min(100%, 352px);
}

.dashboard-filter-fields {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: nowrap;
}

.dashboard-filter .field {
  width: 170px;
  flex: 0 0 170px;
  gap: 5px;
  font-size: 0.78rem;
}

.dashboard-filter input[type="date"] {
  width: 100%;
}

.dashboard-filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  width: 100%;
}

.dashboard-filter-actions button {
  min-width: 86px;
  min-height: 44px;
}

.dashboard-filter small {
  display: block;
  width: 100%;
  text-align: right;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.show-all-row {
  text-align: center;
  padding: 12px 0 4px;
}

.show-all-row button {
  min-width: 160px;
}

@media (max-width: 768px) {
  .dashboard-header {
    flex-direction: column;
  }

  .dashboard-title-area {
    width: 100%;
    flex: none;
  }

  .main-content:has(#dashboardView.active) .dashboard-filter {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    flex: none;
  }

  .stock-filter-form {
    flex-direction: column;
  }

  .stock-filter-form .dashboard-filter-fields {
    width: 100%;
  }

  .stock-filter-form .dashboard-filter-actions {
    width: 100%;
  }

  .dashboard-filter-fields {
    width: 100%;
    flex-direction: column;
    flex-wrap: nowrap;
  }

  .dashboard-filter .field,
  .dashboard-filter-actions {
    width: 100%;
    flex: 1 1 100%;
  }

  .dashboard-filter-actions button {
    flex: 1;
  }

  .dashboard-filter small {
    text-align: left;
  }
}

.metric-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 24px rgba(19, 32, 29, 0.05);
}

.metric-card {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.metric-card span,
.metric-card small {
  color: var(--muted);
}

.metric-card strong {
  font-size: clamp(1.3rem, 2vw, 2rem);
  line-height: 1.05;
}

.panel {
  min-width: 0;
  padding: 18px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.stock-form-stack,
.sale-stock-fields {
  display: grid;
  gap: 14px;
}

.field-hint,
.field-warning {
  display: block;
  margin-top: 6px;
  font-size: 0.78rem;
  font-weight: 800;
}

.field-hint {
  color: var(--muted);
}

.field-warning {
  color: var(--danger);
}

.transaction-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--subpanel);
}

.transaction-total span {
  color: var(--muted);
  font-weight: 900;
}

.transaction-total strong {
  font-size: 1.45rem;
  line-height: 1;
}

.transaction-mobile-list {
  display: none;
}

.bar-list,
.activity-list,
.user-list,
.forecast-result {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  gap: 8px;
}

.bar-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 800;
}

.bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--hover);
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--brand-2);
}

.activity-item,
.user-row,
.forecast-card {
  display: grid;
  gap: 5px;
  padding: 12px;
  border-radius: 8px;
  background: var(--subpanel);
}

.user-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.user-row small {
  display: block;
  margin-top: 4px;
}

.activity-item small,
.user-row small,
.forecast-card span {
  color: var(--muted);
}

.user-profile {
  display: grid;
  gap: 10px;
}

.profile-row {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 8px;
  background: var(--subpanel);
}

.profile-row span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.form-message {
  min-height: 20px;
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
}

.form-message.error {
  color: var(--danger);
}

.form-message.success {
  color: var(--ok);
}

.activity-item.danger {
  border-left: 4px solid var(--danger);
  background: var(--danger-soft);
}

.activity-item.ok {
  border-left: 4px solid var(--ok);
}

.notification-item {
  grid-template-columns: minmax(0, 1fr) 36px;
  align-items: start;
}

.notification-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.notification-close {
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-weight: 900;
  text-align: center;
}

.notification-close:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.inline-field,
.button-row {
  display: flex;
  gap: 8px;
}

.inline-field select,
.button-row button[type="submit"] {
  flex: 1;
}

.icon-button {
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--control);
  color: var(--brand);
  font-size: 1.3rem;
  font-weight: 900;
  text-align: center;
}

.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.panel-divider {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
  margin: 4px 0;
}

.small-button,
.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  min-height: 36px;
  border: 1px solid var(--line);
  background: var(--control);
  font-size: 0.86rem;
}

.primary-button {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.primary-button:hover {
  background: var(--brand);
}

.danger-button {
  color: var(--danger);
}

.danger-button:hover {
  background: var(--danger-soft);
}

.cashflow-chart {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.chart-legend {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.86rem;
}

.chart-legend span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-weight: 800;
}

.chart-legend i {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 4px;
}

.column-chart {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(54px, 1fr));
  gap: 10px;
  min-height: 250px;
  align-items: end;
  padding-top: 8px;
  overflow-x: auto;
}

.column-group {
  min-width: 54px;
  display: grid;
  grid-template-rows: 180px auto auto;
  gap: 6px;
  align-items: end;
  text-align: center;
}

.column-bars {
  height: 180px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 5px;
  padding: 0 4px;
  border-bottom: 1px solid var(--line);
}

.column-bar {
  width: min(18px, 38%);
  border-radius: 999px;
  min-height: 0;
}

.column-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.column-group small {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.chart-income {
  background: var(--ok);
}

.chart-expense {
  background: var(--danger);
}

#dashboardView .content-grid .panel,
#dashboardView .dashboard-chart {
  border: 1px solid rgba(22, 66, 60, 0.12);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 249, 0.96));
  box-shadow: 0 16px 36px rgba(22, 66, 60, 0.08);
}

.theme-dark #dashboardView .content-grid .panel,
.theme-dark #dashboardView .dashboard-chart {
  border-color: rgba(125, 211, 199, 0.16);
  background:
    linear-gradient(180deg, rgba(22, 35, 45, 0.96), rgba(16, 28, 37, 0.96));
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.28);
}

#dashboardView .panel-heading {
  margin-bottom: 12px;
}

#stockBars.bar-list {
  gap: 14px;
}

#stockBars .bar-row {
  padding: 12px;
  border: 1px solid rgba(22, 66, 60, 0.08);
  border-radius: 12px;
  background: var(--subpanel);
}

#stockBars .bar-track {
  height: 9px;
  background: rgba(22, 66, 60, 0.08);
}

.theme-dark #stockBars .bar-track {
  background: rgba(255, 255, 255, 0.08);
}

#stockBars .bar-fill {
  background: linear-gradient(90deg, #d79a36, #f0c46a);
  box-shadow: 0 5px 14px rgba(215, 154, 54, 0.22);
}

#notificationList.activity-list {
  gap: 10px;
}

#notificationList .activity-item {
  border: 1px solid rgba(22, 66, 60, 0.08);
  border-radius: 12px;
  background: var(--subpanel);
}

#notificationList .notification-item {
  box-shadow: inset 4px 0 0 rgba(22, 66, 60, 0.22);
}

#notificationList .notification-item.ok {
  box-shadow: inset 4px 0 0 var(--ok);
}

#notificationList .notification-item.danger {
  box-shadow: inset 4px 0 0 var(--danger);
}

#notificationList .notification-close {
  border-radius: 10px;
  background: var(--panel);
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

#notificationList .notification-close:hover {
  transform: translateY(-1px);
}

#cashflowChart.cashflow-chart {
  gap: 16px;
}

#cashflowChart .chart-legend {
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--subpanel);
  width: fit-content;
}

#cashflowChart .chart-legend i {
  border-radius: 999px;
}

#cashflowChart .column-chart {
  min-height: 280px;
  padding: 16px 10px 6px;
  border-radius: 14px;
  background:
    linear-gradient(to top, rgba(22, 66, 60, 0.08) 1px, transparent 1px) 0 0 / 100% 25%,
    linear-gradient(180deg, var(--subpanel), rgba(248, 251, 249, 0.45));
  overflow-x: auto;
}

.theme-dark #cashflowChart .column-chart {
  background:
    linear-gradient(to top, rgba(255, 255, 255, 0.08) 1px, transparent 1px) 0 0 / 100% 25%,
    linear-gradient(180deg, var(--subpanel), rgba(16, 28, 37, 0.45));
}

#cashflowChart .column-bars {
  height: 190px;
  border-bottom-color: rgba(22, 66, 60, 0.14);
}

.theme-dark #cashflowChart .column-bars {
  border-bottom-color: rgba(255, 255, 255, 0.14);
}

#cashflowChart .column-bar {
  width: min(20px, 42%);
  border-radius: 12px 12px 5px 5px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
}

#cashflowChart .column-bar.chart-income {
  background: linear-gradient(180deg, #45d483, #207a4d);
}

#cashflowChart .column-bar.chart-expense {
  background: linear-gradient(180deg, #f97373, #b42318);
}

#stockView .split-layout,
#cashflowView .split-layout,
#forecastView .split-layout {
  gap: 18px;
}

#stockView .panel,
#cashflowView .panel,
#forecastView .panel {
  border-color: rgba(22, 66, 60, 0.12);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 249, 0.98));
  box-shadow: 0 18px 40px rgba(22, 66, 60, 0.08);
}

.theme-dark #stockView .panel,
.theme-dark #cashflowView .panel,
.theme-dark #forecastView .panel {
  border-color: rgba(125, 211, 199, 0.16);
  background:
    linear-gradient(180deg, rgba(22, 35, 45, 0.96), rgba(16, 28, 37, 0.98));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

#stockView .form-panel,
#cashflowView .form-panel,
#forecastView .form-panel {
  padding: 20px;
}

#stockView .panel-heading,
#cashflowView .panel-heading,
#forecastView .panel-heading {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(22, 66, 60, 0.08);
}

.theme-dark #stockView .panel-heading,
.theme-dark #cashflowView .panel-heading,
.theme-dark #forecastView .panel-heading {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

#stockView .panel-heading h3,
#cashflowView .panel-heading h3,
#forecastView .panel-heading h3 {
  letter-spacing: 0;
}

#stockView label,
#cashflowView label,
#forecastView label {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: none;
}

#stockView input,
#stockView select,
#cashflowView input,
#cashflowView select,
#forecastView input,
#forecastView select {
  border-radius: 12px;
  background: color-mix(in srgb, var(--control) 92%, var(--soft));
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

#stockView input:focus,
#stockView select:focus,
#cashflowView input:focus,
#cashflowView select:focus,
#forecastView input:focus,
#forecastView select:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--brand) 46%, var(--line));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 13%, transparent);
}

#stockView button[type="submit"],
#cashflowView button[type="submit"],
#forecastView button[type="submit"] {
  border-radius: 12px;
  box-shadow: 0 12px 24px rgba(22, 66, 60, 0.18);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

#stockView button[type="submit"]:hover,
#cashflowView button[type="submit"]:hover,
#forecastView button[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(22, 66, 60, 0.22);
  filter: saturate(1.04);
}

#stockView .table-wrap,
#cashflowView .table-wrap {
  border-radius: 14px;
  overflow: auto;
}

#stockView table,
#cashflowView table {
  border-collapse: separate;
  border-spacing: 0;
}

#stockView th,
#cashflowView th {
  color: var(--muted);
  background: var(--subpanel);
  font-size: 0.74rem;
}

#stockView tbody tr,
#cashflowView tbody tr {
  transition: background 0.16s ease;
}

#stockView tbody tr:hover,
#cashflowView tbody tr:hover {
  background: color-mix(in srgb, var(--brand) 5%, transparent);
}

#stockView td,
#cashflowView td {
  vertical-align: top;
}

#stockView .small-button,
#cashflowView .small-button {
  border-radius: 10px;
}

#cashflowView .toolbar .small-button {
  min-height: 38px;
  padding-inline: 14px;
  background: var(--subpanel);
  font-weight: 800;
}

#cashflowView .badge {
  border-radius: 999px;
  padding-inline: 10px;
}

#forecastView .forecast-panel {
  min-height: 260px;
}

#forecastView .forecast-result {
  gap: 14px;
}

#forecastView .forecast-card {
  border: 1px solid rgba(22, 66, 60, 0.08);
  border-radius: 14px;
  background:
    linear-gradient(135deg, var(--subpanel), color-mix(in srgb, var(--brand-2) 8%, var(--subpanel)));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.theme-dark #forecastView .forecast-card {
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.file-button input {
  display: none;
}

.table-wrap {
  overflow-x: auto;
}

.stock-history-mobile {
  display: none;
}

.cashflow-mobile-list {
  display: none;
}

.stock-detail-grid {
  display: grid;
  gap: 10px;
}

.stock-detail-row {
  display: grid;
  gap: 4px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.stock-detail-row span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.stock-detail-row strong {
  overflow-wrap: anywhere;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

th,
td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--hover);
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 800;
}

.badge.danger {
  background: var(--danger-badge);
  color: var(--danger);
}

.badge.ok {
  background: var(--ok-badge);
  color: var(--ok);
}

.muted-text {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.appearance-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--subpanel);
}

.appearance-card strong {
  display: block;
}

.appearance-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 700;
}

.theme-switch {
  width: fit-content;
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  cursor: pointer;
}

.theme-switch input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.switch-track {
  width: 54px;
  height: 30px;
  position: relative;
  flex: 0 0 54px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--control);
  transition: background 0.18s ease, border-color 0.18s ease;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--muted);
  transition: transform 0.18s ease, background 0.18s ease;
}

.theme-switch input:checked + .switch-track {
  border-color: var(--brand);
  background: rgba(125, 211, 199, 0.18);
}

.theme-switch input:checked + .switch-track::after {
  transform: translateX(24px);
  background: var(--brand);
}

.theme-switch input:focus-visible + .switch-track {
  outline: 2px solid var(--brand-2);
  outline-offset: 3px;
}

.forecast-card strong {
  font-size: 1.45rem;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.action-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.action-buttons .small-button {
  min-width: 64px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(19, 32, 29, 0.45);
}

.modal-panel {
  width: min(520px, 100%);
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--brand);
  box-shadow: var(--shadow);
  font-weight: 800;
}

@media (max-width: 980px) and (min-width: 769px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav-list {
    display: flex;
    overflow-x: auto;
    max-width: 100%;
    padding-bottom: 2px;
  }

  .nav-item {
    flex: 0 0 auto;
    min-width: 112px;
  }

  .metric-grid,
  .content-grid,
  .split-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  body {
    overflow-x: hidden;
  }

  body.drawer-open {
    overflow: hidden;
  }

  .app-shell {
    display: block;
    min-width: 0;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    width: min(280px, 82vw);
    height: 100dvh;
    padding: 18px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.24s ease;
    box-shadow: var(--shadow);
  }

  body.drawer-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-brand {
    justify-content: space-between;
  }

  .drawer-close {
    width: 38px;
    min-width: 38px;
    min-height: 38px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--control);
    color: var(--ink);
    font-weight: 900;
  }

  .mobile-drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 55;
    display: block;
    border: 0;
    padding: 0;
    background: rgba(0, 0, 0, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  body.drawer-open .mobile-drawer-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  .nav-list {
    display: grid;
    gap: 8px;
    overflow: visible;
    max-width: none;
    padding-bottom: 0;
  }

  .nav-item,
  .ghost-button {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
  }

  .sidebar-footer {
    border-top: 1px solid var(--line);
    padding-top: 12px;
  }

  .mobile-menu-toggle {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    display: inline-grid;
    place-items: center;
    gap: 4px;
    align-self: flex-start;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--control);
  }

  .mobile-menu-toggle span {
    width: 18px;
    height: 2px;
    display: block;
    border-radius: 999px;
    background: var(--ink);
  }

  .dashboard-header {
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
  }

  .dashboard-title-area {
    flex: 1 1 0;
    min-width: 0;
  }

  .metric-grid,
  .content-grid,
  .split-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .main-content {
    padding: 18px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-title-area {
    width: 100%;
  }

  .main-content:has(#dashboardView.active) .dashboard-filter {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    justify-content: stretch;
    flex-wrap: wrap;
  }

  .dashboard-filter label,
  .dashboard-filter-actions {
    width: 100%;
  }

  .dashboard-filter-actions button {
    flex: 1;
  }

  .dashboard-filter small {
    text-align: left;
  }

  .login-panel {
    padding: 24px;
  }

  .notification-item {
    grid-template-columns: minmax(0, 1fr) 34px;
  }

  .table-actions {
    min-width: 136px;
  }

  .action-buttons {
    min-width: 144px;
  }

  .column-chart {
    grid-template-columns: repeat(auto-fit, minmax(48px, 1fr));
    gap: 8px;
  }

  .column-group {
    min-width: 48px;
    grid-template-rows: 150px auto auto;
  }

  .column-bars {
    height: 150px;
  }

  .toast {
    right: 12px;
    bottom: 12px;
  }
}

@media (max-width: 768px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .main-content {
    padding: 16px;
  }

  .topbar.dashboard-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(128px, 148px);
    align-items: start;
    gap: 16px 12px;
    margin-bottom: 16px;
  }

  .mobile-menu-toggle {
    width: 38px;
    min-width: 38px;
    min-height: 38px;
    padding: 0;
    gap: 3px;
    justify-self: start;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .mobile-menu-toggle span {
    width: 16px;
    background: var(--brand);
  }

  .mobile-today-pill {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-self: end;
    gap: 7px;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 900;
    line-height: 1.2;
    text-align: right;
    text-transform: uppercase;
  }

  .dashboard-title-area {
    grid-column: 1;
    grid-row: 2;
    width: auto;
    display: grid;
    gap: 10px;
  }

  .dashboard-title-area .eyebrow {
    display: none;
  }

  .dashboard-title-area h2 {
    font-size: clamp(2rem, 10vw, 2.55rem);
    line-height: 0.96;
  }

  .session-pill {
    display: grid;
    width: fit-content;
    min-height: 0;
    gap: 2px;
    padding: 6px 9px;
    border-radius: 999px;
  }

  .session-pill span,
  .session-pill strong {
    display: block;
    line-height: 1.05;
  }

  .session-pill span {
    font-size: 0.63rem;
  }

  .session-pill strong {
    font-size: 0.8rem;
  }

  .main-content:has(#dashboardView.active) .dashboard-filter {
    grid-column: 2;
    grid-row: 2;
    width: 100%;
    max-width: 148px;
    margin-left: 0;
    display: grid;
    gap: 8px;
    align-self: start;
  }

  .dashboard-filter-fields {
    display: grid;
    width: 100%;
    gap: 8px;
  }

  .dashboard-filter .field {
    width: 100%;
    flex: none;
    gap: 4px;
    color: var(--muted);
    font-size: 0.69rem;
  }

  .date-input-wrap input[type="date"] {
    min-height: 38px;
    padding: 8px 32px 8px 10px;
    border-radius: 10px;
    font-size: 0.82rem;
  }

  .date-input-wrap input[type="date"]::-webkit-calendar-picker-indicator {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
  }

  .date-input-wrap input[type="date"].is-empty {
    color: transparent;
  }

  .date-input-wrap input[type="date"].is-empty::-webkit-datetime-edit {
    color: transparent;
  }

  .mobile-date-placeholder {
    position: absolute;
    left: 11px;
    top: 50%;
    display: block;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    pointer-events: none;
  }

  .date-input-wrap input:not(.is-empty) + .mobile-date-placeholder,
  .date-input-wrap input:focus + .mobile-date-placeholder {
    display: none;
  }

  .mobile-date-icon {
    position: absolute;
    right: 11px;
    top: 50%;
    width: 15px;
    height: 15px;
    display: block;
    transform: translateY(-50%);
    border: 2px solid var(--muted);
    border-top-width: 5px;
    border-radius: 4px;
    font-size: 0;
    opacity: 0.75;
    pointer-events: none;
  }

  .dashboard-filter-actions {
    width: auto;
    justify-content: flex-start;
    gap: 5px;
  }

  .dashboard-filter-actions button,
  .dashboard-filter-actions .small-button {
    min-width: 0;
    min-height: 37px;
    padding: 7px 8px;
    border-radius: 10px;
    font-size: 0.72rem;
  }

  .dashboard-filter small {
    text-align: left;
    font-size: 0.68rem;
    line-height: 1.25;
  }

  .metric-grid,
  .content-grid,
  .dashboard-chart {
    gap: 16px;
    margin-top: 16px;
  }

  .metric-card,
  .panel {
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(19, 32, 29, 0.08);
  }

  .metric-card {
    position: relative;
    padding: 18px 18px 16px;
    gap: 10px;
  }

  .metric-icon {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border-radius: 12px;
    background: var(--hover);
    color: var(--brand);
    font-size: 0.72rem;
    font-weight: 900;
  }

  .metric-card strong {
    font-size: clamp(1.65rem, 8vw, 2.1rem);
  }

  #dashboardView.is-loading .metric-card strong {
    width: 58%;
    min-height: 32px;
    border-radius: 999px;
    color: transparent;
    background: linear-gradient(90deg, var(--hover), var(--subpanel), var(--hover));
    background-size: 220% 100%;
    animation: mobileSkeleton 1.1s ease-in-out infinite;
  }

  .panel {
    padding: 18px;
  }

  .panel-heading {
    gap: 10px;
    margin-bottom: 2px;
  }

  .activity-item.empty-state {
    place-items: center;
    min-height: 96px;
    text-align: center;
  }

  .empty-icon {
    display: block;
    font-size: 1.35rem;
  }

  .table-wrap {
    margin-inline: -4px;
    padding-inline: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .stock-history-desktop {
    display: none;
  }

  .cashflow-desktop-table {
    display: none;
  }

  .stock-history-mobile {
    display: grid;
    gap: 14px;
  }

  .cashflow-mobile-list {
    display: grid;
    gap: 14px;
  }

  .transaction-desktop-table {
    display: none;
  }

  .transaction-mobile-list {
    display: grid;
    gap: 14px;
  }

  .stock-history-card,
  .cashflow-mobile-card,
  .transaction-mobile-card {
    width: 100%;
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--subpanel);
    box-shadow: 0 10px 24px rgba(19, 32, 29, 0.07);
  }

  .cashflow-mobile-card.income {
    border-left: 4px solid var(--ok);
  }

  .cashflow-mobile-card.expense {
    border-left: 4px solid var(--danger);
  }

  .stock-history-card div {
    display: grid;
    gap: 4px;
  }

  .stock-history-card small,
  .cashflow-mobile-card small,
  .transaction-mobile-card small {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 900;
    text-transform: uppercase;
  }

  .stock-history-card strong,
  .cashflow-mobile-card strong,
  .cashflow-mobile-card p,
  .transaction-mobile-card strong,
  .transaction-mobile-card p {
    overflow-wrap: anywhere;
  }

  .cashflow-mobile-card b,
  .transaction-mobile-card b {
    color: var(--brand);
    font-size: 1.15rem;
  }

  .cashflow-mobile-card p,
  .transaction-mobile-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
  }

  .stock-history-card .small-button,
  .cashflow-mobile-card .small-button,
  .transaction-mobile-card .small-button {
    width: fit-content;
    min-width: 92px;
  }

  .stock-detail-grid {
    gap: 0;
  }

  .stock-detail-row {
    grid-template-columns: minmax(104px, 38%) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
  }

  .user-management-wrap {
    margin-inline: 0;
    padding-inline: 0;
    overflow: visible;
  }

  table {
    min-width: 680px;
  }

  .user-management-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 14px;
  }

  .user-management-table thead {
    display: none;
  }

  .user-management-table,
  .user-management-table tbody,
  .user-management-table tr,
  .user-management-table td {
    display: block;
    width: 100%;
  }

  .user-management-table tr {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--subpanel);
    box-shadow: 0 10px 24px rgba(19, 32, 29, 0.07);
  }

  .user-management-table td {
    display: grid;
    grid-template-columns: minmax(92px, 38%) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
    overflow-wrap: anywhere;
  }

  .user-management-table td:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .user-management-table td[data-label="Aksi"] {
    grid-template-columns: 1fr;
  }

  .user-management-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
  }

  .user-management-table .role-text,
  .user-management-table .badge {
    white-space: nowrap;
  }

  .user-management-table .action-buttons {
    min-width: 0;
    gap: 8px;
    width: 100%;
  }

  .user-management-table .action-buttons .small-button {
    min-width: 0;
    flex: 1 1 auto;
    padding-inline: 10px;
    white-space: nowrap;
  }

  #settingsView .content-grid {
    gap: 16px;
  }

  #settingsView .panel,
  #settingsForm {
    width: 100%;
    min-width: 0;
  }

  th,
  td {
    padding: 12px 10px;
  }

  .modal {
    padding: 12px;
    align-items: end;
  }

  .modal-panel {
    width: min(100%, 520px);
    max-height: calc(100dvh - 24px);
    padding: 18px;
    border-radius: 16px;
  }

  .sidebar {
    transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  .nav-item.active {
    color: var(--brand);
    box-shadow: inset 3px 0 0 var(--brand);
  }

  .sidebar-footer {
    gap: 10px;
  }

  .appearance-card {
    align-items: flex-start;
  }
}

@keyframes mobileSkeleton {
  0% {
    background-position: 120% 0;
  }
  100% {
    background-position: -120% 0;
  }
}

.metric-card {
  min-height: 118px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.64)),
    var(--panel);
  box-shadow: 0 18px 38px rgba(19, 32, 29, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.74);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--brand) 28%, var(--line));
  box-shadow: 0 22px 46px rgba(19, 32, 29, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.theme-dark .metric-card {
  background:
    linear-gradient(135deg, rgba(33, 49, 62, 0.9), rgba(20, 32, 43, 0.74)),
    var(--panel);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.theme-dark .metric-card:hover {
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.metric-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.metric-card .metric-icon {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86), 0 14px 26px rgba(15, 23, 42, 0.12);
}

.theme-dark .metric-card .metric-icon {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 14px 28px rgba(0, 0, 0, 0.28);
}

.metric-icon svg {
  width: 50px;
  height: 50px;
  display: block;
  filter: drop-shadow(0 10px 10px rgba(15, 23, 42, 0.18));
}

.metric-card-stock .metric-icon {
  background: linear-gradient(145deg, rgba(219, 234, 254, 0.9), rgba(147, 197, 253, 0.36));
}

.metric-card-income .metric-icon {
  background: linear-gradient(145deg, rgba(220, 252, 231, 0.92), rgba(134, 239, 172, 0.34));
}

.metric-card-expense .metric-icon {
  background: linear-gradient(145deg, rgba(254, 226, 226, 0.92), rgba(252, 165, 165, 0.34));
}

.metric-card-profit .metric-icon {
  background: linear-gradient(145deg, rgba(254, 243, 199, 0.94), rgba(251, 191, 36, 0.34));
}

.theme-dark .metric-card-stock .metric-icon {
  background: linear-gradient(145deg, rgba(37, 99, 235, 0.34), rgba(15, 23, 42, 0.1));
}

.theme-dark .metric-card-income .metric-icon {
  background: linear-gradient(145deg, rgba(22, 163, 74, 0.34), rgba(15, 23, 42, 0.1));
}

.theme-dark .metric-card-expense .metric-icon {
  background: linear-gradient(145deg, rgba(220, 38, 38, 0.34), rgba(15, 23, 42, 0.1));
}

.theme-dark .metric-card-profit .metric-icon {
  background: linear-gradient(145deg, rgba(217, 119, 6, 0.38), rgba(15, 23, 42, 0.1));
}

.metric-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.metric-card .metric-title {
  color: var(--ink);
  font-weight: 900;
  line-height: 1.12;
}

.metric-card .metric-copy small,
.metric-card .metric-value small {
  color: var(--muted);
  font-weight: 700;
}

.metric-value {
  min-width: 92px;
  margin-left: auto;
  display: grid;
  gap: 4px;
  text-align: right;
  justify-items: end;
}

.metric-card .metric-value strong {
  max-width: 100%;
  color: var(--ink);
  font-size: clamp(1.25rem, 1.7vw, 1.86rem);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

@media (max-width: 768px) {
  .metric-card {
    min-height: 94px;
    padding: 16px;
    gap: 12px;
    border-radius: 16px;
  }

  .metric-identity {
    gap: 12px;
  }

  .metric-card .metric-icon {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
    border-radius: 16px;
  }

  .metric-icon svg {
    width: 43px;
    height: 43px;
  }

  .metric-card .metric-title {
    font-size: 0.95rem;
  }

  .metric-card .metric-copy small,
  .metric-card .metric-value small {
    font-size: 0.72rem;
  }

  .metric-value {
    min-width: 86px;
  }

  .metric-card .metric-value strong {
    font-size: clamp(1.1rem, 5vw, 1.42rem);
  }
}

.dashboard-sale-cta {
  width: calc((100% - 42px) / 4);
  min-width: 280px;
  margin: 20px 0 18px;
}

.dashboard-sale-button {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 0;
  border-radius: 16px;
  padding: 13px 18px;
  color: #fff;
  text-align: left;
  cursor: pointer;
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  box-shadow: 0 16px 30px rgba(15, 118, 110, 0.24);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.dashboard-sale-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 38px rgba(15, 118, 110, 0.3);
  filter: saturate(1.04);
}

.dashboard-sale-button:active {
  transform: translateY(0);
  background: linear-gradient(135deg, #0b5f59, #0f766e);
  box-shadow: 0 10px 20px rgba(15, 118, 110, 0.22);
}

.dashboard-sale-button-compact {
  min-height: 56px;
  padding: 12px 16px;
}

.dashboard-sale-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.17);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.dashboard-sale-icon svg {
  width: 24px;
  height: 24px;
}

.dashboard-sale-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.dashboard-sale-copy strong {
  font-size: 1rem;
  line-height: 1.15;
}

.dashboard-sale-copy small {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.82rem;
  font-weight: 800;
}

@media (max-width: 768px) {
  .dashboard-header-actions {
    width: 100%;
  }

  .dashboard-sale-cta {
    width: 100%;
    min-width: 0;
    margin: 18px 0 16px;
  }

  .dashboard-sale-button {
    min-height: 64px;
    padding: 14px 16px;
    border-radius: 16px;
  }

  .dashboard-sale-icon {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }
}


/* Forecast Analytics Dashboard */
#forecastView .forecast-shell {
  display: grid;
  gap: 18px;
}

#forecastView .forecast-tabs {
  display: inline-flex;
  width: fit-content;
  gap: 6px;
  padding: 6px;
  border: 1px solid rgba(22, 66, 60, 0.1);
  border-radius: 16px;
  background: color-mix(in srgb, var(--subpanel) 88%, var(--brand-2));
  box-shadow: 0 16px 36px rgba(22, 66, 60, 0.12);
}

#forecastView .forecast-tab {
  border: 0;
  border-radius: 12px;
  padding: 10px 18px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
  cursor: pointer;
}

#forecastView .forecast-tab.active {
  color: white;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 12px 22px rgba(22, 66, 60, 0.24);
}

#forecastView .forecast-tab-pane {
  display: none;
}

#forecastView .forecast-tab-pane.active {
  display: block;
}

#forecastView .forecast-filter-panel {
  margin-bottom: 18px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--subpanel) 92%, white), color-mix(in srgb, var(--brand-2) 12%, var(--subpanel)));
}

#forecastView .forecast-filter-grid {
  display: grid;
  grid-template-columns: minmax(150px, 180px) minmax(150px, 180px) 1fr auto;
  align-items: end;
  gap: 12px;
}

#forecastView .forecast-quick-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

#forecastView .forecast-quick-filter .small-button.active {
  color: white;
  background: var(--brand);
  border-color: var(--brand);
}

#forecastView .forecast-analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 18px;
}

#forecastView .forecast-analytics-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(22, 66, 60, 0.12);
  background: radial-gradient(circle at 18% 0%, rgba(125, 211, 199, 0.16), transparent 34%), linear-gradient(145deg, var(--subpanel), color-mix(in srgb, var(--brand-2) 9%, var(--subpanel)));
  box-shadow: 0 24px 48px rgba(22, 66, 60, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.58);
  transform-style: preserve-3d;
}

#forecastView .forecast-card-wide {
  grid-column: span 1;
}

#forecastView .forecast-chart {
  min-height: 260px;
}

#forecastView .growth-pill {
  padding: 10px 14px;
  border-radius: 999px;
  color: #0f513d;
  background: rgba(125, 211, 199, 0.22);
  font-weight: 950;
  box-shadow: inset 0 0 0 1px rgba(125, 211, 199, 0.34);
}

#forecastView .growth-pill.danger {
  color: #8f1d1d;
  background: rgba(239, 143, 143, 0.2);
}

#forecastView .forecast-svg {
  width: 100%;
  height: 280px;
  filter: drop-shadow(0 20px 24px rgba(22, 66, 60, 0.16));
}

#forecastView .chart-grid-line {
  stroke: rgba(22, 66, 60, 0.1);
  stroke-width: 1;
}

#forecastView .forecast-line-solid {
  fill: none;
  stroke: url(#forecastLineGlow);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#forecastView .forecast-line-dashed {
  stroke: #f7c948;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 12 10;
}

#forecastView .forecast-point circle {
  fill: var(--subpanel);
  stroke: var(--brand);
  stroke-width: 4;
  cursor: pointer;
}

#forecastView .forecast-point.is-forecast circle {
  stroke: #f7c948;
}

#forecastView .forecast-point text {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

#forecastView .forecast-bars-3d {
  min-height: 240px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 34px;
  perspective: 700px;
}

#forecastView .forecast-bar-col {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-width: 88px;
  color: var(--muted);
  font-size: 0.82rem;
}

#forecastView .forecast-bar-col strong {
  color: var(--text);
  font-size: 1rem;
}

#forecastView .forecast-bar {
  width: 56px;
  min-height: 12px;
  border-radius: 12px 12px 6px 6px;
  transform: rotateX(10deg) rotateY(-18deg);
  box-shadow: 16px 18px 24px rgba(22, 66, 60, 0.22), inset -10px 0 18px rgba(0, 0, 0, 0.12), inset 8px 0 16px rgba(255, 255, 255, 0.22);
}

#forecastView .forecast-bar.forecast {
  background: linear-gradient(160deg, #f7c948, #b7791f);
}

#forecastView .forecast-bar.actual {
  background: linear-gradient(160deg, #7dd3c7, #16423c);
}

#forecastView .forecast-only-state,
#forecastView .forecast-empty-state {
  display: grid;
  place-items: center;
  min-height: 220px;
  gap: 6px;
  color: var(--muted);
  text-align: center;
}

#forecastView .forecast-only-state strong,
#forecastView .forecast-empty-state strong {
  color: var(--text);
  font-size: 1.1rem;
}

#forecastView .forecast-pie-chart {
  display: grid;
  grid-template-columns: 190px 1fr;
  align-items: center;
  gap: 18px;
}

#forecastView .forecast-pie {
  width: 180px;
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow: 0 22px 40px rgba(22, 66, 60, 0.2), inset -18px -18px 28px rgba(0, 0, 0, 0.12), inset 12px 12px 22px rgba(255, 255, 255, 0.24);
  transform: rotateX(16deg) rotateZ(-8deg);
}

#forecastView .forecast-legend {
  display: grid;
  gap: 10px;
}

#forecastView .forecast-legend div {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 0.82rem;
}

#forecastView .forecast-legend span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

#forecastView .forecast-legend em {
  color: var(--muted);
  font-style: normal;
  font-weight: 850;
}

#forecastView .forecast-summary-table table {
  width: 100%;
}

#forecastView .forecast-summary-table th,
#forecastView .forecast-summary-table td {
  white-space: nowrap;
}

#forecastView .forecast-insight-list {
  display: grid;
  gap: 12px;
}

#forecastView .forecast-insight-list article {
  padding: 14px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--control) 82%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.44);
}

#forecastView .forecast-insight-list span,
#forecastView .forecast-insight-list small {
  display: block;
  color: var(--muted);
}

#forecastView .forecast-insight-list strong {
  display: block;
  color: var(--brand);
  font-size: 1.35rem;
  line-height: 1.2;
  margin: 3px 0;
}

.theme-dark #forecastView .forecast-analytics-card,
.theme-dark #forecastView .forecast-filter-panel {
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* AI Forecast */
.ai-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--muted);
}

.ai-stats span {
  white-space: nowrap;
}

.seasonal-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 0;
}

.seasonal-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.seasonal-month {
  width: 36px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-align: right;
}

.seasonal-bar-wrap {
  flex: 1;
  height: 20px;
  background: rgba(255,255,255,.04);
  border-radius: 6px;
  overflow: hidden;
}

.seasonal-bar.up .seasonal-fill {
  height: 100%;
  background: linear-gradient(90deg, #52d6a3, #3cb88a);
  border-radius: 6px;
}

.seasonal-bar.down .seasonal-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff6b6b, #e05555);
  border-radius: 6px;
  margin-left: auto;
}

.seasonal-num {
  width: 48px;
  font-size: 0.76rem;
  font-weight: 700;
  text-align: right;
  color: var(--muted);
}

.seasonal-tag {
  font-size: 0.85rem;
}

.growth-pill.success {
  background: rgba(82, 214, 163, 0.15);
  border-color: #52d6a3;
  color: #52d6a3;
}

@media (max-width: 1100px) {
  #forecastView .forecast-analytics-grid,
  #forecastView .forecast-filter-grid,
  #forecastView .forecast-pie-chart {
    grid-template-columns: 1fr;
  }
}

.approval-list {
  display: grid;
  gap: 12px;
}

.approval-card {
  align-items: center;
  background: linear-gradient(135deg, rgba(11, 31, 58, 0.08), rgba(202, 168, 92, 0.12));
  border: 1px solid rgba(202, 168, 92, 0.28);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  padding: 14px;
}

.approval-card strong,
.approval-card p {
  display: block;
  margin: 4px 0 0;
}

.approval-amount {
  display: grid;
  gap: 4px;
  text-align: right;
}

.approval-amount b {
  color: var(--gold);
}

.approval-actions {
  justify-content: flex-end;
}

@media (max-width: 760px) {
  .approval-card {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .approval-amount {
    text-align: left;
  }
}

.top-notification-host {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  display: grid;
  gap: 10px;
  width: min(420px, calc(100vw - 32px));
  pointer-events: none;
}

.top-admin-notification {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 12px 14px;
  border: 1px solid rgba(215, 174, 99, 0.32);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(13, 33, 64, 0.98), rgba(7, 21, 45, 0.98));
  color: var(--text);
  box-shadow: 0 18px 44px rgba(2, 8, 20, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  opacity: 0;
  transform: translateY(-24px) scale(0.98);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: auto;
}

.top-admin-notification.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.top-admin-notification.is-leaving {
  opacity: 0;
  transform: translateY(-18px) scale(0.98);
}

.top-admin-notification-body,
.top-admin-notification-close {
  border: 0;
  background: transparent;
  color: inherit;
}

.top-admin-notification-body {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.top-admin-notification-body strong {
  color: var(--brand);
  font-size: 14px;
}

.top-admin-notification-body small {
  color: var(--muted);
}

.top-admin-notification-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  color: var(--brand);
  cursor: pointer;
}

.top-admin-notification-close:hover {
  background: rgba(255, 255, 255, 0.08);
}