:root {
  --bg-page: #f4f7fb;
  --bg-panel: rgba(255, 255, 255, 0.9);
  --bg-panel-strong: rgba(255, 255, 255, 0.96);
  --line: rgba(148, 163, 184, 0.2);
  --line-strong: rgba(148, 163, 184, 0.35);
  --ink: #0f172a;
  --muted: #64748b;
  --muted-soft: #94a3b8;
  --nav-bg: #0f172a;
  --nav-hover: rgba(30, 41, 59, 0.82);
  --blue: #1d4ed8;
  --blue-soft: rgba(59, 130, 246, 0.16);
  --emerald: #059669;
  --emerald-soft: rgba(16, 185, 129, 0.14);
  --rose: #e11d48;
  --amber: #d97706;
  --shadow-xl: 0 24px 60px rgba(15, 23, 42, 0.14);
  --shadow-lg: 0 16px 32px rgba(15, 23, 42, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Plus Jakarta Sans", sans-serif;
  background:
    radial-gradient(1000px 420px at 0% 0%, rgba(37, 99, 235, 0.12), transparent),
    radial-gradient(900px 400px at 100% 0%, rgba(5, 150, 105, 0.1), transparent),
    linear-gradient(180deg, #f8fbff 0%, var(--bg-page) 100%);
  color: var(--ink);
}

.hidden {
  display: none !important;
}

.animate-rise {
  animation: rise 0.32s ease;
}

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

.surface-card {
  background: var(--bg-panel-strong);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
}

.surface-soft {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(248, 250, 252, 0.96));
}

.surface-hero {
  background:
    radial-gradient(1400px 400px at 0% 0%, rgba(29, 78, 216, 0.14), transparent),
    radial-gradient(900px 260px at 100% 0%, rgba(5, 150, 105, 0.12), transparent),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 28px;
  box-shadow: var(--shadow-xl);
}

.section-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(59, 130, 246, 0.18);
  background: rgba(239, 246, 255, 0.9);
  color: var(--blue);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--ink);
}

.section-subtitle {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1rem;
}

.input-shell,
.select-shell {
  width: 100%;
  height: 3rem;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.92));
  padding: 0 0.95rem;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 8px 18px rgba(15, 23, 42, 0.06);
}

.input-shell:focus,
.select-shell:focus {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.14);
}

.field-caption {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--muted-soft);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.btn-primary,
.btn-secondary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  height: 2.9rem;
  padding: 0 1rem;
  border-radius: 16px;
  font-size: 0.92rem;
  font-weight: 800;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-danger-soft {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  height: 2.9rem;
  padding: 0 1rem;
  border-radius: 16px;
  border: 1px solid rgba(244, 63, 94, 0.24);
  background: rgba(255, 241, 242, 0.88);
  color: #be123c;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-danger-soft:hover {
  border-color: rgba(225, 29, 72, 0.35);
  background: rgba(255, 228, 230, 0.95);
}

.btn-primary {
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: white;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.24);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: white;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.18);
}

.btn-secondary:hover {
  transform: translateY(-1px);
}

.btn-ghost {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: rgba(59, 130, 246, 0.35);
  color: var(--blue);
}

.toggle-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.9rem;
  padding: 0 1rem;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(248, 250, 252, 0.92);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.16s ease;
}

.toggle-chip.is-active {
  color: white;
  border-color: transparent;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.14);
}

