
/* =====================================
   PROFIT PILOT - DESIGN SYSTEM
   ===================================== */

:root {
  color-scheme: light;

  --bg: #F4F7F5;
  --surface: #FFFFFF;
  --surface-soft: #EAF3EF;

  --text: #182A25;
  --muted: #71827A;

  --primary: #0F766E;
  --primary-hover: #0A5C55;
  --primary-text: #FFFFFF;

  --border: #E2EAE5;
  --shadow: 0 12px 35px rgba(18, 57, 44, .05);

  --radius: 16px;
}

/* DARK THEME */

html[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0D1915;
  --surface: #16251F;
  --surface-soft: #20362C;

  --text: #ECF6F0;
  --muted: #A5B8AD;

  --primary: #43C7AA;
  --primary-hover: #65D9BD;
  --primary-text: #09251C;

  --border: #2B4437;
  --shadow: 0 12px 35px rgba(0, 0, 0, .12);
}

/* GLOBAL */

* {
  box-sizing: border-box;
}

html {
  font-family: "Segoe UI", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

button {
  font: inherit;
  cursor: pointer;
}

button:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, p {
  margin-top: 0;
}

/* =====================================
   SIDEBAR
   ===================================== */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 245px;
  padding: 28px 16px;

  background: var(--surface);
  border-right: 1px solid var(--border);

  display: flex;
  flex-direction: column;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 8px;
  margin-bottom: 48px;
}

.brand-logo {
  width: 46px;
  height: 46px;
  border-radius: 14px;

  display: grid;
  place-items: center;

  background: #0F766E;
  color: #FFFFFF;
  flex-shrink: 0;
}

.brand-logo svg {
  width: 37px;
  height: 37px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.brand-copy strong {
  font-size: 17px;
  letter-spacing: -.4px;
}

.brand-copy span {
  font-size: 12px;
  color: var(--muted);
}

.sidebar-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--muted);
  padding: 0 14px;
  margin-bottom: 15px;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 13px;

  width: 100%;
  min-height: 48px;
  padding: 0 14px;

  background: transparent;
  border: 0;
  border-radius: 12px;

  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-align: left;

  transition: background .2s, color .2s;
}

.nav-btn:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.nav-btn.is-active {
  background: var(--surface-soft);
  color: var(--primary);
  font-weight: 700;
}

.nav-icon {
  width: 23px;
  font-size: 24px;
  line-height: 1;
  text-align: center;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 13px 0;
  border-top: 1px solid var(--border);

  display: flex;
  flex-direction: column;
  gap: 5px;

  color: var(--muted);
  font-size: 12px;
}

.sidebar-footer small {
  font-size: 11px;
}

/* =====================================
   MAIN CONTENT
   ===================================== */

.main {
  margin-left: 245px;
  min-height: 100vh;
  padding: 28px 36px;
}

.main-inner {
  max-width: 1160px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;

  padding-bottom: 30px;
  border-bottom: 1px solid var(--border);
}

.topbar-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.topbar-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--primary);
}

.topbar-subtitle {
  font-size: 13px;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  gap: 9px;
}

.icon-button {
  width: 42px;
  height: 42px;

  display: grid;
  place-items: center;

  border: 1px solid var(--border);
  border-radius: 12px;

  background: var(--surface);
  color: var(--text);
  font-size: 22px;
}

.icon-button:hover {
  background: var(--surface-soft);
}

.page-header {
  margin: 34px 0 25px;
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.3px;
}

.page-header h1 {
  margin-bottom: 10px;
  font-size: clamp(26px, 3vw, 34px);
  letter-spacing: -1px;
}

