@import "tailwindcss";
@source "../**/*.{ts,tsx,js,jsx,mdx}";
@custom-variant dark (&:where(.dark, .dark *));

html,
body {
  height: 100%;
}

body {
  background: #f5f6f8;
  color: #0f172a;
  font-family: "Segoe UI Variable Text", "Segoe UI", Inter, ui-sans-serif, system-ui, sans-serif;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html.dark {
  color-scheme: dark;
}

html.dark body {
  background: #020617;
  color: #e2e8f0;
}

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

html.dark input,
html.dark select,
html.dark textarea {
  border-color: #334155 !important;
  background-color: #0f172a !important;
  color: #f1f5f9 !important;
}

html.dark .bg-white { background-color: #0f172a !important; }
html.dark .bg-slate-50 { background-color: #111c30 !important; }
html.dark .bg-slate-100 { background-color: #020617 !important; }
html.dark .border-slate-100 { border-color: #1e293b !important; }
html.dark .border-slate-200 { border-color: #334155 !important; }
html.dark .border-slate-300 { border-color: #475569 !important; }
html.dark .text-slate-950 { color: #f8fafc !important; }
html.dark .text-slate-700 { color: #cbd5e1 !important; }
html.dark .text-slate-600 { color: #94a3b8 !important; }
html.dark .text-slate-500 { color: #94a3b8 !important; }
html.dark .hover\:bg-slate-50:hover { background-color: #1e293b !important; }
html.dark .hover\:bg-slate-100:hover { background-color: #1e293b !important; }

* {
  scrollbar-width: thin;
  scrollbar-color: rgb(148 163 184) transparent;
}

:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgb(16 185 129 / 0.22);
}

@layer utilities {
  .surface {
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.03), 0 8px 24px rgb(15 23 42 / 0.035);
  }

  .dark .surface {
    border-color: #1e293b;
    background: #0f172a;
    box-shadow: 0 8px 24px rgb(0 0 0 / 0.16);
  }

  .muted-label {
    color: #64748b;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .page-eyebrow {
    color: #059669;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  .page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    min-height: 4.5rem;
  }

  @media (max-width: 767px) {
    .page-header {
      flex-direction: column;
    }

    .page-actions {
      width: 100%;
      justify-content: flex-start;
    }
  }

  .page-description {
    margin-top: 0.45rem;
    max-width: 50rem;
    color: #64748b;
    font-size: 0.8125rem;
    line-height: 1.45rem;
  }

  .page-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
  }

  .scope-toolbar {
    border: 1px solid #dbe3ec;
    border-radius: 0.875rem;
    background: #ffffff;
    padding: 0.9rem;
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.025);
  }

  .control-center-nav {
    display: grid;
    grid-template-columns: minmax(210px, 0.75fr) minmax(0, 1.7fr);
    align-items: center;
    gap: 1rem;
    border: 1px solid #dbe3ec;
    border-radius: 0.875rem;
    background: rgb(255 255 255 / 0.94);
    padding: 0.55rem;
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.025);
  }

  .dark .control-center-nav {
    border-color: #1e293b;
    background: #0f172a;
  }

  .control-center-title {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.45rem 0.6rem;
  }

  .control-center-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.35rem;
  }

  .control-center-tab {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 0.625rem;
    padding: 0.7rem 0.75rem;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1.15;
    transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
  }

  .control-center-tab:hover { border-color: #dbe3ec; background: #f8fafc; color: #0f172a; }
  .control-center-tab.is-active { border-color: #99f6e4; background: #ecfdf5; color: #047857; }
  .dark .control-center-tab:hover { border-color: #334155; background: #111c30; color: #f8fafc; }
  .dark .control-center-tab.is-active { border-color: #065f46; background: rgb(6 78 59 / 0.35); color: #6ee7b7; }

  .section-nav {
    display: grid;
    grid-template-columns: minmax(180px, 0.6fr) minmax(0, 1.4fr);
    align-items: center;
    gap: 1rem;
    border: 1px solid #dbe3ec;
    border-radius: 1rem;
    background: rgb(255 255 255 / 0.94);
    padding: 0.6rem;
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.025), 0 6px 18px rgb(15 23 42 / 0.025);
  }

  .dark .section-nav { border-color: #1e293b; background: #0f172a; }
  .section-nav-label { display: flex; align-items: center; gap: 0.8rem; padding: 0.4rem 0.55rem; }
  .section-nav-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.35rem; }
  .section-nav-link { border: 1px solid transparent; border-radius: 0.7rem; padding: 0.65rem 0.8rem; color: #64748b; font-size: 0.75rem; font-weight: 800; line-height: 1.15; }
  .section-nav-link:hover { border-color: #dbe3ec; background: #f8fafc; color: #0f172a; }
  .section-nav-link.is-active { border-color: #a5f3fc; background: #ecfeff; color: #0e7490; }
  .dark .section-nav-link:hover { border-color: #334155; background: #111c30; color: #f8fafc; }
  .dark .section-nav-link.is-active { border-color: #155e75; background: rgb(8 51 68 / 0.4); color: #67e8f9; }

  @media (max-width: 700px) {
    .section-nav { grid-template-columns: 1fr; gap: 0.25rem; }
  }

  @media (max-width: 900px) {
    .control-center-nav { grid-template-columns: 1fr; gap: 0.25rem; }
    .control-center-tabs { grid-template-columns: repeat(4, minmax(130px, 1fr)); overflow-x: auto; }
    .control-center-tab { min-width: 130px; }
  }

  .dark .page-description { color: #94a3b8; }

  .dark .scope-toolbar {
    border-color: #1e293b;
    background: #0f172a;
    box-shadow: 0 8px 24px rgb(0 0 0 / 0.14);
  }

  .page-title {
    color: #0f172a;
    font-size: clamp(1.5rem, 2vw, 1.875rem);
    font-weight: 750;
    letter-spacing: -0.025em;
    line-height: 1.15;
  }

  .dark .page-title { color: #f8fafc; }

  .workspace-panel {
    border: 1px solid #e2e8f0;
    border-radius: 0.875rem;
    background: #fff;
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.03);
  }

  .dashboard-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(310px, 0.7fr);
    gap: 1.5rem;
    align-items: center;
    overflow: hidden;
    border: 1px solid #113047;
    border-radius: 1.25rem;
    background: radial-gradient(circle at 84% 10%, rgb(20 184 166 / 0.28), transparent 18rem), linear-gradient(120deg, #071827, #0f2b3a 62%, #123e42);
    padding: 1.35rem 1.5rem;
    box-shadow: 0 18px 40px rgb(2 44 34 / 0.12);
  }

  .dashboard-hero-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
  }

  .dashboard-hero-meta > div {
    min-width: 0;
    border: 1px solid rgb(148 163 184 / 0.18);
    border-radius: 0.85rem;
    background: rgb(15 23 42 / 0.28);
    padding: 0.75rem;
  }

  .dashboard-hero-meta span { display: block; color: #94a3b8; font-size: 0.625rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }
  .dashboard-hero-meta strong { display: block; overflow: hidden; margin-top: 0.35rem; color: #f8fafc; font-size: 0.75rem; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }

  @media (max-width: 900px) {
    .dashboard-hero { grid-template-columns: 1fr; }
  }

  @media (max-width: 520px) {
    .dashboard-hero-meta { grid-template-columns: 1fr; }
  }

  .dark .workspace-panel {
    border-color: #1e293b;
    background: #0f172a;
  }

  .grid-dashboard {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .scrollbar-hide {
    scrollbar-width: none;
  }

  .scrollbar-hide::-webkit-scrollbar {
    display: none;
  }

  .sellfin-app .font-black { font-weight: 700; }

  .sellfin-app {
    --ui-primary: #047857;
    --ui-primary-hover: #065f46;
    font-size: 0.875rem;
  }

  .sellfin-app input,
  .sellfin-app select,
  .sellfin-app textarea {
    min-height: 2.5rem;
    border-radius: 0.625rem;
    transition: border-color 140ms ease, box-shadow 140ms ease;
  }

  .ui-button {
    display: inline-flex;
    min-height: 2.5rem;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 0.625rem;
    padding: 0.55rem 0.9rem;
    font-size: 0.8125rem;
    font-weight: 650;
    line-height: 1;
    transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease;
  }

  .ui-button-primary { background: #0f172a; color: #fff; }
  .ui-button-primary:hover { background: #1e293b; }
  .ui-button-secondary { border-color: #dbe3ec; background: #fff; color: #334155; }
  .ui-button-secondary:hover { border-color: #cbd5e1; background: #f8fafc; color: #0f172a; }
  .dark .ui-button-primary { background: #f8fafc; color: #0f172a; }
  .dark .ui-button-primary:hover { background: #e2e8f0; }
  .dark .ui-button-secondary { border-color: #334155; background: #0f172a; color: #cbd5e1; }

  .toolbar-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
  }

  .data-source-label {
    border-radius: 999px;
    background: #ecfdf5;
    padding: 0.35rem 0.65rem;
    color: #047857;
    font-size: 0.6875rem;
    font-weight: 650;
  }

  .summary-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid #dbe3ec;
    border-radius: 0.875rem;
    background: #fff;
  }

  .summary-item { min-width: 0; padding: 1rem 1.1rem; }
  .summary-item + .summary-item { border-left: 1px solid #e2e8f0; }
  .summary-label { color: #64748b; font-size: 0.6875rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; }
  .summary-value { overflow: hidden; margin-top: 0.45rem; font-size: 1.45rem; font-weight: 700; letter-spacing: -0.025em; text-overflow: ellipsis; white-space: nowrap; }
  .summary-hint { margin-top: 0.2rem; color: #94a3b8; font-size: 0.6875rem; }

  .profit-panel {
    position: relative;
    overflow: hidden;
    border: 1px solid #dbe3ec;
    border-radius: 0.875rem;
    background: #fff;
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.025);
  }

  .profit-panel::before { position: absolute; inset: 0 auto 0 0; width: 3px; content: ""; }
  .profit-panel.is-estimate::before { background: #0891b2; }
  .profit-panel.is-transit::before { background: #d97706; }
  .profit-panel.is-realized::before { background: #059669; }
  .profit-panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1rem 1.1rem 0.85rem; }
  .profit-panel-eyebrow { color: #64748b; font-size: 0.625rem; font-weight: 700; letter-spacing: 0.08em; }
  .profit-panel-heading h2 { margin-top: 0.25rem; color: #0f172a; font-size: 1rem; font-weight: 700; }
  .profit-panel-heading p { margin-top: 0.2rem; color: #94a3b8; font-size: 0.75rem; }
  .profit-panel-total { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; border-block: 1px solid #e2e8f0; background: #f8fafc; padding: 1rem 1.1rem; }
  .profit-panel-total span { display: block; color: #64748b; font-size: 0.6875rem; font-weight: 650; }
  .profit-panel-total strong { display: block; margin-top: 0.25rem; color: #0f172a; font-size: 1.65rem; font-weight: 700; letter-spacing: -0.03em; }
  .profit-panel-total > div:last-child strong { font-size: 1rem; }
  .profit-panel-rows { padding-inline: 1.1rem; }
  .profit-panel-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid #f1f5f9; padding-block: 0.7rem; }
  .profit-panel-row.is-link { margin-inline: -0.5rem; border-radius: 0.65rem; padding-inline: 0.5rem; transition: background-color 150ms ease, color 150ms ease; }
  .profit-panel-row.is-link:hover { background: #f0fdfa; }
  .profit-panel-row.is-link:focus-visible { outline: 2px solid #0d9488; outline-offset: 2px; }
  .profit-panel-row.is-link.is-active { background: #ecfdf5; }
  .profit-panel-row.is-link small { color: #0f766e; font-weight: 700; }
  .profit-panel-row > div > div { color: #475569; font-size: 0.8125rem; font-weight: 600; }
  .profit-panel-row small { display: block; margin-top: 0.15rem; color: #94a3b8; font-size: 0.6875rem; }
  .profit-panel-row > strong { color: #0f172a; font-size: 0.8125rem; font-weight: 700; text-align: right; }
  .profit-panel-note { margin: 0.75rem 1.1rem 1rem; border-radius: 0.5rem; background: #fffbeb; padding: 0.6rem 0.75rem; color: #92400e; font-size: 0.6875rem; }

  .system-health,
  .activity-overview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    border: 1px solid #dbe3ec;
    border-radius: 0.875rem;
    background: #fff;
    padding: 1rem 1.1rem;
  }

  .system-health-copy,
  .activity-overview-copy { display: flex; min-width: 0; align-items: center; gap: 0.8rem; }
  .system-health-dot { width: 0.65rem; height: 0.65rem; flex: 0 0 auto; border-radius: 999px; }
  .system-health-dot.is-good { background: #10b981; box-shadow: 0 0 0 5px rgb(16 185 129 / 0.12); }
  .system-health-dot.is-warning { background: #f59e0b; box-shadow: 0 0 0 5px rgb(245 158 11 / 0.12); }
  .system-health-stats,
  .activity-overview-stats { display: flex; align-items: stretch; }
  .system-health-stats > div,
  .activity-overview-stats > span { min-width: 92px; border-left: 1px solid #e2e8f0; padding-inline: 1rem; }
  .system-health-stats strong,
  .activity-overview-stats strong { display: block; color: #0f172a; font-size: 1rem; font-weight: 700; }
  .system-health-stats span,
  .activity-overview-stats span { color: #64748b; font-size: 0.6875rem; }

  .store-list { overflow: hidden; border: 1px solid #e2e8f0; border-radius: 0.75rem; }
  .store-list-header,
  .store-row { display: grid; grid-template-columns: minmax(220px, 1.15fr) minmax(190px, 0.9fr) minmax(180px, 0.85fr) minmax(190px, auto); gap: 1rem; align-items: center; }
  .store-list-header { background: #f8fafc; padding: 0.65rem 1rem; color: #64748b; font-size: 0.625rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
  .store-row { padding: 1rem; }
  .store-row + .store-row { border-top: 1px solid #e2e8f0; }
  .store-row:hover { background: #fcfdfd; }
  .store-identity { display: flex; min-width: 0; align-items: flex-start; gap: 0.75rem; }
  .store-avatar { display: grid; width: 2.5rem; height: 2.5rem; flex: 0 0 auto; place-items: center; border-radius: 0.65rem; background: #fff1f2; color: #e11d48; font-size: 0.8125rem; font-weight: 800; }
  .store-activity { color: #64748b; font-size: 0.75rem; }
  .store-activity strong { color: #0f172a; font-weight: 700; }
  .store-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.5rem; }
  .store-details { flex-basis: 100%; color: #94a3b8; font-size: 0.6875rem; text-align: right; }
  .store-details summary { cursor: pointer; font-weight: 600; }
  .store-details > div { margin-top: 0.25rem; }

  .activity-overview-stats > span { display: block; }

  .settings-list { border-block: 1px solid #e2e8f0; }
  .settings-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1rem; padding-block: 0.9rem; }
  .settings-row + .settings-row { border-top: 1px solid #e2e8f0; }

  .dark .summary-strip,
  .dark .profit-panel,
  .dark .system-health,
  .dark .activity-overview { border-color: #1e293b; background: #0f172a; }
  .dark .summary-item + .summary-item,
  .dark .system-health-stats > div,
  .dark .activity-overview-stats > span,
  .dark .profit-panel-total,
  .dark .settings-list,
  .dark .settings-row + .settings-row { border-color: #1e293b; }
  .dark .profit-panel-total,
  .dark .store-list-header { background: #111c30; }
  .dark .profit-panel-heading h2,
  .dark .profit-panel-total strong,
  .dark .profit-panel-row > strong,
  .dark .system-health-stats strong,
  .dark .activity-overview-stats strong,
  .dark .store-activity strong { color: #f8fafc; }
  .dark .store-list,
  .dark .store-row + .store-row { border-color: #1e293b; }
  .dark .store-row:hover { background: #111c30; }

  @media (max-width: 1040px) {
    .store-list-header { display: none; }
    .store-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .store-actions { justify-content: flex-start; }
    .store-details { text-align: left; }
  }

  @media (max-width: 720px) {
    .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .summary-item:nth-child(3) { border-left: 0; border-top: 1px solid #e2e8f0; }
    .summary-item:nth-child(4) { border-top: 1px solid #e2e8f0; }
    .system-health,
    .activity-overview { align-items: flex-start; flex-direction: column; }
    .system-health-stats,
    .activity-overview-stats { width: 100%; }
    .system-health-stats > div,
    .activity-overview-stats > span { min-width: 0; flex: 1; padding: 0 0.75rem; }
    .system-health-stats > div:first-child,
    .activity-overview-stats > span:first-child { border-left: 0; padding-left: 0; }
    .store-row { grid-template-columns: 1fr; }
  }

  @media (max-width: 440px) {
    .summary-strip { grid-template-columns: 1fr; }
    .summary-item + .summary-item { border-top: 1px solid #e2e8f0; border-left: 0; }
  }

  .order-flow-guide {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid #dbe3ec;
    border-radius: 0.875rem;
    background: #fff;
  }

  .order-flow-step {
    position: relative;
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.7rem;
    padding: 0.85rem 1rem;
  }

  .order-flow-step + .order-flow-step { border-left: 1px solid #e2e8f0; }
  .order-flow-step > span { display: grid; width: 1.8rem; height: 1.8rem; flex: 0 0 auto; place-items: center; border-radius: 999px; background: #ecfdf5; color: #047857; font-size: 0.7rem; font-weight: 700; }
  .order-flow-step > div > div { color: #0f172a; font-size: 0.75rem; font-weight: 700; }
  .order-flow-step p { margin-top: 0.15rem; color: #94a3b8; font-size: 0.65rem; }

  .dark .order-flow-guide { border-color: #1e293b; background: #0f172a; }
  .dark .order-flow-step + .order-flow-step { border-color: #1e293b; }
  .dark .order-flow-step > div > div { color: #f8fafc; }

  .order-navigation,
  .order-results { box-shadow: 0 1px 2px rgb(15 23 42 / 0.025); }
  .order-card { box-shadow: 0 1px 2px rgb(15 23 42 / 0.035); transition: border-color 140ms ease, box-shadow 140ms ease; }
  .order-card:hover { border-color: #94a3b8; box-shadow: 0 5px 15px rgb(15 23 42 / 0.055); }

  @media (max-width: 760px) {
    .order-flow-guide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .order-flow-step:nth-child(3) { border-left: 0; border-top: 1px solid #e2e8f0; }
    .order-flow-step:nth-child(4) { border-top: 1px solid #e2e8f0; }
  }

  @media (max-width: 440px) {
    .order-flow-guide { grid-template-columns: 1fr; }
    .order-flow-step + .order-flow-step { border-left: 0; border-top: 1px solid #e2e8f0; }
  }

  .report-tabs {
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
    border: 1px solid #dbe3ec;
    border-radius: 0.875rem;
    background: #fff;
    padding: 0.35rem;
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.025);
  }

  .report-tab {
    display: inline-flex;
    min-height: 2.5rem;
    flex: 1 0 auto;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    border-radius: 0.625rem;
    padding: 0.55rem 0.85rem;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 650;
    white-space: nowrap;
    transition: background-color 140ms ease, color 140ms ease;
  }

  .report-tab:hover { background: #f1f5f9; color: #0f172a; }
  .report-tab.is-active { background: #0f172a; color: #fff; }

  .report-kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .report-kpi-grid.is-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

  .report-kpi {
    min-width: 0;
    border: 1px solid #dbe3ec;
    border-radius: 0.875rem;
    background: #fff;
    padding: 1rem 1.05rem;
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.025);
  }

  .report-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    line-height: 1.55;
  }

  .report-alert.is-warning { border-color: #fde68a; background: #fffbeb; color: #92400e; }
  .report-alert.is-info { border-color: #bae6fd; background: #f0f9ff; color: #0c4a6e; }

  .report-subtabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .report-table {
    width: 100%;
    border-collapse: collapse;
    color: #334155;
    font-size: 0.75rem;
  }

  .report-table thead { background: #f8fafc; }
  .report-table th {
    padding: 0.7rem 0.75rem;
    color: #64748b;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.055em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
  }

  .report-table th.text-right { text-align: right; }
  .report-table td { border-top: 1px solid #f1f5f9; padding: 0.75rem; }
  .report-table tbody tr:hover { background: #fcfdfd; }

  .report-day {
    overflow: hidden;
    border: 1px solid #dbe3ec;
    border-radius: 0.8rem;
    background: #fff;
  }

  .report-day summary {
    display: flex;
    min-height: 4.75rem;
    cursor: pointer;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem;
    list-style: none;
  }

  .report-day summary::-webkit-details-marker { display: none; }
  .report-day summary:hover { background: #f8fafc; }
  .report-day-date { display: flex; min-width: 0; align-items: center; gap: 0.7rem; }
  .report-day-date > span { font-size: 1.15rem; }
  .report-day-date strong { display: block; color: #0f172a; font-size: 0.95rem; }
  .report-day-date small,
  .report-day-totals small { display: block; margin-top: 0.15rem; color: #94a3b8; font-size: 0.65rem; font-weight: 500; }
  .report-day-totals { display: flex; align-items: center; gap: 2rem; text-align: right; }
  .report-day-totals strong { display: block; color: #0f172a; font-size: 0.9rem; }
  .report-day-chevron { color: #94a3b8; font-size: 1.25rem; transition: transform 150ms ease; }
  .report-day[open] .report-day-chevron { transform: rotate(180deg); }

  .report-profit-day summary,
  .report-profit-total {
    display: grid;
    grid-template-columns: minmax(165px, 0.7fr) minmax(280px, 1.5fr) auto 1.25rem;
    align-items: center;
    gap: 1rem;
  }

  .report-profit-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
  .report-day-download { white-space: nowrap; }

  .report-profit-block {
    min-width: 0;
    border-left: 3px solid #cbd5e1;
    padding: 0.15rem 0 0.15rem 0.85rem;
  }

  .report-profit-block.is-estimate { border-color: #22d3ee; }
  .report-profit-block.is-realized { border-color: #34d399; }
  .report-profit-block-label { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
  .report-profit-block-label span { color: #64748b; font-size: 0.625rem; font-weight: 750; letter-spacing: 0.055em; text-transform: uppercase; }
  .report-profit-block-label em { border-radius: 999px; background: #fffbeb; padding: 0.15rem 0.45rem; color: #a16207; font-size: 0.6rem; font-style: normal; font-weight: 700; white-space: nowrap; }
  .report-profit-block-label em.is-complete { background: #ecfdf5; color: #047857; }
  .report-profit-block > strong { display: block; margin-top: 0.25rem; font-size: 1rem; line-height: 1.25; }
  .report-profit-block > small { display: block; overflow: hidden; margin-top: 0.25rem; color: #64748b; font-size: 0.65rem; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }

  .report-profit-total {
    border: 1px solid #cbd5e1;
    border-radius: 0.8rem;
    background: #f8fafc;
    padding: 1rem;
  }

  .dark .report-tabs,
  .dark .report-kpi,
  .dark .report-day { border-color: #1e293b; background: #0f172a; }
  .dark .report-tab:hover,
  .dark .report-day summary:hover { background: #111c30; color: #f8fafc; }
  .dark .report-tab.is-active { background: #34d399; color: #020617; }
  .dark .report-alert.is-warning { border-color: #78350f; background: rgb(69 26 3 / 0.35); color: #fcd34d; }
  .dark .report-alert.is-info { border-color: #0c4a6e; background: rgb(8 47 73 / 0.35); color: #7dd3fc; }
  .dark .report-table { color: #cbd5e1; }
  .dark .report-table thead { background: #111c30; }
  .dark .report-table td { border-color: #1e293b; }
  .dark .report-table tbody tr:hover { background: #111c30; }
  .dark .report-day-date strong,
  .dark .report-day-totals strong { color: #f8fafc; }
  .dark .report-profit-total { border-color: #334155; background: #111c30; }
  .dark .report-profit-block-label span,
  .dark .report-profit-block > small { color: #94a3b8; }
  .dark .report-profit-block-label em { background: rgb(120 53 15 / 0.35); color: #fcd34d; }
  .dark .report-profit-block-label em.is-complete { background: rgb(6 78 59 / 0.35); color: #6ee7b7; }

  @media (max-width: 1180px) {
    .report-kpi-grid,
    .report-kpi-grid.is-four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .report-profit-day summary,
    .report-profit-total { grid-template-columns: minmax(150px, 0.6fr) minmax(240px, 1.4fr) auto 1.25rem; }
  }

  @media (max-width: 640px) {
    .report-kpi-grid,
    .report-kpi-grid.is-four { grid-template-columns: 1fr; }
    .report-alert { align-items: flex-start; flex-direction: column; }
    .report-profit-toolbar { align-items: stretch; flex-direction: column; }
    .report-profit-toolbar > .ui-button { justify-content: center; }
    .report-day summary { align-items: flex-start; flex-direction: column; }
    .report-day-totals { width: 100%; justify-content: space-between; gap: 0.75rem; text-align: left; }
    .report-profit-day summary,
    .report-profit-total { display: grid; grid-template-columns: 1fr; gap: 0.75rem; }
    .report-profit-day .report-day-chevron { display: none; }
    .report-profit-block { width: 100%; }
    .report-profit-block > small { white-space: normal; }
    .report-profit-total > span:last-child { display: none; }
  }

  @media print {
    body { background: #fff !important; color: #000 !important; }
    .sellfin-app > aside,
    .sellfin-app header,
    .report-no-print { display: none !important; }
    .sellfin-app,
    .sellfin-app > div { display: block !important; min-height: 0 !important; background: #fff !important; }
    .sellfin-app main { max-width: none !important; padding: 0 !important; }
    .report-page { color: #000 !important; }
    .report-kpi,
    .report-statement,
    .report-day { break-inside: avoid; box-shadow: none !important; }
    .report-table { font-size: 9px; }
    .report-table th,
    .report-table td { padding: 5px 6px; }
  }
}