.toggle-chip.is-active[data-tone="revenue"] {
  background: linear-gradient(135deg, #059669, #10b981);
}

.toggle-chip.is-active[data-tone="expense"] {
  background: linear-gradient(135deg, #e11d48, #fb7185);
}

.nav-item {
  color: #cbd5e1;
  font-size: 0.96rem;
  transition: all 0.16s ease;
  font-weight: 700;
}

.nav-item:hover {
  background: var(--nav-hover);
  color: white;
  transform: translateX(2px);
}

.nav-item.nav-item-danger {
  color: #fecaca;
}

.nav-item.nav-item-danger:hover {
  background: rgba(220, 38, 38, 0.22);
  color: #fee2e2;
}

.nav-item.is-active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.28), rgba(30, 41, 59, 0.88));
  color: white;
  border: 1px solid rgba(96, 165, 250, 0.25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.sidebar-group-toggle {
  width: 100%;
  height: 2.4rem;
  border-radius: 0.95rem;
  border: 1px solid rgba(71, 85, 105, 0.5);
  background: rgba(15, 23, 42, 0.5);
  padding: 0 0.85rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: all 0.16s ease;
}

.sidebar-group-toggle:hover {
  border-color: rgba(96, 165, 250, 0.45);
  color: #dbeafe;
}

.sidebar-group-toggle i {
  font-size: 0.65rem;
  transition: transform 0.16s ease;
}

.sidebar-group-toggle.is-open {
  border-color: rgba(96, 165, 250, 0.5);
  background: rgba(15, 23, 42, 0.88);
  color: #dbeafe;
}

.sidebar-group-toggle.is-open i {
  transform: rotate(180deg);
}

.sidebar-group-content {
  margin-top: 0.45rem;
  display: grid;
  gap: 0.2rem;
}

.kpi-card {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  padding: 1.15rem 1.2rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.92));
  box-shadow: 0 16px 28px rgba(15, 23, 42, 0.08);
}

.kpi-card::after {
  content: "";
  position: absolute;
  top: -16px;
  right: -16px;
  width: 82px;
  height: 82px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.08);
}

.kpi-label {
  position: relative;
  z-index: 1;
  color: var(--muted-soft);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.kpi-value {
  position: relative;
  z-index: 1;
  margin-top: 0.45rem;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.mini-stat {
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  padding: 0.95rem 1rem;
}

.mini-stat.is-clickable {
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.mini-stat.is-clickable:hover {
  transform: translateY(-1px);
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.mini-stat.is-clickable:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.55);
  outline-offset: 2px;
}

.mini-stat-label {
  color: var(--muted-soft);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.mini-stat-value {
  margin-top: 0.3rem;
  font-size: 1rem;
  font-weight: 800;
}

.chart-card {
  min-height: 340px;
}

.chart-wrap {
  position: relative;
  height: 280px;
  width: 100%;
}

.agenda-item,
.recent-item,
.list-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(248, 250, 252, 0.78);
}

.agenda-item + .agenda-item,
.recent-item + .recent-item,
.list-card + .list-card {
  margin-top: 0.6rem;
}

.item-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--ink);
}