.page-header > p:last-child {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

/* =====================================
   DASHBOARD
   ===================================== */

.page-content {
  display: flex;
  flex-direction: column;
  gap: 23px;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;

  min-height: 220px;
  padding: 30px;

  border-radius: 20px;
  background: linear-gradient(125deg, #0F766E, #10443D);
  color: #FFFFFF;
  overflow: hidden;
}

.hero-copy {
  max-width: 490px;
}

.hero-label {
  font-size: 11px;
  letter-spacing: 1.3px;
  font-weight: 700;
  opacity: .8;
}

.hero h2 {
  margin: 14px 0 10px;
  font-size: clamp(24px, 3vw, 32px);
  letter-spacing: -.7px;
}

.hero p {
  font-size: 14px;
  line-height: 1.7;
  opacity: .85;
}

.primary-button {
  margin-top: 10px;
  padding: 12px 18px;

  border: none;
  border-radius: 11px;
  background: #FFFFFF;
  color: #105D54;

  font-weight: 700;
  font-size: 13px;
}

.primary-button:hover {
  background: #E7F4EE;
}

.hero-decoration {
  width: 160px;
  height: 160px;
  flex-shrink: 0;

  display: grid;
  place-items: center;

  border: 2px solid rgba(255,255,255,.18);
  border-radius: 50%;

  font-size: 55px;
  font-weight: 800;
  opacity: .65;
  transform: rotate(-12deg);
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.section-title h2 {
  margin: 0;
  font-size: 17px;
}

.section-title span {
  color: var(--muted);
  font-size: 12px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
}

.stat-card,
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stat-card {
  padding: 22px;
  min-width: 0;
}

.stat-card .stat-label {
  display: block;
  margin-bottom: 17px;
  color: var(--muted);
  font-size: 12px;
}

.stat-card strong {
  display: block;
  font-size: clamp(21px, 2vw, 27px);
  letter-spacing: -.7px;
  overflow-wrap: anywhere;
}

.stat-card small {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.panel {
  padding: 25px;
}

.panel h3 {
  margin-bottom: 12px;
  font-size: 16px;
}

.panel p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.empty-state {
  min-height: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 35px;
}

.empty-symbol {
  display: grid;
  place-items: center;

  width: 65px;
  height: 65px;
  margin-bottom: 20px;

  background: var(--surface-soft);
  color: var(--primary);
  border-radius: 20px;
  font-size: 30px;
}

.empty-state p {
  max-width: 430px;
}

.main-footer {
  margin-top: 45px;
  padding: 20px 0;
  border-top: 1px solid var(--border);

  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

/* =====================================
   TABLET
   ===================================== */

@media (max-width: 1100px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .main {
    padding: 25px;
  }
}

/* =====================================
   MOBILE
   ===================================== */

@media (max-width: 850px) {

  .sidebar {
    inset: auto 0 0 0;
    width: 100%;
    height: auto;

    padding: 8px 7px calc(8px + env(safe-area-inset-bottom));

    border-right: 0;
    border-top: 1px solid var(--border);
    box-shadow: 0 -5px 25px rgba(0,0,0,.05);
  }

  .brand,
  .sidebar-label,
  .sidebar-footer {
    display: none;
  }

  .nav-list {
    flex-direction: row;
    justify-content: space-around;
    gap: 2px;
  }

  .nav-btn {
    flex: 1;
    min-width: 0;
    min-height: 53px;
    padding: 6px 2px;

    flex-direction: column;
    justify-content: center;
    gap: 5px;

    font-size: 10px;
    text-align: center;
    border-radius: 11px;
  }

  .nav-icon {
    font-size: 22px;
  }

  .nav-btn[data-page="pengaturan"] {
    display: none;
  }

  .main {
    margin-left: 0;
    padding: 20px 18px calc(112px + env(safe-area-inset-bottom));
  }

  .topbar {
    padding-bottom: 22px;
  }

  .page-header {
    margin-top: 28px;
  }

  .hero {
    padding: 25px;
  }

  .hero-decoration {
    display: none;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {

  .topbar-kicker {
    font-size: 9px;
  }

  .topbar-subtitle {
    font-size: 11px;
  }

  .icon-button {
    width: 37px;
    height: 37px;
  }

  .stats-grid {
    gap: 10px;
  }

  .stat-card {
    padding: 16px;
  }

  .stat-card strong {
    font-size: 21px;
  }

  .hero h2 {
    font-size: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* =====================================
   SETTINGS & STORAGE UI
   ===================================== */

.settings-intro {
  margin: 12px 0 25px !important;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 650px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.form-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.form-field input,
.form-field textarea,
.readonly-field {
  width: 100%;
  padding: 13px 15px;

  border: 1px solid var(--border);
  border-radius: 11px;

  background: var(--bg);
  color: var(--text);

  font: inherit;
  font-size: 14px;
  line-height: 1.5;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  border-color: transparent;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: var(--muted);
  opacity: .75;
}

.form-field textarea {
  resize: vertical;
  min-height: 100px;
}

.form-field small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.readonly-field {
  color: var(--muted);
  cursor: not-allowed;
}

.form-actions {
  display: flex;
  justify-content: flex-start;
}

.save-button {
  padding: 13px 21px;
  min-height: 45px;

  border: 0;
  border-radius: 11px;

  background: var(--primary);
  color: var(--primary-text);

  font-size: 13px;
  font-weight: 700;

  transition: background .2s;
}

.save-button:hover {
  background: var(--primary-hover);
}

.save-button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.form-feedback {
  margin: -10px 0 0;
  font-size: 12px;
  line-height: 1.6;
}

.form-feedback:empty {
  display: none;
}

.form-feedback[data-status="success"] {
  color: var(--primary);
}

.form-feedback[data-status="error"] {
  color: #DC6464;
}

/* STORAGE INFORMATION */

.storage-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.storage-detail {
  display: flex;
  flex-direction: column;
  gap: 10px;

  min-width: 0;
  padding: 18px;

  border: 1px solid var(--border);
  border-radius: 12px;

  background: var(--bg);
}

.storage-detail span {
  color: var(--muted);
  font-size: 12px;
}

.storage-detail strong {
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.storage-status {
  margin-top: 22px;
  padding: 14px 16px;

  border-radius: 11px;
  background: var(--surface-soft);

  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.7;
}

.storage-status[data-status="error"] {
  background: var(--bg);
  color: #DC6464;
  border: 1px solid #DC6464;
}

.storage-note {
  margin: 15px 0 0 !important;
  color: var(--muted);
  font-size: 12px !important;
  line-height: 1.8;
}

/* SETTINGS ON SMALL SCREENS */

@media (max-width: 420px) {

  .settings-form {
    gap: 19px;
  }

  .storage-details {
    gap: 9px;
  }

  .storage-detail {
    padding: 13px;
  }

  .storage-detail strong {
    font-size: 16px;
  }

  .save-button {
    width: 100%;
  }

}

/* =====================================
   PRODUCT & SERVICE MANAGER
   ===================================== */

.catalog-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.catalog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.catalog-head h2 {
  font-size: 18px;
  margin: 0 0 8px;
}

.catalog-head p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}

.catalog-head .save-button {
  flex-shrink: 0;
}

.catalog-editor[hidden] {
  display: none !important;
}

/* FORM */

.catalog-form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 25px;
}

.catalog-form-head h3 {
  font-size: 17px;
  margin: 0;
}

.catalog-close {
  width: 34px;
  height: 34px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--muted);
  font-size: 24px;
}

.catalog-basic {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 15px;
}

.catalog-page input,
.catalog-page select {
  width: 100%;
  min-width: 0;
  min-height: 44px;

  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 13px;

  background: var(--bg);
  color: var(--text);

  font-family: inherit;
  font-size: 13px;
}

.catalog-page input:focus,
.catalog-page select:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  border-color: transparent;
}

.catalog-page input::placeholder {
  color: var(--muted);
  opacity: .75;
}

.catalog-page input[type="search"] {
  appearance: none;
}

/* COLLAPSIBLE EXTRA DETAILS */

.catalog-extra {
  margin-top: 24px;
  padding: 15px;

  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
}

.catalog-extra summary {
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.catalog-extra-content {
  padding-top: 24px;
}

.catalog-extra-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}

.catalog-cost-head {
  margin-top: 28px;
  margin-bottom: 14px;
}

.catalog-cost-head h4 {
  margin: 0 0 7px;
  font-size: 14px;
}

.catalog-cost-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.catalog-cost-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.catalog-cost-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 34px;
  gap: 8px;
  align-items: center;
}

.catalog-remove-cost {
  width: 34px;
  height: 42px;

  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);

  color: #DC6464;
  font-size: 22px;
}

.catalog-ghost-button {
  margin-top: 14px;
  padding: 11px 14px;

  background: var(--surface);
  color: var(--primary);

  border: 1px solid var(--border);
  border-radius: 10px;

  font-size: 12px;
  font-weight: 700;
}

.catalog-ghost-button:hover {
  background: var(--surface-soft);
}

.catalog-help {
  margin: 12px 0 0 !important;
  color: var(--muted);
  font-size: 11px !important;
  line-height: 1.7;
}

.catalog-form-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-top: 25px;
}

.catalog-form-bottom .form-feedback {
  margin: 0;
}

/* CATALOG LIST */

.catalog-library {
  padding: 20px;
}

.catalog-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px;
  gap: 12px;
}

.catalog-summary {
  color: var(--muted);
  margin: 18px 0 12px !important;
  font-size: 12px !important;
}

.catalog-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.catalog-item {
  padding: 18px;

  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--bg);
}

.catalog-item-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.catalog-item-copy {
  min-width: 0;
}

.catalog-kind {
  display: inline-block;
  padding: 5px 9px;

  background: var(--surface-soft);
  color: var(--primary);
  border-radius: 6px;

  font-size: 10px;
  font-weight: 700;
}

.catalog-item-name {
  margin: 11px 0 7px;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.catalog-item-meta {
  color: var(--muted);
  font-size: 11px !important;
  line-height: 1.6 !important;
  margin: 0 !important;
  overflow-wrap: anywhere;
}

.catalog-item-price {
  color: var(--primary);
  font-size: 17px;
  font-weight: 800;
  white-space: nowrap;
}

.catalog-item-actions {
  display: flex;
  gap: 9px;

  margin-top: 16px;
  padding-top: 13px;
  border-top: 1px solid var(--border);
}

.catalog-item-actions button {
  padding: 7px 12px;

  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;

  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.catalog-item-actions button:hover {
  background: var(--surface-soft);
}

.catalog-item-actions .catalog-delete {
  color: #DC6464;
}

.catalog-empty {
  padding: 50px 16px;
  text-align: center;

  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.catalog-notice {
  margin: 0 !important;
  font-size: 12px !important;
  line-height: 1.6;
  color: var(--primary);
}

.catalog-notice:empty {
  display: none;
}

.catalog-notice[data-status="error"] {
  color: #DC6464;
}

/* =====================================
   RESPONSIVE CATALOG
   ===================================== */

@media (max-width: 1100px) {

  .catalog-basic {
    grid-template-columns: 1fr 1fr;
  }

  .catalog-basic .form-field:first-child {
    grid-column: 1 / -1;
  }

}

@media (max-width: 600px) {

  .catalog-head {
    align-items: flex-start;
  }

  .catalog-head p {
    max-width: 210px;
  }

  .catalog-basic,
  .catalog-extra-grid {
    grid-template-columns: 1fr;
  }

  .catalog-basic .form-field:first-child {
    grid-column: auto;
  }

  .catalog-cost-row {
    grid-template-columns: 1fr 1fr 34px;
  }

  .catalog-cost-row [data-cost-name] {
    grid-column: 1 / -1;
  }

  .catalog-cost-row [data-cost-amount] {
    grid-column: 1;
  }

  .catalog-cost-row [data-cost-mode] {
    grid-column: 2;
  }

  .catalog-remove-cost {
    grid-column: 3;
    grid-row: 2;
  }

  .catalog-toolbar {
    grid-template-columns: 1fr 105px;
    gap: 8px;
  }

  .catalog-editor,
  .catalog-library {
    padding: 17px;
  }

  .catalog-item-main {
    flex-direction: column;
    gap: 12px;
  }

  .catalog-item-price {
    font-size: 17px;
  }

  .catalog-form-bottom {
    flex-direction: column;
    align-items: stretch;
  }

  .catalog-form-bottom .save-button {
    width: 100%;
  }

}

/* =====================================
   PROFIT PILOT - HPP CALCULATOR
   ===================================== */

.hpp-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hpp-panel,
.hpp-results {
  min-width: 0;
}

/* HEADER */

.hpp-heading,
.hpp-result-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.hpp-heading h2,
.hpp-result-heading h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.hpp-heading p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

.hpp-label {
  padding: 6px 10px;
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
}

/* INPUTS */

.hpp-controls {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 15px;
  margin-top: 25px;
}

.hpp-page input,
.hpp-page select {
  width: 100%;
  min-width: 0;
  min-height: 44px;

  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;

  background: var(--bg);
  color: var(--text);

  font-family: inherit;
  font-size: 13px;
}

.hpp-page input:focus,
.hpp-page select:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  border-color: transparent;
}

.hpp-page input::placeholder {
  color: var(--muted);
}

.hpp-source-note {
  margin: 12px 0 0 !important;
  color: var(--muted);
  font-size: 12px !important;
  line-height: 1.6;
}

/* COST SECTION */

.hpp-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  margin-top: 28px;
  margin-bottom: 16px;
}

.hpp-section-heading h3 {
  font-size: 15px;
  margin: 0 0 6px;
}

.hpp-section-heading p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

.hpp-section-heading button {
  margin-top: 0;
  flex-shrink: 0;
}

.hpp-cost-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hpp-cost-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.1fr 36px;
  align-items: center;
  gap: 8px;
}

.hpp-remove-cost {
  width: 36px;
  height: 44px;
  padding: 0;

  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;

  color: #DC6464;
  font-size: 23px;
}

.hpp-empty {
  padding: 18px;
  margin: 0 !important;

  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: 11px;

  color: var(--muted);
  text-align: center;
  font-size: 12px !important;
  line-height: 1.8;
}

.hpp-empty[hidden] {
  display: none;
}

.hpp-feedback {
  margin: 15px 0 0 !important;
  font-size: 12px !important;
  color: var(--primary);
  line-height: 1.6;
}

.hpp-feedback[data-status="error"] {
  color: #DC6464;
}

/* CALCULATION RESULTS */

.hpp-result-heading {
  margin-bottom: 22px;
}

.hpp-result-heading span {
  font-size: 12px;
  color: var(--muted);
}

.hpp-primary-result {
  display: flex;
  flex-direction: column;
  gap: 10px;

  padding: 24px;

  background: var(--surface-soft);
  border-radius: 14px;
}

.hpp-primary-result > span {
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
}

.hpp-primary-result strong {
  font-size: clamp(27px, 4vw, 38px);
  letter-spacing: -1px;
  color: var(--primary);
  overflow-wrap: anywhere;
}

.hpp-primary-result small {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
}

.hpp-result-list {
  display: flex;
  flex-direction: column;
  gap: 17px;
  margin-top: 25px;
}

.hpp-result-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.hpp-result-line span {
  color: var(--muted);
  font-size: 13px;
}

.hpp-result-line strong {
  color: var(--text);
  font-size: 14px;
  text-align: right;
  overflow-wrap: anywhere;
}

.hpp-result-total {
  margin-top: 7px;
  padding-top: 21px;
  border-top: 1px solid var(--border);
}

.hpp-result-total span,
.hpp-result-total strong {
  font-weight: 800;
  color: var(--primary);
}

.hpp-explanation {
  margin-top: 27px;
  padding: 17px;

  border: 1px solid var(--border);
  border-radius: 12px;

  background: var(--bg);
}

.hpp-explanation strong {
  display: block;
  margin-bottom: 12px;
  font-size: 12px;
}

.hpp-explanation p {
  font-size: 12px;
  line-height: 1.8;
  margin: 0 0 7px;
  color: var(--muted);
}

.hpp-explanation p:last-child {
  margin-bottom: 0;
}

.hpp-disclaimer {
  margin: 0 !important;
  padding: 0 5px;

  color: var(--muted);
  font-size: 11px !important;
  line-height: 1.8;
}

/* =====================================
   RESPONSIVE
   ===================================== */

@media (max-width: 650px) {

  .hpp-controls {
    grid-template-columns: 1fr;
  }

  .hpp-section-heading {
    align-items: flex-start;
  }

  .hpp-section-heading button {
    font-size: 11px;
    padding: 10px;
  }

  .hpp-cost-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 36px;
  }

  .hpp-cost-row [data-cost-name] {
    grid-column: 1 / -1;
  }

  .hpp-cost-row [data-cost-amount] {
    grid-column: 1;
  }

  .hpp-cost-row [data-cost-mode] {
    grid-column: 2;
  }

  .hpp-remove-cost {
    grid-column: 3;
    grid-row: 2;
  }

  .hpp-primary-result {
    padding: 20px;
  }

  .hpp-result-line span {
    font-size: 12px;
  }

  .hpp-result-line strong {
    font-size: 13px;
  }

}

/* =====================================
   PROFIT PILOT - PRICING & PROFIT
   ===================================== */

.pricing-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.pricing-panel,
.pricing-results {
  min-width: 0;
}

/* HEADER */

.pricing-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 25px;
}