.item-meta {
  margin-top: 0.22rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.item-amount {
  font-size: 0.85rem;
  font-weight: 800;
  white-space: nowrap;
}

.alert-strip {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  border-radius: 20px;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(251, 146, 60, 0.2);
  background: linear-gradient(180deg, rgba(255, 251, 235, 0.96), rgba(255, 247, 237, 0.96));
}

.alert-strip.is-clickable {
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.alert-strip.is-clickable:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.alert-strip.is-clickable:focus-visible {
  outline: 2px solid rgba(225, 29, 72, 0.45);
  outline-offset: 2px;
}

.alert-strip.is-danger {
  border-color: rgba(244, 63, 94, 0.22);
  background: linear-gradient(180deg, rgba(255, 241, 242, 0.96), rgba(255, 245, 245, 0.96));
}

.quick-guide {
  border-radius: 20px;
}

.quick-guide-grid {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.quick-step {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(248, 250, 252, 0.78);
  padding: 0.7rem 0.8rem;
}

.quick-step-number {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(29, 78, 216, 0.13);
  color: #1d4ed8;
  font-size: 0.78rem;
  font-weight: 800;
  flex: 0 0 auto;
}

.import-card {
  display: grid;
  gap: 0.75rem;
  align-content: start;
}

.import-card-head p {
  line-height: 1.4;
}

.import-file-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.import-file-name {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 600;
}

.import-textarea {
  width: 100%;
  min-height: 180px;
  resize: vertical;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(248, 250, 252, 0.92);
  padding: 0.8rem;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.86rem;
  color: #0f172a;
  outline: none;
}

.import-textarea:focus {
  border-color: rgba(37, 99, 235, 0.44);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.import-result {
  min-height: 132px;
  max-height: 240px;
  overflow: auto;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: #0f172a;
  color: #cbd5e1;
  padding: 0.7rem;
  font-size: 0.76rem;
  line-height: 1.42;
}

body.import-busy {
  cursor: progress;
}

body.import-busy button,
body.import-busy input,
body.import-busy select,
body.import-busy textarea {
  cursor: progress;
}

.import-loading-spinner {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: 3px solid rgba(148, 163, 184, 0.35);
  border-top-color: #2563eb;
  animation: import-spin 0.9s linear infinite;
}

@keyframes import-spin {
  to {
    transform: rotate(360deg);
  }
}

body.basic-mode [data-advanced="true"] {
  display: none !important;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 1rem;
}

.sheet-card {
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-xl);
}

.sheet-header {
  padding: 1.4rem 1.5rem 1rem;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: white;
}

.sheet-header.revenue {
  background: linear-gradient(135deg, #047857, #10b981);
}

.sheet-header.expense {
  background: linear-gradient(135deg, #be123c, #f43f5e);
}

.sheet-form {
  padding: 1.5rem;
}

.value-showcase {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.5rem;
  margin: 1.2rem 0 1rem;
}

.currency-mark {
  color: rgba(148, 163, 184, 0.88);
  font-size: 1.85rem;
  font-weight: 800;
}

.value-input {
  width: min(100%, 340px);
  background: transparent;
  border: none;
  outline: none;
  text-align: center;
  font-size: clamp(2.7rem, 6vw, 4.3rem);
  font-weight: 800;
  letter-spacing: -0.08em;
  color: var(--ink);
}

.value-input.revenue {
  color: var(--emerald);
}

.value-input.expense {
  color: var(--rose);
}

.rules-panel {
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 250, 252, 0.92));
  padding: 1.25rem;
  box-shadow: var(--shadow-lg);
}

.rules-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--ink);
}

.rules-copy {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.check-list {
  margin-top: 1rem;
  display: grid;
  gap: 0.7rem;
}

.check-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.check-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(37, 99, 235, 0.1);
  color: var(--blue);
  flex: 0 0 auto;
}

.summary-grid {
  display: grid;
  gap: 0.75rem;
}

.summary-card {
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(248, 250, 252, 0.86);
  padding: 1rem;
}

.summary-caption {
  color: var(--muted-soft);
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.summary-value {
  margin-top: 0.25rem;
  font-size: 1rem;
  font-weight: 800;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  color: var(--muted-soft);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: left;
  padding: 0.9rem 0.95rem;
}

.data-table td {
  padding: 0.9rem 0.95rem;
  border-top: 1px solid rgba(226, 232, 240, 0.76);
  font-size: 0.86rem;
  color: var(--ink);
}

.data-table tbody tr:hover {
  background: rgba(248, 250, 252, 0.86);
}

.value-positive {
  color: var(--emerald);
  font-weight: 800;
}

.value-negative {
  color: var(--rose);
  font-weight: 800;
}

.report-row-formula td {
  background: rgba(248, 250, 252, 0.86);
  font-weight: 800;
}

.page-shell {
  display: grid;
  gap: 1rem;
  width: min(100%, 1480px);
  margin-inline: auto;
}

.report-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  border-radius: 22px;
}

.report-toolbar-copy {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.report-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.report-tab {
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.86);
  color: #475569;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.52rem 0.88rem;
  cursor: pointer;
  transition: all 0.16s ease;
}

.report-tab:hover {
  border-color: rgba(37, 99, 235, 0.34);
  color: #1d4ed8;
}

.report-tab.is-active {
  border-color: transparent;
  color: white;
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  box-shadow: 0 12px 22px rgba(37, 99, 235, 0.24);
}

.report-pane {
  display: grid;
  gap: 1rem;
}

.agenda-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.45rem;
  min-width: 860px;
}

.agenda-weekday {
  text-align: center;
  color: var(--muted-soft);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.5rem 0;
}

.agenda-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.45rem;
  min-width: 860px;
}

.agenda-day-cell {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  min-height: 124px;
  padding: 0.5rem;
  text-align: left;
  transition: all 0.16s ease;
}

.agenda-day-cell:hover {
  border-color: rgba(37, 99, 235, 0.36);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.08);
}

.agenda-day-cell.is-selected {
  border-color: rgba(37, 99, 235, 0.45);
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.88), rgba(255, 255, 255, 0.96));
}

.agenda-day-cell.is-today {
  outline: 2px solid rgba(59, 130, 246, 0.24);
}

.agenda-day-cell.is-overdue {
  border-color: rgba(244, 63, 94, 0.28);
}

.agenda-day-cell.is-empty {
  background: transparent;
  border-style: dashed;
  border-color: rgba(148, 163, 184, 0.2);
  min-height: 124px;
}

.agenda-day-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
}

.agenda-day-number {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--ink);
}

.agenda-day-count {
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.1);
  color: #334155;
  font-size: 0.66rem;
  font-weight: 800;
}

.agenda-day-meta {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.64rem;
}

.agenda-day-list {
  display: grid;
  gap: 0.7rem;
}

.agenda-mode-btn {
  height: 2.15rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: #64748b;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: all 0.16s ease;
}

.agenda-mode-btn.is-active {
  background: white;
  color: #0f172a;
  border-color: rgba(148, 163, 184, 0.25);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.08);
}

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

.agenda-week-card {
  text-align: left;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(248, 250, 252, 0.82);
  padding: 0.85rem;
  transition: all 0.16s ease;
}

.agenda-week-card:hover {
  border-color: rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}

.agenda-week-card.is-selected {
  border-color: rgba(37, 99, 235, 0.4);
  box-shadow: 0 10px 18px rgba(37, 99, 235, 0.16);
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.86), rgba(255, 255, 255, 0.95));
}

.agenda-week-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: #334155;
}

.agenda-week-line {
  margin-top: 0.45rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
}

.agenda-week-caption {
  color: #94a3b8;
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.agenda-week-amount {
  font-size: 0.78rem;
  font-weight: 800;
}

.agenda-week-amount.is-expense {
  color: #e11d48;
}

.agenda-week-amount.is-income {
  color: #1d4ed8;
}

.agenda-week-bar-track {
  margin-top: 0.35rem;
  height: 0.42rem;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.9);
  overflow: hidden;
}

.agenda-week-bar {
  height: 100%;
  border-radius: 999px;
}

.agenda-week-bar.is-expense {
  background: linear-gradient(90deg, #e11d48, #fb7185);
}

.agenda-week-bar.is-income {
  background: linear-gradient(90deg, #1d4ed8, #3b82f6);
}

.agenda-day-focus {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  padding: 1rem;
  min-height: 150px;
}

.agenda-day-focus.is-today {
  outline: 2px solid rgba(59, 130, 246, 0.2);
}

.agenda-day-focus-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink);
}

.agenda-day-focus-copy {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.agenda-line {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.16rem 0.4rem;
  margin-top: 0.25rem;
  font-size: 0.64rem;
  font-weight: 800;
}

.agenda-line-income {
  border-color: rgba(22, 163, 74, 0.22);
  background: rgba(220, 252, 231, 0.72);
  color: #166534;
}

.agenda-line-expense {
  border-color: rgba(225, 29, 72, 0.2);
  background: rgba(255, 228, 230, 0.75);
  color: #be123c;
}

.agenda-line-balance {
  border-color: rgba(148, 163, 184, 0.25);
  background: rgba(241, 245, 249, 0.8);
}

.agenda-line-empty {
  color: #94a3b8;
  background: rgba(248, 250, 252, 0.9);
  border-color: rgba(148, 163, 184, 0.2);
}

.agenda-day-focus-amount {
  margin-top: 0.8rem;
  font-size: 1.28rem;
  font-weight: 800;
}

.agenda-day-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(248, 250, 252, 0.86);
}

.agenda-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.agenda-header-actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.agenda-period-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.9);
  padding: 0.2rem;
}

.agenda-period-label {
  min-width: 160px;
  text-align: center;
  color: #1e293b;
  font-size: 0.86rem;
  font-weight: 800;
}

.agenda-grid-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0.2rem;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: 360px;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.96);
  color: white;
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.28);
  z-index: 60;
}

.login-panel {
  width: min(100%, 430px);
  border-radius: 32px;
  padding: 1.6rem;
  background:
    radial-gradient(480px 220px at 0% 0%, rgba(29, 78, 216, 0.12), transparent),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: var(--shadow-xl);
}

.brand-lockup {
  display: flex;
  gap: 0.9rem;
  align-items: center;
}

.brand-mark {
  width: 3.35rem;
  height: 3.35rem;
  border-radius: 22px;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, #1d4ed8, #0f172a);
  box-shadow: 0 18px 34px rgba(29, 78, 216, 0.24);
}