.pricing-heading h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.pricing-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.pricing-live {
  padding: 6px 10px;
  border-radius: 7px;

  background: var(--surface-soft);
  color: var(--primary);

  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
}

/* SIMPLE FORM */

.pricing-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.pricing-full {
  grid-column: 1 / -1;
}

.pricing-page input,
.pricing-page select {
  width: 100%;
  min-width: 0;
  min-height: 45px;

  padding: 12px 14px;

  background: var(--bg);
  color: var(--text);

  border: 1px solid var(--border);
  border-radius: 10px;

  font: inherit;
  font-size: 13px;
}

.pricing-page input:focus,
.pricing-page select:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  border-color: transparent;
}

.pricing-page input::placeholder {
  color: var(--muted);
  opacity: .8;
}

.pricing-page input[readonly] {
  background: var(--surface-soft);
  color: var(--primary);
  font-weight: 700;
  cursor: default;
}

.pricing-source {
  margin: 15px 0 0 !important;
  color: var(--muted);
  font-size: 12px !important;
  line-height: 1.7;
}

/* ADVANCED OPTIONS */

.pricing-extra {
  margin-top: 25px;
  padding: 17px;

  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.pricing-extra summary {
  cursor: pointer;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}

.pricing-extra-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px;

  margin-top: 23px;
}