.brand-eyebrow {
  color: var(--muted-soft);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sidebar-shell {
  background:
    radial-gradient(760px 260px at 0% 0%, rgba(37, 99, 235, 0.2), transparent),
    linear-gradient(180deg, #0f172a, #111827);
}

.topbar-shell {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
}

.toolbar-card,
.table-shell {
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-lg);
}

.toolbar-card {
  padding: 1.15rem;
}

.table-shell {
  padding: 1rem 0;
  overflow: hidden;
}

.table-shell-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0 1.25rem 0.9rem;
}

.table-shell-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink);
}

.table-shell-copy {
  margin-top: 0.18rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.metric-band {
  display: grid;
  gap: 0.9rem;
}

.metric-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 0.95rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(248, 250, 252, 0.84);
}

.metric-inline-label {
  color: var(--muted-soft);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.metric-inline-value {
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink);
}

.insight-grid {
  display: grid;
  gap: 0.9rem;
}

.insight-tile {
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 250, 252, 0.92));
  padding: 1rem;
}

.insight-title {
  color: var(--muted-soft);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.insight-value {
  margin-top: 0.3rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ink);
}

.insight-copy {
  margin-top: 0.22rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.coa-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.coa-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.coa-search {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  height: 2.75rem;
  min-width: 280px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  background: rgba(248, 250, 252, 0.92);
  padding: 0 0.8rem;
}

.coa-search i {
  color: #94a3b8;
}

.coa-search input {
  border: none;
  background: transparent;
  width: 100%;
  height: 100%;
  outline: none;
  color: #0f172a;
  font-size: 0.88rem;
  font-weight: 600;
}

.coa-side-menu {
  display: grid;
  gap: 0.45rem;
}

.coa-side-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  height: 2.7rem;
  width: 100%;
  padding: 0 0.8rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(248, 250, 252, 0.8);
  color: #334155;
  font-size: 0.8rem;
  font-weight: 700;
  transition: all 0.16s ease;
}

.coa-side-link:hover {
  border-color: rgba(37, 99, 235, 0.3);
  color: #1d4ed8;
}

.coa-side-link.is-active {
  background: linear-gradient(135deg, rgba(29, 78, 216, 0.1), rgba(37, 99, 235, 0.08));
  border-color: rgba(37, 99, 235, 0.26);
  color: #1d4ed8;
}

.coa-groups {
  display: grid;
  gap: 0.9rem;
}

.coa-group-card {
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.94));
  overflow: hidden;
}

.coa-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.85);
  flex-wrap: wrap;
}

.coa-group-ident {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.coa-group-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
}

.coa-group-icon.is-entry {
  background: rgba(16, 185, 129, 0.14);
  color: #059669;
}

.coa-group-icon.is-exit {
  background: rgba(244, 63, 94, 0.14);
  color: #e11d48;
}

.coa-group-title {
  color: #0f172a;
  font-size: 0.94rem;
  font-weight: 800;
}

.coa-group-meta {
  margin-top: 0.15rem;
  color: #64748b;
  font-size: 0.72rem;
}

.coa-group-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.coa-mini-btn {
  height: 1.9rem;
  border-radius: 10px;
  padding: 0 0.7rem;
  font-size: 0.72rem;
}

.coa-subaccount-list {
  padding: 0.75rem;
  display: grid;
  gap: 0.5rem;
}

.coa-subaccount-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: rgba(248, 250, 252, 0.86);
  padding: 0.65rem 0.75rem;
}

.coa-subaccount-name {
  color: #1e293b;
  font-size: 0.84rem;
  font-weight: 700;
}

.coa-subaccount-meta {
  margin-top: 0.1rem;
  color: #64748b;
  font-size: 0.71rem;
}

.coa-subaccount-badges {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.coa-empty-subaccount {
  border-radius: 12px;
  border: 1px dashed rgba(148, 163, 184, 0.36);
  color: #64748b;
  font-size: 0.78rem;
  padding: 0.8rem;
}

.status-pill,
.tag-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.8rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.tag-pill {
  background: rgba(226, 232, 240, 0.7);
  color: #334155;
}

.tag-pill.revenue {
  background: rgba(16, 185, 129, 0.12);
  color: var(--emerald);
}

.tag-pill.expense {
  background: rgba(244, 63, 94, 0.12);
  color: var(--rose);
}

.tag-pill.neutral {
  background: rgba(15, 23, 42, 0.12);
  color: #0f172a;
}

.status-pill.open {
  background: rgba(245, 158, 11, 0.12);
  color: var(--amber);
  border-color: rgba(245, 158, 11, 0.16);
}

.status-pill.paid {
  background: rgba(16, 185, 129, 0.12);
  color: var(--emerald);
  border-color: rgba(16, 185, 129, 0.14);
}

.status-pill.cancelled {
  background: rgba(148, 163, 184, 0.16);
  color: #475569;
  border-color: rgba(148, 163, 184, 0.18);
}

.empty-note {
  padding: 1rem 1.25rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.caps-note {
  color: var(--muted-soft);
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.table-shell .data-table th:first-child,
.table-shell .data-table td:first-child {
  padding-left: 1.25rem;
}

.table-shell .data-table th:last-child,
.table-shell .data-table td:last-child {
  padding-right: 1.25rem;
}

td.positive {
  color: var(--emerald);
  font-weight: 800;
}

td.negative {
  color: var(--rose);
  font-weight: 800;
}

.table-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  width: 100%;
}

.coa-subaccount-badges .table-actions {
  width: auto;
}

.table-action-btn {
  height: 1.9rem;
  min-width: 1.9rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(248, 250, 252, 0.92);
  color: #334155;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0 0.55rem;
  transition: all 0.16s ease;
}

.table-action-btn:hover {
  border-color: rgba(37, 99, 235, 0.3);
  color: #1d4ed8;
}

.table-action-btn.danger {
  border-color: rgba(244, 63, 94, 0.24);
  color: #be123c;
}

.table-action-btn.danger:hover {
  background: rgba(255, 228, 230, 0.78);
}

.industrial-result-card {
  border-radius: 14px;
  border: 1px solid rgba(226, 232, 240, 0.96);
  background: rgba(248, 250, 252, 0.9);
  padding: 0.72rem 0.82rem;
}

.industrial-result-label {
  color: #64748b;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
}

.industrial-result-value {
  margin-top: 0.36rem;
  color: #0f172a;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.45;
}

.dynamic-builder-shell {
  display: grid;
  grid-template-columns: minmax(260px, 0.34fr) minmax(0, 0.66fr);
  gap: 1rem;
}

.dynamic-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 520px;
}

.dynamic-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(248, 250, 252, 0.86);
  padding: 0.25rem;
}

.dynamic-tab {
  height: 2rem;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.dynamic-tab.is-active {
  background: white;
  color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.24);
  box-shadow: 0 6px 12px rgba(15, 23, 42, 0.08);
}

.dynamic-builder-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.dynamic-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.dynamic-lines-list {
  display: grid;
  gap: 0.75rem;
}

.dynamic-line-card {
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(248, 250, 252, 0.88);
  padding: 0.9rem;
}