.pricing-helper {
  margin: 20px 0 0 !important;
  color: var(--muted);
  font-size: 12px !important;
  line-height: 1.8;
}

.pricing-feedback {
  margin: 17px 0 0 !important;
  color: var(--primary);
  font-size: 12px !important;
  line-height: 1.7;
}

.pricing-feedback[data-status="error"] {
  color: #DC6464;
}

/* RECOMMENDED PRICE */

.pricing-recommendation {
  display: flex;
  flex-direction: column;
  gap: 12px;

  padding: 25px;

  background: var(--surface-soft);
  border-radius: 15px;
}

.pricing-recommendation > span {
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}

.pricing-recommendation strong {
  color: var(--primary);
  font-size: clamp(28px, 4vw, 38px);
  letter-spacing: -1px;
  overflow-wrap: anywhere;
}

.pricing-recommendation small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

/* PROFIT METRICS */

.pricing-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;

  margin-top: 22px;
}

.pricing-metric {
  display: flex;
  flex-direction: column;
  gap: 12px;

  min-width: 0;
  padding: 18px;

  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.pricing-metric span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.pricing-metric strong {
  color: var(--text);
  font-size: clamp(17px, 2vw, 21px);
  overflow-wrap: anywhere;
}

/* PROFIT STATUS */

.pricing-status {
  margin: 20px 0 0 !important;
  padding: 13px 15px;

  background: var(--bg);
  border-radius: 10px;

  color: var(--muted);
  font-size: 12px !important;
  line-height: 1.7;
}

.pricing-status:empty {
  display: none;
}

.pricing-status[data-status="profit"] {
  color: var(--primary);
  background: var(--surface-soft);
}

.pricing-status[data-status="loss"] {
  color: #DC6464;
  border: 1px solid #DC6464;
}

/* INFORMATION */

.pricing-info {
  padding: 20px;

  border: 1px solid var(--border);
  border-radius: 13px;

  background: var(--surface);
}

.pricing-info strong {
  display: block;
  margin-bottom: 12px;
  font-size: 13px;
}

.pricing-info p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.pricing-info p:last-child {
  margin-bottom: 0;
}

/* =====================================
   RESPONSIVE
   ===================================== */

@media (max-width: 650px) {

  .pricing-form,
  .pricing-extra-grid {
    grid-template-columns: 1fr;
  }

  .pricing-full {
    grid-column: auto;
  }

  .pricing-metrics {
    gap: 10px;
  }

  .pricing-metric {
    padding: 14px;
  }

  .pricing-metric strong {
    font-size: 17px;
  }

  .pricing-recommendation {
    padding: 20px;
  }

}

@media (max-width: 380px) {

  .pricing-metrics {
    grid-template-columns: 1fr;
  }

}
/* MOBILE BOTTOM NAVIGATION - 6 ITEMS */

@media (max-width: 850px) {

  .nav-btn {
    padding-left: 1px;
    padding-right: 1px;
  }

  .nav-text {
    font-size: 9px;
    white-space: nowrap;
  }

  .nav-icon {
    font-size: 20px;
  }

}

/* =====================================
   PROFIT PILOT - SALES MANAGER
   ===================================== */

.sales-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sales-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.sales-header h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.sales-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.sales-header .save-button {
  flex-shrink: 0;
}

.sales-notice {
  margin: 0 !important;
  font-size: 12px !important;
  color: var(--primary);
}

.sales-notice:empty {
  display: none;
}

.sales-notice[data-status="error"] {
  color: #DC6464;
}

/* =====================================
   SALES FORM
   ===================================== */

.sales-editor[hidden],
.sales-manual-field[hidden],
.sales-cost-field[hidden] {
  display: none !important;
}

.sales-form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 25px;
}

.sales-form-header h3 {
  margin: 0;
  font-size: 17px;
}

#salesForm {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sales-page input,
.sales-page select,
.sales-page textarea {
  width: 100%;
  min-width: 0;

  padding: 12px 14px;
  min-height: 44px;

  background: var(--bg);
  color: var(--text);

  border: 1px solid var(--border);
  border-radius: 10px;

  font: inherit;
  font-size: 13px;
}

.sales-page input:focus,
.sales-page select:focus,
.sales-page textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  border-color: transparent;
}

.sales-page input::placeholder,
.sales-page textarea::placeholder {
  color: var(--muted);
  opacity: .8;
}

.sales-page textarea {
  resize: vertical;
}

.sales-input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.sales-source-note {
  margin: -7px 0 0 !important;
  color: var(--muted);
  font-size: 12px !important;
  line-height: 1.7;
}

/* OPTIONAL TRANSACTION FIELDS */

.sales-extra {
  padding: 16px;

  border: 1px solid var(--border);
  border-radius: 12px;

  background: var(--bg);
}

.sales-extra summary {
  cursor: pointer;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}

.sales-extra-content {
  display: flex;
  flex-direction: column;
  gap: 17px;
  padding-top: 22px;
}

.sales-extra-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

/* LIVE TRANSACTION PREVIEW */

.sales-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.sales-preview > div {
  display: flex;
  flex-direction: column;
  gap: 12px;

  padding: 20px;

  background: var(--surface-soft);
  border-radius: 12px;
}

.sales-preview span {
  color: var(--muted);
  font-size: 12px;
}

.sales-preview strong {
  color: var(--primary);
  font-size: clamp(20px, 2.5vw, 25px);
  overflow-wrap: anywhere;
}

.sales-preview strong[data-status="loss"] {
  color: #DC6464;
}

.sales-preview-note {
  color: var(--muted);
  font-size: 11px !important;
  line-height: 1.7;
  margin: 0 !important;
}

.sales-submit {
  width: 100%;
}

#salesFeedback {
  margin: 0;
}

/* =====================================
   SALES DASHBOARD
   ===================================== */

.sales-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.sales-stats .stat-card {
  padding: 20px;
}

.sales-stats .stat-card strong {
  font-size: clamp(19px, 2.4vw, 25px);
}

/* =====================================
   SALES HISTORY
   ===================================== */

.sales-history-header h3 {
  margin: 0 0 18px;
  font-size: 16px;
}

.sales-list-summary {
  color: var(--muted);
  font-size: 12px !important;
  margin: 17px 0 12px !important;
}

#salesList {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.sales-item {
  padding: 18px;

  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
}

.sales-item-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 15px;
}