.dynamic-line-card.is-selected {
  border-color: rgba(37, 99, 235, 0.36);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.dynamic-line-card.is-total {
  background: linear-gradient(135deg, #0f172a, #111827);
  border-color: rgba(51, 65, 85, 0.94);
  box-shadow: 0 14px 24px rgba(15, 23, 42, 0.2);
}

.dynamic-line-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.dynamic-line-head-left {
  display: flex;
  align-items: flex-start;
  gap: 0.62rem;
  min-width: 260px;
  flex: 1 1 auto;
}

.dynamic-line-head-content {
  min-width: 0;
  flex: 1 1 auto;
}

.dynamic-data-mark,
.dynamic-total-mark {
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
}

.dynamic-data-mark {
  background: rgba(148, 163, 184, 0.2);
  color: #334155;
}

.dynamic-total-mark {
  background: rgba(59, 130, 246, 0.2);
  color: #bfdbfe;
}

.dynamic-line-name-input {
  width: 100%;
  border: none;
  background: transparent;
  color: #0f172a;
  font-size: 1rem;
  font-weight: 800;
  outline: none;
}

.dynamic-line-name-input.is-total {
  color: #f8fafc;
}

.dynamic-line-meta {
  margin-top: 0.16rem;
  color: #64748b;
  font-size: 0.72rem;
}

.dynamic-line-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dynamic-dropzone {
  margin-top: 0.72rem;
  border: 1px dashed rgba(148, 163, 184, 0.45);
  border-radius: 12px;
  min-height: 60px;
  padding: 0.62rem;
  background: rgba(255, 255, 255, 0.78);
  transition: all 0.16s ease;
}

.dynamic-dropzone.is-over {
  border-color: rgba(59, 130, 246, 0.55);
  background: rgba(239, 246, 255, 0.95);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.dynamic-assigned-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
}

.dynamic-assigned-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: white;
  padding: 0.24rem 0.62rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #334155;
}

.dynamic-assigned-pill.is-revenue {
  border-color: rgba(16, 185, 129, 0.24);
  background: rgba(220, 252, 231, 0.7);
  color: #065f46;
}

.dynamic-assigned-pill.is-expense {
  border-color: rgba(244, 63, 94, 0.24);
  background: rgba(255, 228, 230, 0.72);
  color: #9f1239;
}

.dynamic-assigned-pill button {
  width: 1.18rem;
  height: 1.18rem;
  border-radius: 999px;
  border: none;
  background: rgba(148, 163, 184, 0.2);
  color: #334155;
  cursor: pointer;
}

.dynamic-total-formula {
  margin-top: 0.7rem;
  display: grid;
  grid-template-columns: 1fr 150px 1fr;
  gap: 0.5rem;
}

.dynamic-group-pool {
  display: grid;
  gap: 0.55rem;
  max-height: 540px;
  overflow-y: auto;
  padding-right: 0.2rem;
}

.dynamic-group-item {
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(248, 250, 252, 0.9);
  padding: 0.68rem 0.72rem;
  cursor: grab;
  transition: all 0.16s ease;
}

.dynamic-group-item.is-revenue {
  border-left: 4px solid #10b981;
}

.dynamic-group-item.is-expense {
  border-left: 4px solid #f43f5e;
}

.dynamic-group-item.is-revenue .dynamic-group-title i {
  color: #059669;
}

.dynamic-group-item.is-expense .dynamic-group-title i {
  color: #e11d48;
}

.dynamic-group-item:hover {
  border-color: rgba(59, 130, 246, 0.36);
  transform: translateX(1px);
}

.dynamic-group-item:active {
  cursor: grabbing;
}

.dynamic-group-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 800;
  color: #0f172a;
}

.dynamic-group-meta {
  margin-top: 0.2rem;
  color: #64748b;
  font-size: 0.7rem;
}

@media (max-width: 1180px) {
  .hero-grid,
  .split-layout {
    grid-template-columns: 1fr;
  }

  .dynamic-builder-shell {
    grid-template-columns: 1fr;
  }

  .report-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .quick-guide-grid {
    grid-template-columns: 1fr;
  }

  .coa-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .coa-actions {
    width: 100%;
  }

  .coa-search {
    min-width: 0;
    flex: 1 1 280px;
  }
}

@media (max-width: 920px) {
  #app-shell {
    display: block !important;
  }

  #app-shell > div:first-child {
    position: static;
    width: 100%;
    height: auto;
  }

  #app-shell main {
    padding-left: 0 !important;
  }
}

@media (max-width: 760px) {
  .section-title {
    font-size: 1.35rem;
  }

  .kpi-value {
    font-size: 1.2rem;
  }

  .value-input {
    font-size: 2.75rem;
  }

  .chart-wrap {
    height: 240px;
  }

  .page-shell {
    gap: 0.8rem;
  }

  .report-tabs {
    width: 100%;
  }

  .report-tab {
    flex: 1 1 calc(50% - 0.55rem);
    text-align: center;
  }

  .agenda-weekdays,
  .agenda-calendar-grid {
    gap: 0.35rem;
  }

  .agenda-weekly-grid {
    grid-template-columns: 1fr;
  }

  .agenda-period-label {
    min-width: 130px;
    font-size: 0.78rem;
  }

  .agenda-day-cell,
  .agenda-day-cell.is-empty {
    min-height: 92px;
    padding: 0.5rem;
  }

  .agenda-day-meta {
    font-size: 0.64rem;
  }

  .agenda-day-amount {
    font-size: 0.72rem;
  }

  .coa-actions {
    display: grid;
    width: 100%;
  }

  .coa-search {
    width: 100%;
  }

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

  .dynamic-head-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .dynamic-total-formula {
    grid-template-columns: 1fr;
  }

  .coa-subaccount-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .coa-subaccount-badges {
    justify-content: flex-start;
  }

  .import-textarea {
    min-height: 140px;
  }

  .import-file-row {
    align-items: flex-start;
  }

  .import-file-name {
    width: 100%;
  }
}