.sales-item-info,
.sales-item-money {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.sales-item-name {
  font-size: 14px;
  color: var(--text);
  overflow-wrap: anywhere;
}

.sales-item-meta {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
}

.sales-item-money {
  text-align: right;
  flex-shrink: 0;
}

.sales-item-revenue {
  font-size: 16px;
  color: var(--text);
}

.sales-item-profit {
  font-size: 12px;
  color: var(--primary);
}

.sales-item-profit[data-status="loss"] {
  color: #DC6464;
}

.sales-item-actions {
  display: flex;
  gap: 9px;

  margin-top: 15px;
  padding-top: 12px;

  border-top: 1px solid var(--border);
}

.sales-item-actions button {
  padding: 8px 13px;

  background: var(--surface);
  color: var(--text);

  border: 1px solid var(--border);
  border-radius: 8px;

  font-size: 12px;
  font-weight: 600;
}

.sales-item-actions button:hover {
  background: var(--surface-soft);
}

.sales-item-actions .sales-delete {
  color: #DC6464;
}

/* =====================================
   MOBILE RESPONSIVE
   ===================================== */

@media (max-width: 850px) {

  .sales-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sales-stats .stat-card:last-child {
    grid-column: 1 / -1;
  }

}

@media (max-width: 600px) {

  .sales-extra-grid {
    grid-template-columns: 1fr;
  }

  .sales-item-main {
    flex-direction: column;
    gap: 13px;
  }

  .sales-item-money {
    text-align: left;
  }

  .sales-preview > div {
    padding: 15px;
  }

  .sales-preview strong {
    font-size: 19px;
  }

}

@media (max-width: 390px) {

  .sales-input-grid {
    grid-template-columns: 1fr;
  }

  .sales-stats {
    gap: 10px;
  }

  .sales-stats .stat-card {
    padding: 15px;
  }

}

/* =====================================
   PROFIT PILOT - REPORTS & DASHBOARD
   ===================================== */

.report-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.report-page .panel,
.report-dashboard-grid .panel {
  min-width: 0;
}

.report-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 22px;
}

.report-section-head h2,
.report-section-head h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.report-section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.report-section-head > span {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

/* =====================================
   DASHBOARD CHART
   ===================================== */

.report-dashboard-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 16px;
}

.report-chart {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 9px;

  min-height: 205px;
  width: 100%;
}

.report-chart-column {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 9px;
}

.report-chart-track {
  width: 100%;
  height: 170px;
  min-width: 0;

  display: flex;
  align-items: flex-end;
  justify-content: center;

  background: var(--bg);
  border-radius: 8px;
  overflow: hidden;
}

.report-chart-bar {
  width: 100%;
  max-width: 42px;
  min-height: 0;

  background: var(--primary);
  border-radius: 7px 7px 0 0;

  transition: height .2s ease;
}

.report-chart-column > span {
  color: var(--muted);
  font-size: 10px;
  text-align: center;
  white-space: nowrap;
}

.report-mini-note,
.report-footnote {
  margin: 12px 0 0 !important;
  color: var(--muted);
  font-size: 11px !important;
  line-height: 1.8;
}

.report-recent-list {
  display: flex;
  flex-direction: column;
  gap: 0;

  color: var(--muted);
  font-size: 12px;
}

.report-recent-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.report-recent-row:last-child {
  border-bottom: none;
}

.report-recent-name {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.report-recent-name strong {
  color: var(--text);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.report-recent-name small {
  color: var(--muted);
  font-size: 11px;
}

.report-recent-row > strong {
  font-size: 12px;
  color: var(--primary);
  text-align: right;
  overflow-wrap: anywhere;
}

/* =====================================
   REPORT PERIOD FILTER
   ===================================== */

.report-period-row {
  display: flex;
  align-items: end;
  gap: 14px;
}

.report-period-row > .form-field {
  min-width: 170px;
}

.report-custom-range {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  flex: 1;
}

.report-custom-range[hidden],
.report-expense-editor[hidden] {
  display: none !important;
}

.report-page input,
.report-page select {
  width: 100%;
  min-width: 0;
  min-height: 44px;

  padding: 11px 13px;

  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;

  font: inherit;
  font-size: 13px;
}

.report-page input:focus,
.report-page select:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  border-color: transparent;
}

.report-page input::placeholder {
  color: var(--muted);
}

.report-notice {
  margin: 12px 0 0 !important;
  color: var(--primary);
  font-size: 12px !important;
  line-height: 1.7;
}

.report-notice:empty {
  display: none;
}

/* =====================================
   REPORT KPI CARDS
   ===================================== */

.report-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.report-kpi-grid .stat-card {
  min-width: 0;
  padding: 19px;
}

.report-kpi-grid .stat-card strong {
  font-size: clamp(19px, 2.2vw, 25px);
}

#dashboardProfit[data-status="loss"],
#reportProfit[data-status="loss"],
#breakProfit[data-status="loss"] {
  color: #DC6464;
}

/* =====================================
   REPORT BREAKDOWN
   ===================================== */

.report-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.report-breakdown > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;

  padding: 15px 0;
  border-bottom: 1px solid var(--border);
}

.report-breakdown > div:last-child {
  border-bottom: none;
}

.report-breakdown span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.report-breakdown strong {
  color: var(--text);
  font-size: 14px;
  text-align: right;
  overflow-wrap: anywhere;
}

.report-breakdown .report-breakdown-total {
  margin-top: 8px;
  padding: 20px 0 5px;
}

.report-breakdown-total span,
.report-breakdown-total strong {
  color: var(--primary);
  font-weight: 800;
}

/* =====================================
   EXPENSE MANAGER
   ===================================== */

.report-expense-panel .save-button {
  flex-shrink: 0;
}

.report-expense-editor {
  display: flex;
  flex-direction: column;
  gap: 18px;

  padding: 22px;
  margin-bottom: 20px;

  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--bg);
}

.report-expense-editor h4 {
  margin: 0;
  font-size: 15px;
}

.report-expense-fields {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 13px;
}

.report-extra {
  padding: 15px;

  border: 1px solid var(--border);
  border-radius: 11px;

  background: var(--surface);
}

.report-extra summary {
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.report-extra-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 20px;
}

.report-full {
  grid-column: 1 / -1;
}

.report-form-actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}

.report-outline-btn {
  min-height: 44px;
  padding: 11px 18px;

  border: 1px solid var(--border);
  border-radius: 11px;

  color: var(--text);
  background: var(--surface);

  font-size: 13px;
  font-weight: 600;
}

.report-outline-btn:hover {
  background: var(--surface-soft);
}

.report-error {
  margin: 0 !important;
  color: #DC6464;
  font-size: 12px !important;
}

.report-error:empty {
  display: none;
}

/* =====================================
   EXPENSE & SALES LIST
   ===================================== */

.report-expense-list {
  display: flex;
  flex-direction: column;
  gap: 0;

  color: var(--muted);
  font-size: 12px;
}

.report-record {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;

  padding: 15px 0;
  border-bottom: 1px solid var(--border);
}

.report-record:last-child {
  border-bottom: none;
}

.report-record-copy {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.report-record-copy strong {
  color: var(--text);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.report-record-copy small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.report-record-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;

  flex-shrink: 0;
}

.report-record-right > strong {
  color: var(--text);
  font-size: 13px;
  text-align: right;
}

.report-record-actions {
  display: flex;
  gap: 7px;
}

.report-record-actions button {
  padding: 6px 10px;

  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;

  color: var(--text);
  font-size: 11px;
  cursor: pointer;
}

.report-record-actions button:last-child {
  color: #DC6464;
}

/* =====================================
   RESPONSIVE
   ===================================== */

@media (max-width: 1100px) {
  .report-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .report-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 650px) {
  .report-period-row {
    flex-direction: column;
    align-items: stretch;
  }

  .report-custom-range,
  .report-expense-fields,
  .report-extra-fields {
    grid-template-columns: 1fr;
  }

  .report-custom-range {
    width: 100%;
  }

  .report-full {
    grid-column: auto;
  }

  .report-expense-editor {
    padding: 16px;
  }

  .report-section-head {
    gap: 10px;
  }

  .report-section-head .save-button {
    padding: 11px 12px;
    font-size: 11px;
  }

  .report-kpi-grid,
  .report-dashboard-grid {
    gap: 10px;
  }

  .report-kpi-grid .stat-card {
    padding: 15px;
  }

  .report-chart {
    gap: 5px;
  }

  .report-chart-column > span {
    font-size: 9px;
  }

  .report-breakdown strong,
  .report-breakdown span {
    font-size: 12px;
  }
}

@media (max-width: 380px) {
  .report-record {
    align-items: flex-start;
  }

  .report-record-right > strong {
    font-size: 12px;
  }
}

/* =====================================
   PROFIT PILOT - CALCULATOR TABS
   ===================================== */

.pilot-tool-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;

  padding: 5px;

  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 13px;
}

.pilot-tool-tabs button {
  min-height: 44px;
  padding: 10px 13px;

  background: transparent;
  color: var(--muted);

  border: 0;
  border-radius: 9px;

  font-size: 13px;
  font-weight: 600;
}

.pilot-tool-tabs button.is-active {
  background: var(--surface-soft);
  color: var(--primary);
}

.pilot-tool-content {
  min-width: 0;
  margin-top: 18px;
}

/* =====================================
   BEP ANALYSIS
   ===================================== */

.bep-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.bep-panel,
.bep-results {
  min-width: 0;
}

.bep-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;

  margin-bottom: 24px;
}

.bep-heading h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.bep-heading p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
}

.bep-live {
  padding: 6px 10px;

  background: var(--surface-soft);
  color: var(--primary);
  border-radius: 7px;

  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
}

/* MAIN FORM */

.bep-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 17px;
}

.bep-full {
  grid-column: 1 / -1;
}

.bep-page input,
.bep-page select {
  width: 100%;
  min-width: 0;
  min-height: 45px;

  padding: 12px 14px;

  background: var(--bg);
  color: var(--text);

  border: 1px solid var(--border);
  border-radius: 10px;

  font: inherit;
  font-size: 13px;
}

.bep-page input:focus,
.bep-page select:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  border-color: transparent;
}

.bep-page input::placeholder {
  color: var(--muted);
}

.bep-page input[readonly] {
  background: var(--surface-soft);
  color: var(--primary);
  font-weight: 700;
}

.bep-source {
  margin: 15px 0 0 !important;

  color: var(--muted);
  font-size: 12px !important;
  line-height: 1.7;
}

/* ADVANCED OPTIONS */

.bep-extra {
  margin-top: 25px;
  padding: 17px;

  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.bep-extra summary {
  cursor: pointer;
  color: var(--primary);

  font-size: 13px;
  font-weight: 700;
}

.bep-extra-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;

  margin-top: 24px;
}

.bep-help {
  margin: 17px 0 0 !important;
  color: var(--muted);

  font-size: 12px !important;
  line-height: 1.8;
}

.bep-feedback {
  margin: 16px 0 0 !important;

  color: var(--primary);
  font-size: 12px !important;
  line-height: 1.7;
}

.bep-feedback[data-status="error"] {
  color: #DC6464;
}

/* MAIN BEP RESULT */

.bep-primary-result {
  display: flex;
  flex-direction: column;
  gap: 11px;

  padding: 25px;

  border-radius: 14px;
  background: var(--surface-soft);
}

.bep-primary-result > span {
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}

.bep-primary-result strong {
  color: var(--primary);

  font-size: clamp(27px, 4vw, 36px);
  letter-spacing: -1px;
  overflow-wrap: anywhere;
}

.bep-primary-result small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

/* BEP METRICS */

.bep-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;

  margin-top: 20px;
}

.bep-metric {
  display: flex;
  flex-direction: column;
  gap: 12px;

  padding: 18px;
  min-width: 0;

  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.bep-metric span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.bep-metric strong {
  color: var(--text);
  font-size: clamp(17px, 2vw, 21px);
  overflow-wrap: anywhere;
}

/* TARGET SIMULATION */

.bep-target-section {
  margin-top: 26px;
  padding-top: 22px;

  border-top: 1px solid var(--border);
}

.bep-target-section h3 {
  margin: 0 0 16px;
  font-size: 15px;
}

.bep-target-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;

  padding: 14px 0;

  border-bottom: 1px solid var(--border);
}

.bep-target-row:last-child {
  border-bottom: none;
}

.bep-target-row span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.bep-target-row strong {
  color: var(--text);
  font-size: 14px;
  text-align: right;
  overflow-wrap: anywhere;
}

#bepForecastProfit[data-status="loss"] {
  color: #DC6464;
}

#bepForecastProfit[data-status="profit"] {
  color: var(--primary);
}

/* ANALYSIS STATUS */

.bep-status {
  margin: 22px 0 0 !important;
  padding: 15px;

  border-radius: 11px;
  background: var(--bg);

  color: var(--muted);
  font-size: 12px !important;
  line-height: 1.8;
}

.bep-status:empty {
  display: none;
}

.bep-status[data-status="profit"] {
  color: var(--primary);
  background: var(--surface-soft);
}

.bep-status[data-status="loss"] {
  color: #DC6464;
  border: 1px solid #DC6464;
}

/* FORMULA EXPLANATION */

.bep-info {
  padding: 20px;

  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 13px;
}

.bep-info h3 {
  margin: 0 0 14px;
  font-size: 14px;
}

.bep-info p {
  margin: 0 0 10px;

  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.bep-info p:last-child {
  margin-bottom: 0;
}

/* =====================================
   MOBILE
   ===================================== */

@media (max-width: 650px) {

  .bep-form-grid,
  .bep-extra-grid {
    grid-template-columns: 1fr;
  }

  .bep-full {
    grid-column: auto;
  }

  .bep-primary-result {
    padding: 20px;
  }

  .bep-metrics {
    gap: 10px;
  }

  .bep-metric {
    padding: 14px;
  }

  .bep-metric strong {
    font-size: 17px;
  }

  .pilot-tool-tabs button {
    font-size: 12px;
  }
}

@media (max-width: 380px) {

  .bep-metrics {
    grid-template-columns: 1fr;
  }

  .pilot-tool-tabs button {
    font-size: 11px;
    padding: 10px 6px;
  }
}

/* =====================================
   PROFIT PILOT - BACKUP & DATA SAFETY
   ===================================== */

.backup-panel {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.backup-header h2 {
  margin: 0 0 10px;
  font-size: 17px;
}

.backup-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

/* BACKUP OPTIONS */

.backup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.backup-option {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 18px;

  min-width: 0;
  padding: 20px;

  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 13px;
}

.backup-option-title {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.backup-option-icon {
  width: 39px;
  height: 39px;
  flex-shrink: 0;

  display: grid;
  place-items: center;

  border-radius: 11px;
  background: var(--surface-soft);
  color: var(--primary);

  font-size: 22px;
  font-weight: 700;
}

.backup-option-title h3 {
  margin: 0 0 7px;
  font-size: 14px;
}

.backup-option-title p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.backup-option .save-button {
  width: 100%;
}

.backup-option .save-button:disabled,
.backup-delete-button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

/* FILE PICKER */

.backup-file-label {
  display: block;
  padding: 12px 15px;

  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;

  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  text-align: center;

  cursor: pointer;
}

.backup-file-label:hover {
  background: var(--surface-soft);
}

.backup-file-input {
  width: 100%;
  min-width: 0;

  color: var(--muted);
  font-size: 11px;
}

.backup-file-input::file-selector-button {
  padding: 8px;
  margin-right: 8px;

  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

/* IMPORT PREVIEW */

.backup-preview {
  display: flex;
  flex-direction: column;
  gap: 9px;

  padding: 16px;

  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
}

.backup-preview[hidden] {
  display: none !important;
}

.backup-preview > strong {
  font-size: 13px;
}

.backup-preview > p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.backup-preview .backup-warning-text {
  margin: 9px 0;
  color: #B77928;
}

html[data-theme="dark"]
.backup-warning-text {
  color: #E5B16E;
}

/* STATUS */

.backup-status {
  margin: 0 !important;
  font-size: 12px !important;
  line-height: 1.7;

  color: var(--primary);
}

.backup-status:empty {
  display: none;
}

.backup-status[data-status="error"] {
  color: #DC6464;
}

.backup-footnote {
  margin: 0 !important;
  color: var(--muted);
  font-size: 11px !important;
  line-height: 1.8;
}

/* CORRUPTED DATA RECOVERY */

.backup-recovery {
  padding: 17px;

  background: var(--bg);
  border: 1px solid #D39B4E;
  border-radius: 12px;
}

.backup-recovery[hidden] {
  display: none !important;
}

.backup-recovery strong {
  font-size: 13px;
  color: var(--text);
}

.backup-recovery p {
  margin: 10px 0 15px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

/* DANGER ZONE */

.backup-danger {
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

.backup-danger summary {
  color: #CA5555;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.backup-danger-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;

  margin-top: 16px;
  padding: 17px;

  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.backup-danger-content p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.backup-danger-content label {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.backup-danger-content input {
  width: 100%;
  max-width: 280px;
  min-height: 44px;

  padding: 12px 14px;

  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;

  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.backup-danger-content input:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.backup-delete-button {
  min-height: 44px;
  padding: 12px 17px;

  background: #BC4141;
  color: #FFFFFF;

  border: 0;
  border-radius: 10px;

  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.backup-delete-button:not(:disabled):hover {
  background: #9F3030;
}

/* MOBILE */

@media (max-width: 650px) {

  .backup-grid {
    grid-template-columns: 1fr;
  }

  .backup-option {
    padding: 17px;
  }

  .backup-danger-content input {
    max-width: 100%;
  }

  .backup-delete-button {
    width: 100%;
  }

}
