:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --bg-2: #eef3f8;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-solid: #ffffff;
  --surface-soft: #f8fafc;
  --surface-raised: rgba(255, 255, 255, 0.92);
  --text: #111827;
  --text-soft: #475569;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --line: rgba(148, 163, 184, 0.24);
  --line-strong: rgba(100, 116, 139, 0.24);
  --primary: #2563eb;
  --primary-2: #4f46e5;
  --primary-soft: #eff6ff;
  --success: #16a34a;
  --success-soft: #dcfce7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --warning: #d97706;
  --warning-soft: #fffbeb;
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 8px;
  --radius-lg: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 12px 30px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 24px 70px rgba(15, 23, 42, 0.11);
  --cell-shadow: 0 6px 16px rgba(15, 23, 42, 0.045), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  --cell-shadow-focus: 0 0 0 4px rgba(37, 99, 235, 0.10), 0 10px 22px rgba(37, 99, 235, 0.08);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --sidebar-width: 72px;
  --user-display-name: "DDS PRO";
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  padding: 116px 32px 32px calc(var(--sidebar-width) + 32px);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.45;
  letter-spacing: 0;
  background: linear-gradient(180deg, #f8fbff 0%, var(--bg) 42%, var(--bg-2) 100%);
  transition: padding-left 120ms ease-out;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: 88px;
  z-index: 25;
  pointer-events: none;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px);
  transition: left 120ms ease-out;
}

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

h3 {
  margin-bottom: var(--space-4);
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
}

p {
  margin-bottom: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  width: var(--sidebar-width);
  height: 100vh;
  margin: 0;
  padding: 28px 12px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: none;
  backdrop-filter: blur(18px);
  contain: layout paint style;
  will-change: width, padding;
  transition:
    width 140ms cubic-bezier(.2, .8, .2, 1),
    padding 140ms cubic-bezier(.2, .8, .2, 1),
    background 140ms ease-out;
}

.top-nav::before {
  content: "";
  display: inline-flex;
  align-items: center;
  width: 48px;
  min-height: 44px;
  margin: 0 0 var(--space-5);
  padding: 0;
  border-radius: 0;
  color: transparent;
  font-size: 0;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  background: transparent;
  transition:
    color 120ms ease-out,
    padding 120ms ease-out;
}

.top-nav::after {
  content: "";
  position: absolute;
  top: 24px;
  left: 18px;
  width: 42px;
  height: 42px;
  border-radius: 0;
  background: url("/assets/icons/dds-pro-icon-192.png") center / contain no-repeat;
  box-shadow: none;
}

.top-nav::before {
  white-space: nowrap;
}

.top-nav a {
  display: flex;
  width: 100%;
}

button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 34px;
  max-width: 100%;
  padding: 0 var(--space-3);
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
  cursor: pointer;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    opacity 160ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.22);
}

button:active:not(:disabled) {
  transform: translateY(0);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  box-shadow: none;
}

button svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.top-nav button {
  justify-content: flex-start;
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  color: var(--text-soft);
  border-color: transparent;
  border-radius: var(--radius-md);
  background: transparent;
  box-shadow: none;
  font-size: 14px;
  overflow: hidden;
  transition:
    color 120ms ease-out,
    background 120ms ease-out,
    border-color 120ms ease-out,
    box-shadow 120ms ease-out,
    padding 120ms ease-out;
}

.top-nav button svg {
  flex: 0 0 17px;
}

.top-nav button {
  gap: 14px;
}

.top-nav button:hover {
  color: var(--primary);
  background: var(--primary-soft);
  box-shadow: none;
}

.page-index .top-nav a[href="index.html"] button,
.page-rnp .top-nav a[href="rnp.html"] button,
.page-tasks .top-nav a[href="tasks.html"] button,
.page-financial-calendar .top-nav a[href="financial-calendar.html"] button,
.page-costing .top-nav a[href="costing.html"] button,
.page-categories .top-nav a[href="categories.html"] button,
.page-annual-report .top-nav a[href="annual-report.html"] button,
.page-access .top-nav a[href="access.html"] button {
  color: var(--primary);
  border-color: rgba(37, 99, 235, 0.16);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.08);
}

body.sidebar-expanded {
  --sidebar-width: 264px;
}

body.sidebar-expanded .top-nav {
  padding-left: 18px;
  padding-right: 18px;
}

body.sidebar-expanded .top-nav::before {
  content: "DDS PRO";
  width: 100%;
  padding-left: 74px;
  color: var(--text);
  font-size: 21px;
  font-weight: 900;
}

body.sidebar-expanded .top-nav button {
  justify-content: flex-start;
}

body:not(.sidebar-expanded) .top-nav button {
  justify-content: center;
  gap: 0;
  padding: 0;
  font-size: 0;
}

body:not(.sidebar-expanded) .top-nav button svg {
  margin: 0;
}

body:not(.sidebar-expanded) .top-nav button {
  color: transparent;
}

body:not(.sidebar-expanded) .top-nav button svg {
  color: var(--text-soft);
}

body:not(.sidebar-expanded).page-index .top-nav a[href="index.html"] button svg,
body:not(.sidebar-expanded).page-rnp .top-nav a[href="rnp.html"] button svg,
body:not(.sidebar-expanded).page-tasks .top-nav a[href="tasks.html"] button svg,
body:not(.sidebar-expanded).page-financial-calendar .top-nav a[href="financial-calendar.html"] button svg,
body:not(.sidebar-expanded).page-costing .top-nav a[href="costing.html"] button svg,
body:not(.sidebar-expanded).page-categories .top-nav a[href="categories.html"] button svg,
body:not(.sidebar-expanded).page-annual-report .top-nav a[href="annual-report.html"] button svg,
body:not(.sidebar-expanded).page-access .top-nav a[href="access.html"] button svg {
  color: var(--primary);
}

.card {
  width: 100%;
  margin: 0 0 var(--space-5);
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.07);
  backdrop-filter: blur(18px);
}

.card:hover {
  border-color: rgba(37, 99, 235, 0.16);
}

.card:has(.dropdown-menu) {
  position: relative;
  z-index: 20;
  overflow: visible;
}

.card:has(table) {
  position: relative;
  z-index: 1;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  padding: 0 var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  letter-spacing: 0;
  background: rgba(248, 250, 252, 0.86);
  box-shadow: var(--cell-shadow);
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

input,
select {
  height: 38px;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted-2);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.58);
  background: #ffffff;
  box-shadow: var(--cell-shadow-focus);
}

select {
  cursor: pointer;
}

.grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr 1fr 0.85fr;
  grid-template-areas:
    "date from cat amount"
    "date to sub note";
  gap: var(--space-3);
  align-items: stretch;
}

.date-wrap {
  grid-area: date;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.date-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}

#from {
  grid-area: from;
}

#to {
  grid-area: to;
}

#cat {
  grid-area: cat;
}

#sub {
  grid-area: sub;
}

#amount {
  grid-area: amount;
}

#note {
  grid-area: note;
}

.dropdown {
  position: relative;
  width: 100%;
  min-width: 0;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 5000;
  width: 100%;
  max-height: 260px;
  overflow-y: auto;
  padding: var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
}

.dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 34px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  transition:
    background 140ms ease,
    color 140ms ease,
    transform 140ms ease;
}

.dropdown-item:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.dropdown-item span:last-child {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--muted);
}

.dropdown-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  color: var(--muted);
  transition:
    color 140ms ease,
    background 140ms ease;
}

.dropdown-action:hover {
  color: var(--primary);
  background: rgba(37, 99, 235, 0.10);
}

.dropdown-action.danger:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.dropdown-action svg {
  width: 14px;
  height: 14px;
}

.dropdown-add-only {
  justify-content: center;
  min-height: 38px;
  color: var(--primary);
  background: rgba(37, 99, 235, 0.06);
}

.dropdown-add-only .dropdown-action {
  color: var(--primary);
  background: transparent;
}

.usdt-rate-box {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-2);
  flex-wrap: wrap;
  position: relative;
  margin-bottom: var(--space-4);
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--text-soft);
  background: rgba(248, 250, 252, 0.76);
}

.usdt-rate-summary,
.usdt-rate-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.usdt-rate-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--card);
  font-size: 13px;
  font-weight: 800;
  box-shadow: var(--cell-shadow);
}

.usdt-rate-chip strong {
  color: var(--text);
  font-size: 15px;
}

.usdt-rate-field {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: var(--space-2);
  min-width: 220px;
  color: var(--text);
  font-weight: 800;
}

.usdt-rate-field input {
  width: 100%;
}

.usdt-rate-field-single {
  grid-template-columns: auto minmax(140px, 180px);
  min-width: 310px;
}

.usdt-rate-box #setManualRateBtn {
  width: auto;
  min-width: 118px;
}

.usdt-rate-field small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.usdt-rate-source {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.usdt-rate-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: var(--space-3);
  z-index: 60;
  display: grid;
  gap: var(--space-3);
  width: min(560px, calc(100vw - 48px));
  padding: var(--space-4);
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.16);
}

.usdt-rate-panel[hidden] {
  display: none;
}

.usdt-rate-panel-head strong,
.usdt-rate-panel-head span {
  display: block;
}

.usdt-rate-panel-head strong {
  color: var(--text);
  font-size: 15px;
}

.usdt-rate-panel-head span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.usdt-rate-panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.usdt-rate-panel > button {
  width: 100%;
}

.usdt-hint {
  min-height: 18px;
  margin-top: var(--space-3);
  color: var(--muted);
  font-size: 12px;
}

.table-card {
  overflow: visible;
}

.table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  overscroll-behavior-x: contain;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-solid);
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  min-width: 860px;
  table-layout: auto;
  border-collapse: separate;
  border-spacing: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: var(--surface-solid);
  box-shadow: none;
}

tbody,
thead {
  width: 100%;
}

thead {
  position: relative;
  z-index: 80;
}

tbody {
  position: relative;
  z-index: 1;
}

th,
td {
  height: 58px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.78);
  text-align: center;
  vertical-align: middle;
  font-size: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.66);
}

th:first-child,
td:first-child {
  width: 64px;
  min-width: 64px;
  padding-left: 16px;
  padding-right: 8px;
}

th {
  position: relative;
  top: auto;
  z-index: 90;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
  background: rgba(248, 250, 252, 0.96);
  backdrop-filter: blur(10px);
}

.table-head-filter {
  position: relative;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}

.table-head-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-filter-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  min-height: 20px;
  padding: 0;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: none;
}

.table-filter-trigger:hover,
.table-filter-trigger.is-active {
  color: var(--primary);
  border-color: rgba(37, 99, 235, 0.28);
  background: #eef2ff;
}

.table-filter-trigger svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.table-filter-popover {
  position: absolute;
  left: 50%;
  top: calc(100% + 10px);
  z-index: 10000;
  display: none;
  width: 220px;
  padding: 10px;
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-lg);
  color: var(--text);
  letter-spacing: 0;
  text-transform: none;
  transform: translateX(-50%);
}

.table-filter-popover::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -6px;
  width: 10px;
  height: 10px;
  border-left: 1px solid rgba(226, 232, 240, 0.92);
  border-top: 1px solid rgba(226, 232, 240, 0.92);
  background: rgba(255, 255, 255, 0.98);
  transform: translateX(-50%) rotate(45deg);
}

.table-filter-popover.is-open {
  display: grid;
  gap: 10px;
}

.table-head-filter-date .table-filter-popover {
  left: 0;
  transform: none;
}

.table-head-filter-date .table-filter-popover::before {
  left: 20px;
  transform: rotate(45deg);
}

.table-head-filter-amount .table-filter-popover {
  left: auto;
  right: 0;
  transform: none;
}

.table-head-filter-amount .table-filter-popover::before {
  left: auto;
  right: 20px;
  transform: rotate(45deg);
}

.table-date-popover {
  width: 300px;
}

.table-filter-option-list {
  display: grid;
  gap: 6px;
  max-height: 280px;
  overflow-y: auto;
}

.table-filter-option-list button {
  justify-content: flex-start;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  background: transparent;
  box-shadow: none;
}

.table-filter-option-list button:hover,
.table-filter-option-list button.is-selected {
  color: var(--primary);
  border-color: rgba(37, 99, 235, 0.16);
  background: #eef2ff;
}

.table-filter-empty {
  padding: 8px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  text-align: center;
}

.table-date-presets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.table-date-presets button,
.table-filter-secondary,
.table-filter-primary {
  min-height: 34px;
  padding: 0 10px;
  border-radius: var(--radius-xs);
  font-size: 12px;
  font-weight: 800;
}

.table-date-presets button,
.table-filter-secondary {
  color: var(--text);
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: none;
}

.table-date-fields {
  display: grid;
  gap: 7px;
  text-align: left;
}

.table-date-fields label {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 800;
  text-transform: none;
}

.table-filter-field {
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  background: #ffffff;
}

.table-filter-field::placeholder {
  color: var(--muted-2);
}

.table-filter-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.table-filter-primary {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), #4f46e5);
}

.table-filter-reset {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  background: #ffffff;
  box-shadow: none;
}

.table-filter-reset:hover {
  color: var(--primary);
  border-color: rgba(37, 99, 235, 0.22);
  background: #eef2ff;
}

.card:has(.table-filter-popover) {
  overflow: visible;
}

.card:has(.dropdown-menu) {
  overflow: visible;
}

#accountsStats {
  overflow: visible;
}

.page-index #accountsStats {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

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

tr {
  transition:
    background 140ms ease,
    box-shadow 140ms ease;
}

tr:hover {
  background: rgba(37, 99, 235, 0.075);
}

td:last-child,
th:last-child {
  text-align: center;
}

td button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 11px;
}

#table th:nth-child(7),
#table td:nth-child(7),
#catTable th:last-child,
#catTable td:last-child {
  font-weight: 800;
  white-space: nowrap;
}

.amount-cell {
  font-weight: 850;
  white-space: nowrap;
  text-align: center;
  vertical-align: middle;
  padding-left: 10px;
  padding-right: 10px;
  font-variant-numeric: tabular-nums;
}

.amount-cell.income {
  color: var(--success);
}

.amount-cell.expense {
  color: var(--danger);
}

.amount-cell.transfer {
  color: #b45309;
}

.amount-cell.neutral {
  color: var(--text);
}

.page-index #table {
  table-layout: fixed;
  min-width: 0;
}

.page-index #table th:nth-child(1),
.page-index #table td:nth-child(1) {
  width: 64px;
}

.page-index #table th:nth-child(2),
.page-index #table td:nth-child(2) {
  width: 116px;
}

.page-index #table th:nth-child(3),
.page-index #table td:nth-child(3),
.page-index #table th:nth-child(4),
.page-index #table td:nth-child(4) {
  width: 14%;
}

.page-index #table th:nth-child(5),
.page-index #table td:nth-child(5),
.page-index #table th:nth-child(6),
.page-index #table td:nth-child(6) {
  width: 15%;
}

.page-index #table th:nth-child(7),
.page-index #table td:nth-child(7) {
  width: 142px;
}

.page-index #table th:nth-child(8),
.page-index #table td:nth-child(8) {
  width: 86px;
}

.page-index #table th:nth-child(9),
.page-index #table td:nth-child(9) {
  width: 112px;
}

#table td:nth-child(2),
#table td:nth-child(3),
#table td:nth-child(4),
#table td:nth-child(5),
#table td:nth-child(6) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operation-note-cell {
  overflow: visible;
  text-align: center;
  white-space: nowrap;
}

.operation-note-trigger {
  display: inline-grid;
  place-items: center;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 999px;
  color: #2563eb;
  background: rgba(239, 246, 255, 0.9);
  box-shadow: none;
}

.operation-note-trigger:hover,
.operation-note-trigger:focus-visible {
  border-color: rgba(37, 99, 235, 0.32);
  background: #eef2ff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.12);
}

.operation-note-trigger svg {
  width: 16px;
  height: 16px;
}

.operation-note-tooltip {
  position: fixed;
  z-index: 100000;
  width: max-content;
  max-width: min(360px, calc(100vw - 24px));
  padding: 12px 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  color: #0f172a;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
  pointer-events: none;
}

.operation-note-tooltip[hidden] {
  display: none;
}

#membersTable,
#invitesTable {
  table-layout: fixed;
}

#membersTable th,
#membersTable td,
#invitesTable th,
#invitesTable td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#membersTable th:nth-child(1),
#membersTable td:nth-child(1),
#membersTable th:nth-child(2),
#membersTable td:nth-child(2) {
  width: 26%;
  text-align: left;
}

#membersTable th:nth-child(3),
#membersTable td:nth-child(3),
#membersTable th:nth-child(4),
#membersTable td:nth-child(4),
#membersTable th:nth-child(5),
#membersTable td:nth-child(5),
#membersTable th:nth-child(6),
#membersTable td:nth-child(6) {
  width: 12%;
}

.member-name-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.member-name-input {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 750;
  outline: none;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.member-name-input:hover,
.member-name-input:focus {
  border-color: var(--line);
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.member-name-save {
  min-width: 96px;
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 850;
  box-shadow: none;
}

.member-name-save:disabled {
  opacity: 0;
  pointer-events: none;
}

#invitesTable th:nth-child(1),
#invitesTable td:nth-child(1) {
  width: 28%;
  text-align: left;
}

#invitesTable th:nth-child(2),
#invitesTable td:nth-child(2),
#invitesTable th:nth-child(3),
#invitesTable td:nth-child(3),
#invitesTable th:nth-child(5),
#invitesTable td:nth-child(5),
#invitesTable th:nth-child(6),
#invitesTable td:nth-child(6) {
  width: 14%;
}

#invitesTable th:nth-child(4),
#invitesTable td:nth-child(4) {
  width: 18%;
}

.table-actions,
td:last-child {
  white-space: nowrap;
}

.table-actions {
  display: table-cell;
  min-width: 104px;
}

.table-actions .icon-button + .icon-button {
  margin-left: var(--space-2);
}

.operation-type-cell {
  position: relative;
}

.operation-type-cell::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 2px;
  border-radius: 999px;
  background: var(--line-strong);
}

tr.income .operation-type-cell::before {
  background: var(--success);
}

tr.expense .operation-type-cell::before {
  background: var(--danger);
}

tr.transfer .operation-type-cell::before {
  background: #f59e0b;
}

.operation-type-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-soft);
}

.operation-type-icon.income {
  color: var(--success);
  background: var(--success-soft);
}

.operation-type-icon.expense {
  color: var(--danger);
  background: var(--danger-soft);
}

.operation-type-icon.transfer {
  position: relative;
  width: 34px;
  height: 34px;
  color: #d97706;
  background: rgba(254, 243, 199, 0.88);
  box-shadow: none;
}

.operation-type-icon.transfer::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.16);
}

.operation-type-icon.transfer svg {
  position: relative;
  z-index: 1;
  width: 17px;
  height: 17px;
  color: #d97706;
  stroke-width: 2.2;
}

.operation-type-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.accounts-stats {
  width: 100%;
  display: grid;
  gap: 10px;
  padding: 12px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 22px;
  background:
    radial-gradient(circle at 12% 0%, rgba(191, 219, 254, 0.62), transparent 38%),
    radial-gradient(circle at 78% 20%, rgba(233, 213, 255, 0.52), transparent 34%),
    linear-gradient(135deg, rgba(239, 246, 255, 0.94), rgba(255, 241, 242, 0.86) 52%, rgba(245, 243, 255, 0.92));
  box-shadow: 0 18px 46px rgba(59, 130, 246, 0.10);
}

.accounts-total-row {
  display: flex;
  align-items: stretch;
  gap: var(--space-3);
  justify-content: flex-end;
  width: 100%;
}

.accounts-grid {
  display: flex;
  align-items: stretch;
  gap: 0;
  width: 100%;
  min-height: 74px;
}

.dds-events-widget {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 2px 2px 11px;
  border-bottom: 1px solid rgba(100, 116, 139, 0.14);
  background: transparent;
}

.dds-events-head {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.dds-events-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  max-height: 78px;
  overflow: auto;
}

.dds-event-card {
  display: block;
  flex: 0 1 238px;
  min-width: 168px;
  max-width: 286px;
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid rgba(99, 102, 241, 0.14);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(248, 250, 252, 0.60)),
    rgba(255, 255, 255, 0.52);
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.08);
}

.dds-event-card strong {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dds-event-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  height: 100%;
}

.dds-event-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.dds-event-date {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #4f46e5;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.dds-event-date svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dds-event-time {
  flex: 0 0 auto;
  min-width: 62px;
  padding-left: 12px;
  border-left: 1px solid rgba(100, 116, 139, 0.22);
  color: #1e293b;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.dds-event-card:not(.has-time) {
  flex-basis: 188px;
}

.dds-event-card:not(.has-time) .dds-event-body {
  justify-content: flex-start;
}

.dds-events-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  padding: 0 10px;
  border-radius: 999px;
  color: #4f46e5;
  background: rgba(238, 242, 255, 0.86);
  font-size: 12px;
  font-weight: 850;
}

@media (min-width: 1180px) {
  .page-index .accounts-grid {
    flex-wrap: nowrap;
  }

  .page-index .acc-card {
    min-height: 68px;
    padding: 8px 42px 8px 52px;
  }

  .page-index .acc-card::before {
    top: 50%;
    left: 10px;
    width: 32px;
    height: 32px;
    transform: translateY(-50%);
  }

  .page-index .acc-card::after {
    top: 50%;
    left: 18px;
    width: 16px;
    height: 16px;
    font-size: 13px;
    line-height: 16px;
    transform: translateY(-50%);
  }

  .page-index .acc-card-fulfillment::after,
  .page-index .acc-card-total::after {
    font-size: 14px;
  }

  .page-index .acc-name,
  .page-index .acc-subvalue {
    font-size: 11px;
  }

  .page-index .acc-value {
    font-size: clamp(16px, 0.95vw, 20px);
  }

  .page-index .acc-total-toggle {
    right: 10px;
    bottom: 10px;
  }
}

@media (min-width: 1500px) {
  .page-index .accounts-grid {
    flex-wrap: nowrap;
  }

  .page-index .acc-card {
    padding-left: 54px;
  }

  .page-index .acc-value {
    font-size: clamp(18px, 1.05vw, 22px);
  }
}

.acc-card {
  position: relative;
  flex: 1 1 0;
  min-width: 150px;
  min-height: 68px;
  padding: 8px 42px 8px 52px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.acc-card:not(:last-child) {
  border-right: 1px solid rgba(100, 116, 139, 0.16);
}

.accounts-grid .acc-card:nth-last-child(2) {
  border-right: 0;
}

.acc-card::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 10px;
  right: auto;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.66), transparent 50%),
    linear-gradient(135deg, #60a5fa, #2563eb);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.14);
  transform: translateY(-50%);
}

.acc-card::after {
  position: absolute;
  top: 50%;
  left: 18px;
  width: 16px;
  height: 16px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 850;
  line-height: 16px;
  text-align: center;
  z-index: 1;
  transform: translateY(-50%);
}

.acc-total-toggle {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.acc-total-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.acc-total-toggle-slider {
  position: relative;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: #e2e8f0;
  box-shadow: inset 0 0 0 1px rgba(100, 116, 139, 0.18);
  transition:
    background 160ms ease,
    box-shadow 160ms ease;
}

.acc-total-toggle-slider::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.16);
  transition: transform 160ms ease;
}

.acc-total-toggle input:checked + .acc-total-toggle-slider {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  box-shadow: inset 0 0 0 1px rgba(22, 163, 74, 0.18);
}

.acc-total-toggle input:checked + .acc-total-toggle-slider::after {
  transform: translateX(14px);
}

.acc-total-toggle input:disabled + .acc-total-toggle-slider {
  opacity: 0.45;
  cursor: not-allowed;
}

.acc-card-wallet::after {
  content: "₽";
}

.acc-card-business::after,
.acc-card-wallet::after {
  content: "₽";
}

.acc-card-usdt::before {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.66), transparent 50%),
    linear-gradient(135deg, #34d399, #059669);
}

.acc-card-usdt::after {
  content: "₮";
}

.acc-card-fulfillment::before {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.66), transparent 50%),
    linear-gradient(135deg, #fb923c, #f97316);
}

.acc-card-fulfillment::after {
  content: "🚚";
  font-size: 16px;
}

.acc-card-total::before {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.66), transparent 50%),
    linear-gradient(135deg, #60a5fa, #2563eb);
}

.acc-card-total::after {
  content: "₽";
  font-size: 15px;
}

.acc-card-total {
  display: grid;
  align-content: center;
  justify-items: center;
  flex: 1 1 0;
  min-width: 150px;
  padding-right: 42px;
  border-right: 0 !important;
  border-radius: 16px;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.36), transparent 42%),
    linear-gradient(135deg, #4f46e5, #2563eb);
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.22);
  text-align: center;
}

.acc-card-total .acc-name {
  color: rgba(255, 255, 255, 0.82);
  font-weight: 900;
}

.acc-card-total .acc-value {
  color: #ffffff;
  font-size: clamp(18px, 1.05vw, 22px);
  font-weight: 900;
}

.acc-name {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  overflow: visible;
}

.acc-value {
  margin-top: var(--space-2);
  color: var(--text);
  font-size: clamp(18px, 1.05vw, 22px);
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: normal;
  font-variant-numeric: tabular-nums;
}

.acc-subvalue {
  margin-top: var(--space-1);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.metric-value {
  color: var(--text);
  font-size: 28px;
  font-weight: 850;
  letter-spacing: 0;
}

.metric-caption {
  margin-top: var(--space-2);
  color: var(--muted);
  font-size: 12px;
}

.period-label {
  margin-top: var(--space-3);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 800;
}

.task-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.task-summary-card {
  position: relative;
  min-height: 112px;
  padding: 22px 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--task-summary-bg, rgba(255, 255, 255, 0.84));
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.07);
  backdrop-filter: blur(18px);
}

.task-summary-card::before {
  content: "";
  position: absolute;
  top: 22px;
  right: 22px;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #60a5fa, #2563eb);
  opacity: 0.94;
}

.task-summary-progress::before {
  background: linear-gradient(135deg, #fbbf24, #f97316);
}

.task-summary-done::before {
  background: linear-gradient(135deg, #34d399, #16a34a);
}

.task-summary-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.task-summary-value {
  margin-top: var(--space-2);
  color: var(--text);
  font-size: 30px;
  font-weight: 850;
  line-height: 1;
}

.task-assignee-summary-card::before,
.task-summary-empty::before {
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--task-summary-strip, #2563eb) 56%, #ffffff 44%), var(--task-summary-strip, #2563eb));
  box-shadow: 0 12px 28px var(--task-summary-glow, rgba(37, 99, 235, 0.18));
}

.task-assignee-summary-card .task-summary-label {
  max-width: calc(100% - 46px);
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-assignee-summary-rows {
  display: grid;
  gap: 8px;
  margin-top: var(--space-4);
}

.task-assignee-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 750;
  background: rgba(255, 255, 255, 0.62);
}

.task-assignee-summary-row b {
  color: var(--text);
  font-size: 15px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.task-assignee-summary-row.has-waiting-tasks {
  animation: waitingTaskPulse 2.6s ease-in-out infinite;
  border-color: rgba(37, 99, 235, 0.28);
  color: #1d4ed8;
  background: rgba(239, 246, 255, 0.84);
}

.task-assignee-summary-row.has-waiting-tasks b {
  color: #1d4ed8;
}

@keyframes waitingTaskPulse {
  0%,
  100% {
    box-shadow:
      0 0 0 0 rgba(37, 99, 235, 0),
      inset 0 0 0 0 rgba(37, 99, 235, 0);
    background: rgba(239, 246, 255, 0.72);
  }

  50% {
    box-shadow:
      0 0 0 4px rgba(37, 99, 235, 0.08),
      0 8px 22px rgba(37, 99, 235, 0.12),
      inset 0 0 0 1px rgba(37, 99, 235, 0.16);
    background: rgba(219, 234, 254, 0.94);
  }
}

.task-summary-muted {
  margin-top: var(--space-3);
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.task-form {
  display: grid;
  grid-template-columns:
    minmax(220px, 1.25fr)
    minmax(145px, 0.8fr)
    minmax(180px, 0.95fr)
    minmax(140px, 0.7fr)
    minmax(188px, 0.85fr)
    minmax(118px, 0.55fr);
  gap: var(--space-3);
  align-items: start;
}

.task-field {
  position: relative;
  display: block;
  margin: 0;
}

.task-field input,
.task-field select,
.task-field textarea {
  width: 100%;
  font-size: 13px;
  font-weight: 500;
}

.task-form select {
  appearance: none;
  background-image: none;
}

.task-form input[readonly] {
  cursor: pointer;
}

.task-category-dropdown input:focus,
.task-simple-dropdown input:focus {
  border-color: rgba(37, 99, 235, 0.58);
  background: #ffffff;
  box-shadow: var(--cell-shadow-focus);
}

.task-category-menu,
.task-simple-menu {
  top: calc(100% + 6px);
  max-height: 260px;
  padding: 6px;
  border-color: rgba(100, 116, 139, 0.22);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow:
    0 18px 50px rgba(15, 23, 42, 0.18),
    0 2px 8px rgba(15, 23, 42, 0.06);
}

.task-category-menu .dropdown-item,
.task-simple-menu .dropdown-item {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
}

.task-category-menu .dropdown-item:hover,
.task-simple-menu .dropdown-item:hover {
  color: #ffffff;
  background: #6099f6;
}

.task-category-menu .dropdown-item:hover span:last-child,
.task-category-menu .dropdown-item:hover .dropdown-action {
  color: rgba(255, 255, 255, 0.92);
}

.task-category-menu .dropdown-action:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
}

.task-category-menu .dropdown-action.danger:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
}

.task-category-menu .dropdown-add-only {
  margin-top: 4px;
  justify-content: center;
  color: var(--primary);
  background: rgba(37, 99, 235, 0.07);
}

.task-category-menu .dropdown-add-only:hover {
  color: #ffffff;
  background: #6099f6;
}

.task-select-placeholder {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  z-index: 1;
  max-width: calc(100% - 54px);
  overflow: hidden;
  color: var(--muted-2);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
  transform: translateY(-50%);
}

.task-form input::placeholder,
.task-form textarea::placeholder {
  color: var(--muted-2);
  font-size: 13px;
  font-weight: 500;
}

.task-select-field.has-value .task-select-placeholder,
.task-select-field:focus-within.has-value .task-select-placeholder {
  opacity: 0;
}

.task-field-description {
  grid-column: 1 / 6;
}

.task-form textarea {
  min-height: 88px;
  padding: 12px var(--space-3);
  padding-right: 38px;
  resize: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  line-height: 1.45;
  background: rgba(248, 250, 252, 0.86);
  box-shadow: var(--cell-shadow);
}

.task-form textarea:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.58);
  background: #ffffff;
  box-shadow: var(--cell-shadow-focus);
}

#createTaskBtn {
  min-height: 88px;
}

.task-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr)) 100px;
  gap: var(--space-2);
  align-items: center;
}

#tasksTable {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

#tasksTable tr {
  cursor: pointer;
}

#tasksTable .task-row,
#tasksArchiveTable .task-row {
  background:
    linear-gradient(90deg, var(--task-row-strip, transparent) 0 6px, transparent 6px),
    var(--task-row-bg, transparent);
  box-shadow:
    inset 0 -3px 0 #ffffff,
    0 8px 18px var(--task-row-glow, rgba(15, 23, 42, 0.04));
}

#tasksTable .task-row:hover,
#tasksArchiveTable .task-row:hover {
  background:
    linear-gradient(90deg, var(--task-row-strip, transparent) 0 6px, transparent 6px),
    var(--task-row-hover, rgba(37, 99, 235, 0.075));
  box-shadow:
    inset 0 -3px 0 #ffffff,
    0 12px 26px var(--task-row-glow, rgba(15, 23, 42, 0.08));
}

#tasksTable tr.is-selected {
  background: rgba(37, 99, 235, 0.10);
}

#tasksTable .task-row.is-selected,
#tasksArchiveTable .task-row.is-selected {
  background:
    linear-gradient(90deg, var(--task-row-strip, rgba(37, 99, 235, 0.72)) 0 6px, transparent 6px),
    var(--task-row-hover, rgba(239, 246, 255, 0.96));
}

#tasksTable th,
#tasksTable td,
#tasksArchiveTable th,
#tasksArchiveTable td {
  overflow: hidden;
  text-overflow: ellipsis;
}

#tasksTable .task-row td,
#tasksArchiveTable .task-row td {
  border-bottom: 3px solid #ffffff;
}

#tasksTable th,
#tasksArchiveTable th {
  overflow: visible;
}

.page-tasks .table-card,
.page-tasks .table-scroll {
  overflow: visible;
}

#tasksTable th:nth-child(1),
#tasksTable td:nth-child(1),
#tasksArchiveTable th:nth-child(1),
#tasksArchiveTable td:nth-child(1) {
  width: 13%;
}

#tasksTable th:nth-child(2),
#tasksTable td:nth-child(2),
#tasksArchiveTable th:nth-child(2),
#tasksArchiveTable td:nth-child(2) {
  width: 31%;
  text-align: left;
}

#tasksTable th:nth-child(3),
#tasksTable td:nth-child(3),
#tasksArchiveTable th:nth-child(3),
#tasksArchiveTable td:nth-child(3) {
  width: 13%;
}

#tasksTable th:nth-child(4),
#tasksTable td:nth-child(4),
#tasksArchiveTable th:nth-child(4),
#tasksArchiveTable td:nth-child(4) {
  width: 14%;
}

#tasksTable th:nth-child(5),
#tasksTable td:nth-child(5),
#tasksArchiveTable th:nth-child(5),
#tasksArchiveTable td:nth-child(5) {
  width: 10%;
}

#tasksTable th:nth-child(6),
#tasksTable td:nth-child(6),
#tasksArchiveTable th:nth-child(6),
#tasksArchiveTable td:nth-child(6) {
  width: 10%;
}

#tasksTable th:nth-child(7),
#tasksTable td:nth-child(7),
#tasksArchiveTable th:nth-child(7),
#tasksArchiveTable td:nth-child(7) {
  width: 9%;
}

.task-title-cell {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 4px;
  min-width: 0;
  text-align: left;
}

.task-title-cell strong {
  overflow: visible;
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.35;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}

.task-row-event .task-title-cell strong {
  font-size: 14px;
  font-weight: 900;
}

.task-row-event td:empty::after {
  content: "";
  display: inline-block;
  min-height: 1px;
}

.task-strong-cell {
  color: var(--text);
  font-weight: 850;
}

.task-description-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--primary);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.07);
}

.task-description-trigger svg {
  display: block;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.task-description-bubble {
  position: fixed;
  left: 16px;
  top: 16px;
  z-index: 30000;
  width: max-content;
  min-width: 220px;
  max-width: min(520px, calc(100vw - 32px));
  max-height: min(420px, calc(100vh - 32px));
  padding: 12px 14px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.98);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  white-space: pre-wrap;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.16);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px) scale(0.98);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.task-description-bubble.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.task-status-pill,
.task-category-pill,
.task-priority-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  max-width: 100%;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.task-status-planned {
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.18);
  background: #eff6ff;
}

.task-status-in_progress {
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.22);
  background: #fffbeb;
}

.task-status-completed {
  color: #166534;
  border-color: rgba(22, 163, 74, 0.22);
  background: #dcfce7;
}

.task-status-cancelled {
  color: #991b1b;
  border-color: rgba(220, 38, 38, 0.22);
  background: #fee2e2;
}

.task-category-pill {
  color: #3730a3;
  border-color: rgba(79, 70, 229, 0.16);
  background: #eef2ff;
}

.task-category-1,
.task-category-5 {
  color: #047857;
  border-color: rgba(16, 185, 129, 0.18);
  background: #ecfdf5;
}

.task-category-2,
.task-category-7 {
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.20);
  background: #fffbeb;
}

.task-category-3,
.task-category-6 {
  color: #be185d;
  border-color: rgba(236, 72, 153, 0.18);
  background: #fdf2f8;
}

.task-priority-low {
  color: var(--text-soft);
  border-color: var(--line);
  background: #f8fafc;
}

.task-priority-medium {
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.18);
  background: #eff6ff;
}

.task-priority-high {
  color: #c2410c;
  border-color: rgba(249, 115, 22, 0.22);
  background: #fff7ed;
}

.task-priority-critical {
  color: #991b1b;
  border-color: rgba(220, 38, 38, 0.22);
  background: #fee2e2;
}

.task-actions {
  white-space: nowrap;
}

.task-row-icon-action {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0 !important;
}

.task-actions-head {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.task-actions-head span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-actions button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 11px;
}

.task-actions button + button {
  margin-left: var(--space-2);
}

.task-action-secondary {
  color: var(--text-soft);
  border-color: var(--line);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.task-action-secondary:hover:not(:disabled) {
  color: var(--danger);
  border-color: rgba(220, 38, 38, 0.24);
  background: var(--danger-soft);
}

.task-empty-cell {
  height: 96px;
  color: var(--muted);
  font-weight: 750;
  text-align: center !important;
}

.task-archive-card {
  margin-top: var(--space-4);
}

.task-archive-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  min-height: 48px;
  padding: 0 4px;
  border: 0;
  color: var(--text);
  background: transparent;
  box-shadow: none;
  font-size: 15px;
  font-weight: 850;
}

.task-archive-toggle b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  color: #334155;
  background: #f1f5f9;
  font-size: 12px;
  font-weight: 850;
}

.task-archive-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  transition: transform 160ms ease;
}

.task-archive-card:not(.is-collapsed) .task-archive-toggle svg {
  transform: rotate(180deg);
}

.task-archive-body {
  display: block;
  padding-top: var(--space-3);
}

.task-archive-card.is-collapsed .task-archive-body {
  display: none;
}

#tasksArchiveTable {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

#tasksArchiveTable tr {
  cursor: pointer;
}

.category-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5) var(--space-6);
  align-items: stretch;
  width: 100%;
}

.page-categories .table-card .table-scroll {
  width: 100%;
  border-color: transparent;
  background: #ffffff;
  box-shadow: none;
}

.category-breakdown-group {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.38);
  border-radius: var(--radius-md);
  background: #ffffff;
  box-shadow:
    0 14px 34px rgba(15, 23, 42, 0.07),
    0 2px 6px rgba(37, 99, 235, 0.05);
  transition:
    box-shadow 160ms ease,
    transform 160ms ease;
}

.category-breakdown-group:hover {
  box-shadow:
    0 18px 42px rgba(15, 23, 42, 0.09),
    0 3px 10px rgba(37, 99, 235, 0.07);
  transform: translateY(-1px);
}

.category-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-height: 58px;
  padding: 12px;
  border-bottom: 1px solid rgba(37, 99, 235, 0.14);
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.98), rgba(229, 237, 255, 0.82));
}

.category-total-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  max-width: 100%;
  padding: 0 14px;
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 999px;
  color: var(--primary);
  font-weight: 850;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.08);
}

.category-total-amount-pill {
  min-width: 118px;
  white-space: nowrap;
  margin-left: auto;
}

#catTable .subcategory-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-4);
  align-items: center;
  min-height: 42px;
  padding: 9px 14px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.78);
  background: #ffffff;
}

#catTable .subcategory-row:nth-child(odd) {
  background: rgba(248, 250, 252, 0.7);
}

#catTable .subcategory-row:last-child {
  border-bottom: 0;
}

#catTable .subcategory-name-cell {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subcategory-amount-cell {
  color: var(--text);
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.annual-report-card {
  padding: 28px 26px;
}

.annual-report-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.annual-report-head h3 {
  margin: 0;
}

.annual-report-head h2 {
  margin: 0;
}

.annual-report-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.annual-report-year-select {
  width: auto;
  min-width: 104px;
  height: 42px;
  padding: 0 38px 0 16px;
  border-radius: 999px;
  color: var(--primary);
  border-color: rgba(37, 99, 235, 0.18);
  background-color: rgba(239, 246, 255, 0.82);
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.08);
}

.annual-report-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.annual-report-scroll {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  overflow: auto;
}

.annual-report-table {
  width: max-content;
  min-width: 1280px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  white-space: normal;
}

.annual-report-table th,
.annual-report-table td {
  width: 122px;
  min-width: 122px;
  max-width: 122px;
  padding: 14px 12px;
  text-align: center;
  vertical-align: middle;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.annual-report-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  height: 72px;
  color: var(--text-muted);
  background: #f8fafc;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.16;
  text-transform: uppercase;
  letter-spacing: 0;
}

.annual-report-table thead th span {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.annual-report-table thead th em {
  display: block;
  font-style: normal;
}

.annual-report-table .annual-report-month-head,
.annual-report-table .annual-report-month-cell {
  position: sticky;
  left: 0;
  z-index: 12;
  width: 180px;
  min-width: 180px;
  max-width: 180px;
  text-align: left;
  background: #ffffff;
  box-shadow: 14px 0 24px rgba(15, 23, 42, 0.08);
  background-clip: padding-box;
}

.annual-report-table .annual-report-month-head {
  z-index: 20;
  text-align: center;
  background: #f8fafc;
}

.annual-report-month-cell {
  font-weight: 900;
}

.annual-report-month-row {
  color: var(--text);
  font-weight: 900;
}

.annual-report-month-row .annual-report-month-cell {
  background: #ffffff;
}

.annual-report-month-row .annual-report-manual {
  background: #eaf3ff;
}

.annual-report-month-row .annual-report-api,
.annual-report-month-row .annual-report-formula,
.annual-report-month-row .annual-report-formula-percent {
  background: #fff;
}

.annual-report-cabinet-row {
  color: var(--text);
  animation: annualReportRowIn 160ms ease both;
}

.annual-report-cabinet-row .annual-report-month-cell {
  background: #ffffff;
}

.annual-report-cabinet-row .annual-report-manual {
  background: #eef6ff;
}

.annual-report-cabinet-row .annual-report-api,
.annual-report-cabinet-row .annual-report-formula,
.annual-report-cabinet-row .annual-report-formula-percent {
  background: rgba(255, 255, 255, 0.92);
}

.annual-report-table tfoot th {
  position: sticky;
  bottom: 0;
  z-index: 2;
  color: var(--text);
  background: #eef4ff;
  font-weight: 950;
}

.annual-report-table tfoot th:first-child {
  left: 0;
  z-index: 18;
  box-shadow: 14px 0 24px rgba(15, 23, 42, 0.08);
}

.annual-report-expand-btn {
  display: inline-grid;
  width: 32px;
  height: 32px;
  margin-right: 8px;
  padding: 0;
  place-items: center;
  border-radius: 999px;
  background: #fff;
  color: var(--primary);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.1);
}

.annual-report-expand-btn svg {
  width: 16px;
  height: 16px;
  transition: transform 0.18s ease;
}

.annual-report-month-row.is-expanded .annual-report-expand-btn svg {
  transform: rotate(90deg);
}

.annual-report-input {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font: inherit;
  font-weight: 850;
  text-align: center;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.annual-report-input:focus {
  border-color: rgba(37, 99, 235, 0.42);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

@keyframes annualReportRowIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.annual-report-app {
  width: min(100% - 32px, 1720px);
  margin: 0 auto 44px;
  padding: 26px 0 0;
}

.annual-dashboard-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 18px;
}

.annual-dashboard-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--primary);
  font-size: 14px;
  font-weight: 900;
}

.annual-save-status {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(239, 246, 255, 0.92);
  color: #64748b;
  font-size: 12px;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.1);
}

.annual-dashboard-hero h1 {
  margin: 8px 0 0;
  color: var(--text);
  font-size: clamp(34px, 4vw, 54px);
  font-weight: 950;
  letter-spacing: 0;
}

.annual-dashboard-controls {
  display: none;
  justify-content: flex-end;
}

.annual-cabinet-profit {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.annual-cabinet-profit-card,
.annual-kpi-card,
.annual-chart-card,
.annual-months-card,
.annual-month-card,
.annual-month-field,
.annual-return-card {
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.06);
}

.annual-cabinet-profit-card {
  min-height: 96px;
  padding: 18px;
  border-radius: 20px;
}

.annual-cabinet-profit-card span,
.annual-kpi-card span,
.annual-month-field span,
.annual-return-card span {
  display: block;
  color: #475569;
  font-size: 13px;
  font-weight: 850;
}

.annual-cabinet-profit-card strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 27px;
  font-weight: 950;
}

.annual-cabinet-profit-card em,
.annual-month-field em,
.annual-return-card em {
  display: block;
  margin-top: 4px;
  color: #94a3b8;
  font-size: 12px;
  font-style: normal;
  font-weight: 750;
}

.annual-kpi-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.annual-kpi-card {
  min-height: 136px;
  padding: 20px 16px;
  border-radius: 22px;
}

.annual-kpi-card strong {
  display: block;
  margin-top: 18px;
  color: #020617;
  font-size: clamp(24px, 2vw, 34px);
  font-weight: 950;
  line-height: 1;
}

.annual-kpi-blue { background: linear-gradient(135deg, #eef6ff, #ffffff); }
.annual-kpi-violet { background: linear-gradient(135deg, #f4f0ff, #ffffff); }
.annual-kpi-amber { background: linear-gradient(135deg, #fff8db, #ffffff); }
.annual-kpi-green,
.annual-kpi-emerald { background: linear-gradient(135deg, #dcfce7, #ffffff); }
.annual-kpi-sky { background: linear-gradient(135deg, #e0f2fe, #ffffff); }
.annual-kpi-red { background: linear-gradient(135deg, #fee2e2, #ffffff); }

.annual-chart-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.annual-chart-card {
  height: 285px;
  padding: 18px 16px 14px;
  border-radius: 20px;
}

.annual-chart-card h3 {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
}

.annual-bars {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: end;
  gap: 5px;
  height: 215px;
}

.annual-bar-item {
  display: grid;
  height: 100%;
  grid-template-rows: 1fr auto;
  align-items: end;
  gap: 7px;
}

.annual-bar-item span {
  display: block;
  min-height: 4px;
  border-radius: 8px 8px 0 0;
  background: #6366f1;
}

.annual-chart-profit .annual-bar-item span { background: #4f46e5; }
.annual-chart-ads .annual-bar-item span { background: #818cf8; }
.annual-chart-margin .annual-bar-item span { background: #22c55e; }

.annual-bar-item em {
  color: #64748b;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  text-align: center;
}

.annual-months-card {
  padding: 18px;
  border-radius: 24px;
}

.annual-section-title {
  margin-bottom: 14px;
}

.annual-section-title h2 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  font-weight: 950;
}

.annual-section-title p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.annual-month-list {
  display: grid;
  gap: 10px;
}

.annual-month-card {
  overflow: hidden;
  border-radius: 18px;
}

.annual-month-card.is-open {
  border-color: rgba(34, 197, 94, 0.22);
  background: #f6fff8;
}

.annual-month-summary {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(150px, 1.15fr) repeat(9, minmax(72px, 1fr)) minmax(88px, auto);
  align-items: center;
  gap: 0;
  padding: 12px 14px;
  border: 0;
  background: transparent;
  text-align: left;
}

.annual-month-name {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.annual-chevron {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 20px;
  font-weight: 900;
}

.annual-month-name i {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 999px;
}

.annual-month-name strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 950;
}

.annual-summary-metric {
  min-width: 0;
  padding: 0 9px;
  border-left: 1px solid rgba(226, 232, 240, 0.8);
}

.annual-summary-metric em {
  display: block;
  color: #64748b;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.35;
}

.annual-summary-metric strong {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.annual-summary-metric strong.is-good,
.annual-detail-table .is-positive,
.annual-return-card strong {
  color: #16a34a;
}

.annual-detail-table .is-negative {
  color: #dc2626;
}

.annual-month-status {
  justify-self: end;
  padding: 5px 9px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 11px;
  font-weight: 950;
  white-space: nowrap;
}

.annual-month-status.is-strong,
.annual-month-name i.is-strong { background: #dcfce7; color: #16a34a; }
.annual-month-name i.is-strong { background: #22c55e; }
.annual-month-status.is-normal,
.annual-month-name i.is-normal { background: #e0e7ff; color: #4f46e5; }
.annual-month-name i.is-normal { background: #6366f1; }
.annual-month-status.is-weak,
.annual-month-name i.is-weak { background: #fef3c7; color: #d97706; }
.annual-month-name i.is-weak { background: #f59e0b; }
.annual-month-status.is-bad,
.annual-month-name i.is-bad { background: #fee2e2; color: #dc2626; }
.annual-month-name i.is-bad { background: #ef4444; }
.annual-month-status.is-empty,
.annual-month-name i.is-empty { background: #f1f5f9; color: #64748b; }
.annual-month-name i.is-empty { background: #cbd5e1; }

.annual-month-details {
  padding: 14px;
  border-top: 1px solid rgba(187, 247, 208, 0.8);
  background: #f0fdf4;
}

.annual-detail-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 18px;
  background: #fff;
}

.annual-detail-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  table-layout: fixed;
}

.annual-detail-project-col {
  width: 22%;
}

.annual-detail-table th,
.annual-detail-table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.78);
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
  text-align: right;
  vertical-align: middle;
}

.annual-detail-table th {
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.annual-detail-table th:first-child,
.annual-detail-table td:first-child {
  text-align: left;
}

.annual-detail-table tbody tr:last-child td {
  border-bottom: 0;
}

.annual-cabinet-cell {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.annual-cabinet-cell > span {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  background: #f5f3ff;
  color: #6d28d9;
  font-size: 10px;
  font-weight: 950;
}

.annual-cabinet-cell > .annual-cabinet-badge-wb {
  background: linear-gradient(135deg, #a21caf, #7c3aed);
  color: #fff;
}

.annual-cabinet-cell > .annual-cabinet-badge-ozon {
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: #fff;
}

.annual-cabinet-cell strong,
.annual-cabinet-cell em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.annual-cabinet-cell strong {
  font-size: 12px;
}

.annual-cabinet-cell em {
  margin-top: 2px;
  color: #64748b;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.annual-money-input {
  display: inline-flex;
  width: min(100%, 116px);
  height: 36px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 10px;
  background: #fff;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.annual-money-input:focus-within {
  border-color: rgba(79, 70, 229, 0.44);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.annual-money-input input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 950;
  outline: none;
  text-align: right;
}

.annual-money-input span {
  padding-right: 7px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 900;
}

.annual-month-settings {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.annual-month-field,
.annual-return-card {
  min-height: 116px;
  padding: 16px;
  border-radius: 18px;
}

.annual-money-input-wide {
  margin-top: 12px;
  width: 100%;
  max-width: 180px;
}

.annual-return-card strong {
  display: block;
  margin-top: 14px;
  font-size: 21px;
  font-weight: 950;
}

.annual-dashboard-controls {
  display: none;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-bottom: 18px;
}

.annual-year-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 142px;
  height: 56px;
  border: 1px solid rgba(191, 219, 254, 0.96);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.13);
}

.annual-year-pill::after {
  content: "⌄";
  position: absolute;
  right: 22px;
  top: 50%;
  color: #2563eb;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  transform: translateY(-55%);
  pointer-events: none;
}

.annual-report-year-select {
  width: 100%;
  height: 100%;
  padding: 0 48px 0 28px;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: #2563eb;
  font-size: 22px;
  font-weight: 950;
  letter-spacing: 0;
  outline: none;
  appearance: none;
}

.annual-dashboard-hero {
  position: relative;
  display: grid;
  min-height: 220px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
  overflow: hidden;
  margin-bottom: 30px;
  padding: 42px 64px 44px;
  border: 1px solid rgba(191, 219, 254, 0.7);
  border-radius: 26px;
  background:
    radial-gradient(circle at 68% 45%, rgba(255, 255, 255, 0.98) 0 42px, transparent 43px),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(248, 252, 255, 0.96));
  box-shadow: 0 28px 70px rgba(37, 99, 235, 0.12);
}

.annual-hero-year-picker {
  position: absolute;
  right: 22px;
  bottom: 22px;
  z-index: 2;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(147, 197, 253, 0.75);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.12);
  cursor: pointer;
}

.annual-hero-year-picker::before {
  content: "";
  width: 12px;
  height: 12px;
  border-right: 3px solid #2563eb;
  border-bottom: 3px solid #2563eb;
  transform: translateY(-3px) rotate(45deg);
  pointer-events: none;
}

.annual-hero-year-picker .annual-report-year-select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

.annual-dashboard-hero::before,
.annual-dashboard-hero::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.annual-dashboard-hero::before {
  right: -145px;
  bottom: -135px;
  width: 630px;
  height: 330px;
  border-radius: 55% 45% 0 0;
  background:
    linear-gradient(145deg, rgba(219, 234, 254, 0.16), rgba(96, 165, 250, 0.36)),
    repeating-radial-gradient(circle at 74% 42%, rgba(255, 255, 255, 0.76) 0 1px, transparent 1px 16px);
  transform: rotate(-11deg);
}

.annual-dashboard-hero::after {
  right: 250px;
  top: -155px;
  width: 430px;
  height: 430px;
  border: 1px solid rgba(147, 197, 253, 0.34);
  border-left-color: transparent;
  border-bottom-color: transparent;
  border-radius: 50%;
  transform: rotate(18deg);
}

.annual-hero-content,
.annual-hero-year {
  position: relative;
  z-index: 1;
  align-self: end;
}

.annual-hero-content span {
  display: block;
  color: #334155;
  font-size: clamp(24px, 2vw, 34px);
  font-weight: 650;
}

.annual-hero-content strong {
  display: block;
  margin-top: 28px;
  color: #031450;
  font-size: clamp(44px, 4.7vw, 72px);
  font-weight: 760;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
}

.annual-hero-year {
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding-bottom: 6px;
  padding-right: 4px;
}

.annual-hero-year strong {
  color: #031450;
  font-size: clamp(62px, 6vw, 98px);
  font-weight: 420;
  letter-spacing: 0;
  line-height: 0.9;
}

.annual-hero-year span {
  color: #031450;
  font-size: clamp(18px, 1.6vw, 26px);
  font-weight: 500;
}

.annual-kpi-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.annual-kpi-card {
  min-height: 150px;
  padding: 22px 20px 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 22px 58px rgba(15, 23, 42, 0.08);
}

.annual-kpi-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 999px;
  background: #eaf4ff;
  color: #2563eb;
}

.annual-kpi-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.annual-kpi-card span {
  margin-top: 16px;
  color: #0f2a55;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.2;
}

.annual-kpi-card strong {
  margin-top: 14px;
  color: #031450;
  font-size: clamp(24px, 1.9vw, 31px);
  line-height: 1;
  white-space: nowrap;
}

.annual-kpi-red .annual-kpi-icon {
  background: #fee2e2;
  color: #dc2626;
}

.annual-cabinet-profit {
  display: block;
  margin-bottom: 28px;
  padding: 22px 30px 28px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 22px 58px rgba(15, 23, 42, 0.07);
}

.annual-cabinet-profit h2 {
  margin: 0 0 24px;
  color: #0f2a55;
  font-size: 20px;
  font-weight: 850;
}

.annual-marketplace-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
}

.annual-cabinet-profit-card {
  display: flex;
  min-height: 100px;
  align-items: center;
  gap: 30px;
  padding: 0 42px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.annual-cabinet-profit-card + .annual-cabinet-profit-card {
  border-left: 1px solid rgba(191, 219, 254, 0.95);
}

.annual-marketplace-logo {
  display: grid;
  width: 74px;
  height: 74px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  font-size: 32px;
  font-weight: 950;
  letter-spacing: -1px;
  text-transform: lowercase;
}

.annual-marketplace-wb {
  background: linear-gradient(135deg, #a21caf, #7c3aed);
}

.annual-marketplace-ozon {
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  font-size: 23px;
  letter-spacing: 0;
}

.annual-cabinet-profit-card span {
  color: #0f2a55;
  font-size: 18px;
  font-weight: 650;
}

.annual-cabinet-profit-card strong {
  margin-top: 8px;
  color: #031450;
  font-size: clamp(28px, 2.4vw, 38px);
  line-height: 1;
}

.annual-cabinet-profit-card em {
  display: none;
}

@media (max-width: 1320px) {
  .annual-kpi-grid,
  .annual-chart-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .annual-month-summary {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .annual-summary-metric {
    border-left: 0;
    padding: 0;
  }
}

@media (max-width: 820px) {
  .annual-report-app {
    width: min(100% - 18px, 1720px);
  }

  .annual-dashboard-hero,
  .annual-cabinet-profit,
  .annual-month-settings {
    grid-template-columns: 1fr;
  }

  .annual-dashboard-hero {
    display: grid;
  }

  .annual-kpi-grid,
  .annual-chart-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .category-breakdown-grid {
    grid-template-columns: 1fr;
  }
}

.financial-calendar-card h2,
.financial-calendar-head h2 {
  margin: 0 0 var(--space-4);
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
}

.financial-calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.financial-calendar-period {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 999px;
  color: var(--primary);
  background: rgba(239, 246, 255, 0.84);
  font-size: 12px;
  font-weight: 850;
}

.financial-plan-table {
  table-layout: fixed;
  min-width: 1180px;
}

.financial-plan-table th,
.financial-plan-table td {
  text-align: center;
  vertical-align: middle;
}

.financial-plan-table th:first-child,
.financial-plan-table td:first-child {
  width: 120px;
}

.financial-plan-table th:nth-child(6),
.financial-plan-table td:nth-child(6) {
  width: 340px;
  text-align: left;
}

.financial-plan-table th:last-child,
.financial-plan-table td:last-child {
  width: 130px;
}

.financial-current-week-row td {
  background: rgba(241, 245, 249, 0.92);
  color: #475569;
}

.financial-current-week-row .financial-total-cell {
  color: #475569;
}

.financial-week-date small {
  display: block;
  margin-top: 5px;
  color: #64748b;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: lowercase;
  white-space: nowrap;
}

.financial-source-head {
  display: inline-grid;
  gap: 2px;
  line-height: 1.1;
}

.financial-source-head small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: none;
}

.financial-week-date,
.financial-total-cell {
  color: var(--text);
  font-weight: 900;
}

.financial-total-cell {
  color: #166534;
}

.financial-total-cell.is-negative {
  color: var(--danger);
}

.financial-expense-total-cell {
  color: var(--danger);
  font-weight: 900;
  white-space: nowrap;
}

.financial-loading-cell {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.financial-error-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 160px;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid rgba(239, 68, 68, 0.18);
  border-radius: 999px;
  color: #b91c1c;
  background: rgba(254, 242, 242, 0.88);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.2;
  white-space: normal;
}

.financial-expense-notes {
  line-height: 1.45;
}

.financial-expense-notes span {
  display: block;
  margin: 2px 0;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 750;
  white-space: normal;
}

.muted-cell {
  color: var(--muted) !important;
}

.tax-summary-card h2,
.tax-summary-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
}

.tax-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}

.tax-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.tax-refresh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 999px;
  color: var(--primary);
  background: rgba(239, 246, 255, 0.88);
  box-shadow: none;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.tax-refresh-btn svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.tax-refresh-btn:hover:not(:disabled) {
  border-color: rgba(37, 99, 235, 0.28);
  background: rgba(219, 234, 254, 0.96);
  box-shadow: none;
}

.tax-refresh-btn:disabled {
  cursor: wait;
  opacity: 0.62;
}

.tax-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}

.tax-summary-item {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: var(--radius-md);
  background: rgba(248, 250, 252, 0.84);
}

.tax-summary-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.tax-summary-item strong {
  color: var(--text);
  font-size: 18px;
  font-weight: 950;
  line-height: 1.2;
}

.taxes-table {
  table-layout: fixed;
  min-width: 860px;
}

.taxes-table th,
.taxes-table td {
  text-align: right;
  vertical-align: middle;
}

.taxes-table th:first-child,
.taxes-table td:first-child {
  width: 180px;
  text-align: left;
}

.taxes-table th:last-child,
.taxes-table td:last-child,
.taxes-table tfoot th {
  color: var(--text);
  font-weight: 950;
}

.tax-month-cell {
  color: var(--text);
  font-weight: 900;
}

.tax-value {
  display: block;
  color: var(--text);
  font-weight: 900;
  white-space: nowrap;
}

.tax-base {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.tax-total-cell {
  color: #166534;
  font-weight: 950;
  white-space: nowrap;
}

.taxes-table tfoot th {
  border-top: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(239, 246, 255, 0.86);
}

.tax-status-row td {
  text-align: left;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: normal;
}

.costing-table-head,
.costing-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}

.costing-table-head h2,
.costing-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
}

.costing-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
}

.costing-summary-item {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: var(--radius-md);
  background: rgba(248, 250, 252, 0.84);
}

.costing-summary-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.costing-summary-item strong {
  color: var(--text);
  font-size: 18px;
  font-weight: 950;
  line-height: 1.2;
}

.costing-table-card {
  padding-bottom: 18px;
  background: rgba(255, 255, 255, 0.98);
}

.costing-scroll {
  max-height: none;
  overflow-x: hidden;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  background: #ffffff;
}

.costing-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.costing-col-expand {
  width: 52px;
}

.costing-col-photo {
  width: 86px;
}

.costing-col-article-main {
  width: 15%;
}

.costing-col-qty,
.costing-col-price {
  width: 12%;
}

.costing-col-date {
  width: 13%;
}

.costing-col-total {
  width: 16%;
}

.costing-col-unit {
  width: 18%;
}

.costing-col-article {
  width: 70px;
  min-width: 70px;
}

.costing-table thead th {
  position: sticky;
  top: 0;
  z-index: 6;
  height: 58px;
  padding: 10px 12px;
  overflow: visible;
  white-space: normal;
  vertical-align: middle;
  line-height: 1.12;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
  border-right: 1px solid rgba(148, 163, 184, 0.16);
  border-bottom: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(248, 250, 252, 0.96);
  color: #64748b;
  font-size: 11px;
  font-weight: 950;
  text-align: center;
  text-transform: uppercase;
}

.costing-th-label {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 46px;
  gap: 2px;
}

.costing-th-label span {
  display: block;
  max-width: 100%;
  overflow: visible;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.12;
  text-align: center;
  text-transform: uppercase;
  white-space: normal;
}

.costing-highlight-head {
  background: rgba(239, 246, 255, 0.98) !important;
}

.costing-highlight-head .costing-th-label span {
  color: #1d4ed8;
}

.costing-table tfoot th {
  position: sticky;
  bottom: 0;
  z-index: 5;
  color: var(--text);
  background: rgba(239, 246, 255, 0.96);
  font-weight: 950;
  white-space: nowrap;
}

.costing-table th,
.costing-table td {
  padding: 10px;
  font-size: 13px;
  vertical-align: middle;
  text-align: center;
  border-right: 1px solid rgba(148, 163, 184, 0.12);
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.costing-table th:last-child,
.costing-table td:last-child {
  border-right: 0;
}

.costing-table input {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 8px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  text-align: center;
  outline: none;
  box-shadow: none;
}

.costing-input-shell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  gap: 5px;
  margin: 0 auto;
  white-space: nowrap;
}

.costing-table input.costing-auto-input {
  width: min(max(var(--input-width, 9ch), var(--input-min-width, 64px)), var(--input-max-width, 160px), 100%);
  min-width: min(var(--input-min-width, 64px), 100%);
  max-width: 100%;
}

.costing-input-suffix {
  flex: 0 0 auto;
  color: #334155;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  min-width: 14px;
  text-align: left;
}

.costing-currency-shell {
  padding-right: 2px;
}

.costing-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.costing-count-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 10px;
  background: rgba(241, 245, 249, 0.95);
  color: #64748b;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.costing-add-btn-top {
  margin-left: auto;
}

.costing-summary-row {
  --row-tint: rgba(248, 250, 252, 0.96);
  background: color-mix(in srgb, var(--row-tint) 40%, #ffffff 60%);
}

.costing-summary-row.is-expanded {
  box-shadow: inset 4px 0 0 #22c55e;
}

.costing-summary-row td {
  height: 70px;
  background: color-mix(in srgb, var(--row-tint) 34%, #ffffff 66%);
}

.costing-summary-row:hover td {
  background: color-mix(in srgb, var(--row-tint) 46%, #ffffff 54%);
}

.costing-expand-cell {
  text-align: center;
}

.costing-expand-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 999px;
  background: rgba(239, 246, 255, 0.92);
  color: #2563eb;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.costing-expand-btn:hover {
  border-color: rgba(37, 99, 235, 0.32);
  background: rgba(219, 234, 254, 0.96);
}

.costing-expand-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.18s ease;
}

.costing-expand-btn[aria-expanded="true"] svg {
  transform: rotate(90deg);
}

.costing-product-cell {
  text-align: center;
}

.costing-photo-cell {
  overflow: visible;
}

.costing-product-image-wrap {
  position: relative;
  display: inline-grid;
  place-items: center;
}

.costing-product-image {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 58px;
  height: 58px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.95);
  color: #64748b;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    transform 0.18s ease;
}

.costing-product-image:not(.costing-product-placeholder) {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.costing-product-image:hover {
  border-color: rgba(37, 99, 235, 0.32);
  background: rgba(239, 246, 255, 0.96);
  transform: translateY(-1px);
}

.costing-product-image:not(.costing-product-placeholder):hover {
  border-color: transparent;
  background: transparent;
}

.costing-product-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.costing-product-placeholder svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.costing-image-input {
  display: none;
}

.costing-main-input {
  width: min(max(var(--input-width, 9ch), var(--input-min-width, 64px)), var(--input-max-width, 160px), 100%);
  min-width: 0;
  height: 36px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 850;
  text-align: center;
}

.costing-article-main {
  min-width: 58px;
  max-width: 150px;
  text-align: center;
}

.costing-main-value {
  color: #0f172a;
  font-size: 14px;
  font-weight: 850;
  white-space: nowrap;
}

.costing-main-date {
  color: #334155;
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
}

.costing-purchase-total {
  font-weight: 950;
}

.costing-unit-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(220, 252, 231, 0.95);
  color: #16a34a;
  font-weight: 950;
  white-space: nowrap;
}

.costing-details-row td {
  padding: 0 28px 24px;
  border-right: 0;
  background: #ede9fe;
}

.costing-details-panel {
  display: grid;
  gap: 18px;
  margin: 0;
  padding: 24px 28px;
  border: 1px solid rgba(139, 92, 246, 0.22);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(237, 233, 254, 0.82), rgba(245, 243, 255, 0.96));
  box-shadow:
    inset 4px 0 0 rgba(124, 58, 237, 0.68),
    0 16px 34px rgba(15, 23, 42, 0.08);
}

.costing-finance-grid,
.costing-payment-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.costing-metric-card,
.costing-payment-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
}

.costing-metric-card span,
.costing-payment-card span,
.costing-detail-field span,
.costing-detail-readout span,
.costing-detail-label {
  color: #64748b;
  font-size: 12px;
  font-weight: 850;
}

.costing-payment-card {
  position: relative;
  align-content: start;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
}

.costing-payment-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}

.costing-info-wrap {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}

.costing-info-btn {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  border: 1px solid rgba(99, 102, 241, 0.24);
  border-radius: 999px;
  color: #4f46e5;
  font-size: 11px;
  font-weight: 950;
  line-height: 1;
  background: rgba(238, 242, 255, 0.92);
  box-shadow: none;
  cursor: default;
}

.costing-info-btn:hover,
.costing-info-btn:focus-visible {
  transform: none;
  color: #3730a3;
  border-color: rgba(99, 102, 241, 0.4);
  background: #eef2ff;
  box-shadow: 0 6px 14px rgba(79, 70, 229, 0.14);
}

.costing-info-tooltip {
  position: absolute;
  right: -10px;
  top: calc(100% + 10px);
  z-index: 120;
  display: grid;
  gap: 6px;
  width: max-content;
  min-width: 210px;
  max-width: 270px;
  padding: 12px 14px;
  border: 1px solid rgba(79, 70, 229, 0.16);
  border-radius: 12px;
  color: #334155;
  text-align: left;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18);
  transition:
    opacity 140ms ease,
    visibility 140ms ease,
    transform 140ms ease;
}

.costing-payment-card .costing-info-tooltip {
  color: #334155;
  font-size: 12px;
  font-weight: 750;
}

.costing-info-wrap:hover .costing-info-tooltip,
.costing-info-wrap:focus-within .costing-info-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.costing-info-tooltip::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 15px;
  width: 10px;
  height: 10px;
  border-left: 1px solid rgba(79, 70, 229, 0.16);
  border-top: 1px solid rgba(79, 70, 229, 0.16);
  background: rgba(255, 255, 255, 0.98);
  transform: rotate(45deg);
}

.costing-info-tooltip strong {
  color: #475569;
  font-size: 12px;
  font-weight: 900;
}

.costing-info-tooltip em {
  color: #16a34a;
  font-size: 15px;
  font-style: normal;
  font-weight: 950;
}

.costing-info-tooltip small,
.costing-info-breakdown {
  color: #64748b;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.35;
}

.costing-info-breakdown {
  display: grid;
  gap: 3px;
}

.costing-info-breakdown b {
  color: #475569;
  font-weight: 900;
}

.costing-info-breakdown span {
  color: #64748b;
  font-size: 11px;
  font-weight: 750;
}

.costing-payment-card .costing-payment-amount {
  width: min(max(var(--input-width, 11ch), var(--input-min-width, 94px)), var(--input-max-width, 170px), 100%);
  height: 38px;
  color: #0f172a;
  font-size: 15px;
  font-weight: 950;
}

.costing-payment-date,
.costing-payment-date-input {
  width: 100%;
  min-height: 34px;
  margin: 0;
  padding: 0 10px;
  border-color: rgba(37, 99, 235, 0.14);
  color: #334155;
  font-size: 12px;
  font-weight: 850;
  text-align: center;
  background: rgba(239, 246, 255, 0.72);
}

.costing-payment-date-input {
  cursor: pointer;
}

.costing-payment-date-input.is-missing-date {
  border-color: rgba(239, 68, 68, 0.58);
  background: rgba(254, 242, 242, 0.9);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
  color: #991b1b;
}

.costing-metric-card strong {
  color: #0f172a;
  font-size: 15px;
  font-weight: 900;
}

.costing-metric-card em {
  color: #334155;
  font-size: 12px;
  font-style: normal;
  font-weight: 750;
}

.costing-metric-card.is-important strong {
  color: #16a34a;
}

.costing-progress {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
  gap: 0;
  padding: 4px 42px 0;
}

.costing-progress-step {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 7px;
  min-width: 0;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.costing-progress-step::before {
  content: "";
  position: absolute;
  top: 10px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: rgba(148, 163, 184, 0.28);
}

.costing-progress-step:first-child::before {
  display: none;
}

.costing-progress-step span {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 2px solid rgba(148, 163, 184, 0.36);
  border-radius: 999px;
  background: #ffffff;
  color: #ffffff;
  font-size: 11px;
  font-weight: 950;
}

.costing-progress-step.is-done::before,
.costing-progress-step.is-done span {
  border-color: #22c55e;
  background: #22c55e;
}

.costing-progress-step.is-done::before {
  background: #22c55e;
}

.costing-progress-step.is-current span {
  border-color: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
}

.costing-progress-step em {
  font-style: normal;
  line-height: 1.2;
}

.costing-date-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.costing-date-card {
  display: grid;
  align-items: center;
  justify-items: center;
  gap: 8px;
  min-height: 64px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
  text-align: center;
  pointer-events: none;
}

.costing-date-card-box {
  border-color: rgba(37, 99, 235, 0.18);
  background: rgba(219, 234, 254, 0.72);
}

.costing-date-card-box .costing-date-icon {
  background: #dbeafe;
  color: #2563eb;
}

.costing-date-card-ship {
  border-color: rgba(217, 119, 6, 0.2);
  background: rgba(254, 243, 199, 0.78);
}

.costing-date-card-ship .costing-date-icon {
  background: #fef3c7;
  color: #d97706;
}

.costing-date-card-plane {
  border-color: rgba(22, 163, 74, 0.28);
  background: rgba(187, 247, 208, 0.88);
}

.costing-date-card-plane .costing-date-icon {
  background: #bbf7d0;
  color: #15803d;
}

.costing-date-card-text {
  display: grid;
  justify-items: center;
  gap: 4px;
  text-align: center;
}

.costing-date-card-text strong {
  color: #475569;
  font-size: 13px;
  font-weight: 900;
}

.costing-date-card-text em {
  color: #334155;
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
}

.costing-date-icon {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(239, 246, 255, 0.96);
  color: #2563eb;
}

.costing-date-icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.costing-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding-top: 2px;
}

.costing-detail-utility-grid {
  display: grid;
  grid-template-columns:
    minmax(126px, 1.05fr)
    minmax(118px, 0.9fr)
    minmax(112px, 0.85fr)
    minmax(118px, 0.9fr)
    minmax(124px, 0.95fr)
    minmax(112px, 0.85fr)
    minmax(128px, 1fr)
    minmax(72px, 0.48fr)
    minmax(82px, 0.55fr);
  align-items: stretch;
  gap: 10px;
}

.costing-detail-field,
.costing-detail-readout,
.costing-detail-tools {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 10px 9px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.065);
}

.costing-detail-utility-grid .costing-detail-field,
.costing-detail-utility-grid .costing-detail-tools {
  grid-template-rows: 22px auto;
  align-content: start;
  justify-items: center;
  text-align: center;
}

.costing-detail-utility-grid .costing-detail-field > span:first-child,
.costing-detail-utility-grid .costing-detail-label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  max-width: 100%;
  min-height: 22px;
  color: #64748b;
  font-size: 10.5px;
  font-weight: 850;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  overflow: visible;
}

.costing-detail-utility-grid .costing-input-shell {
  justify-self: center;
}

.costing-detail-field input {
  width: min(max(var(--input-width, 9ch), var(--input-min-width, 68px)), var(--input-max-width, 150px), 100%);
}

.costing-detail-field-componentsYuan {
  justify-items: center;
}

.costing-detail-field-componentsYuan input {
  width: min(max(var(--input-width, 11ch), var(--input-min-width, 94px)), 160px, 100%);
}

.costing-detail-readout strong {
  color: #0f172a;
  font-size: 14px;
  font-weight: 900;
}

.costing-detail-readout.is-strong strong {
  color: #16a34a;
}

.costing-detail-tools {
  align-items: start;
  justify-items: center;
}

.costing-usd-tool {
  justify-items: center;
}

.costing-usd-tool input {
  width: min(max(var(--input-width, 6ch), var(--input-min-width, 58px)), 92px, 100%);
  height: 34px;
}

.costing-color-tool,
.costing-delete-tool {
  align-content: center;
}

.costing-table input:focus {
  border-color: rgba(37, 99, 235, 0.36);
  box-shadow: var(--cell-shadow-focus);
}

.costing-date-row td {
  height: 40px;
  padding: 4px 6px;
  border-bottom-color: rgba(15, 23, 42, 0.16);
}

.costing-date-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(168px, 1fr));
  align-items: center;
  justify-items: center;
  width: min(760px, 100%);
  margin: 0 auto;
  gap: 20px;
}

.costing-date-control {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  min-width: 0;
  max-width: 100%;
  margin: 0 auto;
  padding: 4px 7px;
  gap: 5px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: color-mix(in srgb, currentColor 5%, rgba(255, 255, 255, 0.4));
  box-shadow: inset 0 0 0 999px rgba(15, 23, 42, 0.055);
  cursor: pointer;
  white-space: nowrap;
}

.costing-date-value {
  display: inline-block;
  min-width: 58px;
  color: var(--text);
  text-align: center;
  font-size: 12px;
  font-style: italic;
  font-weight: 950;
  line-height: 1;
}

.costing-date-caption {
  display: block;
  max-width: none;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.costing-date-caption::after {
  content: ":";
}

.costing-date-native {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100% !important;
  height: 100% !important;
  opacity: 0;
  cursor: pointer;
  pointer-events: none;
}

.costing-product-row td {
  transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.costing-product-row:nth-of-type(4n) td {
  box-shadow: inset 0 999px rgba(255, 255, 255, 0.12);
}

.costing-product-row:hover td {
  background-color: rgba(239, 246, 255, 0.44);
  border-bottom-color: rgba(37, 99, 235, 0.22);
}

.costing-computed-cell {
  color: var(--text);
  font-weight: 950;
  text-align: center;
  white-space: nowrap;
}

.costing-total-cost-cell {
  position: relative;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 950;
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.92), rgba(219, 234, 254, 0.72)) !important;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.18);
}

.costing-input-cell {
  background: rgba(255, 255, 255, 0.52);
  text-align: center;
}

.costing-product-row .costing-input-cell {
  background: rgba(255, 255, 255, 0.36);
}

.costing-input-cell input {
  max-width: 100%;
}

.costing-head-article,
.costing-cell-article {
  width: max-content;
  min-width: 70px;
  max-width: none;
  white-space: nowrap;
}

.costing-cell-article input {
  width: max-content;
  min-width: 54px;
  max-width: none;
  text-align: center;
}

@media (max-width: 640px) {
  .costing-date-band {
    width: min(560px, calc(100vw - 60px));
    grid-template-columns: repeat(3, minmax(150px, 1fr));
    gap: 10px;
  }

  .costing-date-control {
    padding: 4px 6px;
  }

  .costing-date-caption {
    white-space: normal;
  }
}

@media (max-width: 1100px) {
  .costing-table {
    min-width: 0;
  }

  .costing-table th,
  .costing-table td {
    padding: 8px 6px;
    font-size: 12px;
  }

  .costing-main-input {
    font-size: 12px;
  }

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

  .costing-progress {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow-x: visible;
    padding-inline: 8px;
  }

  .costing-date-cards {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 720px) {
  .costing-table-head {
    align-items: flex-start;
  }

  .costing-add-btn-top {
    order: 3;
    margin-left: 0;
  }

  .costing-finance-grid,
  .costing-payment-grid,
  .costing-detail-grid,
  .costing-detail-utility-grid {
    grid-template-columns: 1fr;
  }

  .costing-details-row td {
    padding-inline: 12px;
  }

  .costing-details-panel {
    padding: 16px;
  }
}

.costing-color-cell {
  position: relative;
  overflow: visible;
  text-align: center;
}

.costing-color-picker {
  position: relative;
  display: inline-flex;
}

.costing-color-button,
.costing-color-swatch {
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}

.costing-color-button {
  width: 30px;
  height: 30px;
  border-radius: 999px;
}

.costing-color-button span,
.costing-color-swatch span {
  display: block;
  width: 16px;
  height: 16px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 999px;
}

.costing-color-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 30;
  display: none;
  grid-template-columns: repeat(4, 28px);
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-card);
}

.costing-color-menu.is-open {
  display: grid;
}

.costing-color-floating-menu {
  position: fixed;
  z-index: 9999;
  display: grid;
  grid-template-columns: repeat(3, 28px);
  gap: 9px;
  width: 128px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
  box-sizing: border-box;
}

.costing-photo-floating-menu {
  position: fixed;
  z-index: 9999;
  display: grid;
  gap: 6px;
  width: 164px;
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
}

.costing-photo-floating-menu button {
  width: 100%;
  min-height: 34px;
  justify-content: flex-start;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #334155;
  font-size: 12px;
  font-weight: 850;
  text-align: left;
  cursor: pointer;
}

.costing-photo-floating-menu button:hover {
  background: rgba(239, 246, 255, 0.95);
  color: #1d4ed8;
}

.costing-color-choice {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.78);
  cursor: pointer;
}

.costing-color-choice span {
  width: 20px;
  height: 20px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 999px;
}

.costing-color-choice.is-selected {
  border-color: rgba(37, 99, 235, 0.46);
  background: rgba(239, 246, 255, 0.95);
}

.costing-color-swatch {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 10px;
}

.costing-color-swatch.is-selected {
  border-color: rgba(37, 99, 235, 0.54);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.costing-row-actions {
  white-space: nowrap;
}

.costing-delete-btn {
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
}

.costing-delete-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.costing-actions {
  display: none;
  justify-content: flex-start;
  padding-top: var(--space-3);
}

.costing-add-btn {
  width: auto;
  min-width: 180px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
}

.is-last-costing-row td {
  border-bottom-color: rgba(37, 99, 235, 0.2);
}

.page-costing .costing-scroll {
  overflow-x: hidden;
}

.page-costing .costing-table {
  min-width: 0;
  white-space: normal;
}

.expense-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--space-3);
}

.expense-day {
  position: relative;
  display: grid;
  gap: 8px;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  min-height: 246px;
  min-width: 0;
  padding: 12px 10px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--cell-shadow);
  overflow: visible;
}

.expense-day.is-current-week {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(241, 245, 249, 0.92);
}

.expense-day.is-current-week input,
.expense-day.is-current-week textarea {
  background: rgba(255, 255, 255, 0.74);
}

.expense-day.is-dirty {
  border-color: rgba(37, 99, 235, 0.34);
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.92), rgba(255, 255, 255, 0.92));
}

.expense-day:focus-within {
  border-color: rgba(37, 99, 235, 0.32);
  box-shadow: var(--cell-shadow-focus);
}

.expense-day.has-value::after {
  content: "";
  position: absolute;
  inset: -3px;
  z-index: 2;
  border: 4px solid rgba(37, 99, 235, 0.5);
  border-radius: calc(var(--radius-md) + 4px);
  pointer-events: none;
  animation: expenseDayCellPulse 2.35s ease-in-out infinite;
  will-change: opacity;
}

@keyframes expenseDayCellPulse {
  0%,
  100% {
    opacity: 0.2;
  }

  50% {
    opacity: 0.82;
  }
}

.expense-day-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.expense-day-date {
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.expense-day-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.expense-day-save,
.expense-day-clear {
  width: 30px;
  min-width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 10px;
  color: var(--primary);
  background: rgba(239, 246, 255, 0.92);
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.08);
}

.expense-day-clear {
  width: 28px;
  min-width: 28px;
  height: 28px;
  border-color: rgba(148, 163, 184, 0.2);
  color: #64748b;
  background: rgba(248, 250, 252, 0.9);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.06);
}

.expense-day-save:hover:not(:disabled),
.expense-day-clear:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.28);
  background: #ffffff;
  box-shadow: 0 14px 26px rgba(37, 99, 235, 0.12);
}

.expense-day-clear:hover:not(:disabled) {
  border-color: rgba(100, 116, 139, 0.28);
  color: #334155;
  box-shadow: 0 12px 22px rgba(15, 23, 42, 0.1);
}

.expense-day-save:disabled,
.expense-day-clear:disabled {
  opacity: 0.52;
  cursor: default;
  transform: none;
}

.expense-day-save svg,
.expense-day-clear svg {
  width: 16px;
  height: 16px;
  stroke-width: 3;
}

.expense-day-clear svg {
  width: 13px;
  height: 13px;
  stroke-width: 2.7;
}

.expense-day input,
.expense-day textarea {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  font-size: 12px;
}

.expense-day textarea {
  min-height: 56px;
  resize: vertical;
}

.expense-day-add {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.08);
}

.expense-day-add:disabled {
  opacity: 0.52;
  cursor: default;
}

.expense-operations-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  max-height: 118px;
  padding-right: 2px;
  overflow-y: auto;
}

.expense-operations-list.is-empty {
  justify-content: center;
  min-height: 32px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.expense-operation-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  padding: 7px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.62);
}

.expense-operation-main {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.expense-operation-main strong {
  color: var(--danger);
  font-size: 11px;
  font-weight: 950;
  line-height: 1.1;
  white-space: nowrap;
}

.expense-operation-main span {
  min-width: 0;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 760;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.expense-operation-edit,
.expense-operation-delete {
  width: 24px;
  min-width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 8px;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 12px rgba(15, 23, 42, 0.06);
}

.expense-operation-edit svg,
.expense-operation-delete svg {
  width: 13px;
  height: 13px;
  stroke-width: 2.5;
}

.expense-operation-delete:hover:not(:disabled) {
  color: var(--danger);
  border-color: rgba(220, 38, 38, 0.24);
  background: var(--danger-soft);
}

@media (max-width: 1280px) {
  .expense-calendar {
    grid-template-columns: repeat(7, minmax(126px, 1fr));
    overflow-x: auto;
  }
}

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

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

  .tax-summary-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .tax-actions {
    justify-content: flex-start;
  }

  .expense-calendar {
    grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  }

  .financial-calendar-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

tr.income {
  background: rgba(22, 163, 74, 0.06);
}

tr.expense {
  background: rgba(220, 38, 38, 0.055);
}

tr.transfer {
  background: rgba(254, 243, 199, 0.42);
}

tr.neutral {
  background: #ffffff;
}

tr.income:hover,
tr.expense:hover,
tr.transfer:hover,
tr.neutral:hover {
  filter: none;
  background-color: rgba(37, 99, 235, 0.075);
}

tr.latest-operation {
  position: relative;
}

tr.latest-operation .operation-type-icon {
  animation: latestOperationIconPulse 2.2s ease-in-out infinite;
}

tr.latest-operation .operation-type-icon.transfer {
  animation: latestTransferIconPulse 2.4s ease-in-out infinite;
}

@keyframes latestOperationIconPulse {
  0%,
  100% {
    box-shadow:
      0 0 0 0 rgba(37, 99, 235, 0),
      0 0 0 0 rgba(34, 197, 94, 0);
    transform: scale(1);
  }

  50% {
    box-shadow:
      0 0 0 10px rgba(37, 99, 235, 0.14),
      0 0 24px rgba(37, 99, 235, 0.34),
      0 0 34px rgba(34, 197, 94, 0.18);
    transform: scale(1.08);
  }
}

@keyframes latestTransferIconPulse {
  0%,
  100% {
    box-shadow:
      0 0 0 0 rgba(245, 158, 11, 0),
      0 0 0 0 rgba(217, 119, 6, 0);
    transform: scale(1);
  }

  50% {
    box-shadow:
      0 0 0 9px rgba(245, 158, 11, 0.14),
      0 0 22px rgba(217, 119, 6, 0.24);
    transform: scale(1.06);
  }
}

.filter-row {
  display: grid;
  grid-template-columns: 160px 130px 96px;
  gap: var(--space-2);
  align-items: center;
  width: fit-content;
  max-width: 100%;
}

#dateFilter,
#filterType {
  width: 100%;
}

.period-input-wrap {
  position: relative;
  display: block;
}

.period-input-wrap::after {
  content: attr(data-display-value);
  position: absolute;
  inset: 1px 42px 1px 1px;
  display: none;
  align-items: center;
  padding-left: var(--space-3);
  border-radius: calc(var(--radius-sm) - 1px);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  pointer-events: none;
  background: #ffffff;
}

.period-input-wrap.has-display-value::after {
  display: flex;
}

.role-notice,
.firebase-status,
.storage-status,
.realtime-status {
  margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
  background: rgba(248, 250, 252, 0.78);
}

.firebase-status-connected,
.storage-status-cloud,
.realtime-status-connected {
  color: #166534;
  border-color: rgba(22, 163, 74, 0.22);
  background: var(--success-soft);
}

.firebase-status-error,
.storage-status-error,
.realtime-status-error {
  color: #991b1b;
  border-color: rgba(220, 38, 38, 0.22);
  background: var(--danger-soft);
}

.firebase-status-local,
.storage-status-local,
.realtime-status-local {
  color: var(--text-soft);
  background: rgba(248, 250, 252, 0.78);
}

.is-readonly input,
.is-readonly select {
  color: var(--muted);
  background: #f1f5f9;
}

.is-hidden {
  display: none !important;
}

.access-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1fr) 150px minmax(170px, 0.8fr) 180px;
  gap: var(--space-2);
  align-items: center;
}

.access-form button {
  width: 100%;
}

.access-password-form {
  grid-template-columns: repeat(3, minmax(180px, 1fr)) 220px;
}

.access-profile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
}

.access-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.access-inline-actions button {
  width: auto;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 999px;
  color: #3730a3;
  font-size: 11px;
  font-weight: 800;
  background: #eef2ff;
}

.auth-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  align-items: center;
}

.auth-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: var(--space-2);
}

.auth-user-panel {
  display: grid;
  gap: var(--space-3);
}

.cloud-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.service-settings {
  margin-top: var(--space-4);
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.72);
  overflow: hidden;
}

.service-settings summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 0 var(--space-4);
  color: #64748b;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  list-style: none;
  user-select: none;
}

.service-settings summary::-webkit-details-marker {
  display: none;
}

.service-settings summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid #94a3b8;
  border-bottom: 2px solid #94a3b8;
  transform: rotate(45deg);
  transition: transform 0.18s ease;
}

.service-settings[open] summary::after {
  transform: rotate(225deg);
}

.service-settings-body {
  display: grid;
  gap: var(--space-3);
  padding: 0 var(--space-4) var(--space-4);
}

.muted-text {
  margin-top: var(--space-3);
  color: var(--muted);
  font-size: 12px;
}

.service-settings .muted-text {
  margin-top: 0;
}

.cloud-status-wrap {
  position: fixed;
  top: 24px;
  right: 32px;
  z-index: 46;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: var(--space-3);
  width: auto !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
}

.page-top-title {
  position: fixed;
  top: 24px;
  left: 50%;
  z-index: 45;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  max-width: min(42vw, 640px);
  height: 42px;
  padding: 0 26px;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 18px;
  font-weight: 850;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
  transform: translateX(-50%);
}

.currency-rates-bar {
  position: fixed;
  top: 24px;
  left: calc(var(--sidebar-width) + 32px);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.currency-rate-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 42px;
  padding: 0 12px 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(18px);
}

.currency-rate-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-xs);
  color: #ffffff;
  font-size: 13px;
  font-weight: 850;
  line-height: 1;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
}

.currency-rate-icon-usd {
  color: #ffffff;
  background: linear-gradient(135deg, #22c55e, #16a34a);
}

.currency-rate-icon-cny {
  color: #ffffff;
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.currency-rate-icon-btc {
  color: #ffffff;
  background: linear-gradient(135deg, #facc15, #f59e0b);
}

.currency-rate-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
  line-height: 1.05;
}

.currency-rate-label {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0;
}

.currency-rate-value {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.cloud-status-bar {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: var(--space-2) !important;
  width: auto !important;
  height: 42px !important;
  min-height: 42px !important;
  max-height: 42px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none;
}

.cloud-status-icon {
  gap: 0;
  width: 42px !important;
  min-width: 42px !important;
  max-width: 42px !important;
  height: 42px !important;
  min-height: 42px !important;
  max-height: 42px !important;
  padding: 0 !important;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(18px);
}

.cloud-status-label {
  display: none;
}

.cloud-status-icon::after {
  display: none !important;
}

.cloud-status-icon svg {
  margin-left: 0;
}

@media (min-width: 901px) {
  .cloud-status-wrap::after {
    content: var(--user-display-name);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    width: auto;
    height: 42px;
    margin-left: 0;
    padding: 0 16px;
    border-radius: 999px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 850;
    white-space: nowrap;
    background: linear-gradient(135deg, #818cf8, #4f46e5);
    box-shadow: 0 14px 30px rgba(79, 70, 229, 0.22);
  }
}

@media (min-width: 901px) and (max-width: 1320px) {
  .cloud-status-label {
    display: none;
  }

  .cloud-status-icon {
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    padding: 0 !important;
  }

  .cloud-status-icon svg {
    margin-left: 0 !important;
  }
}

/*
  Legacy icon sizing guard kept below for older generated SVG markup.
  The modern status pill styles above override dimensions where needed.
*/
.cloud-status-bar {
  border: 1px solid var(--line) !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.86) !important;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06) !important;
  backdrop-filter: blur(18px);
}

.cloud-status-bar {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

/*
  Base icon dimensions for the icon-only portions inside the status pills.
*/
.cloud-status-icon svg,
.cloud-status-icon > svg {
  width: 16px !important;
  height: 16px !important;
}

@media (max-width: 900px) {
  .currency-rates-bar {
    display: none;
  }

  .page-top-title {
    display: none;
  }

  .cloud-status-label {
    display: none;
  }

  .cloud-status-icon {
    width: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    padding: 0;
  }

  .cloud-status-icon svg {
    margin-left: 0 !important;
  }
}

/* old fixed icon block */
.cloud-status-bar-legacy {
  border: 1px solid var(--line) !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.86) !important;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06) !important;
  backdrop-filter: blur(18px);
}

.cloud-status-icon svg,
.cloud-status-icon > svg {
  display: block !important;
  flex: 0 0 16px !important;
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  min-height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
}

.cloud-status-icon.active {
  color: var(--success) !important;
}

.rps-top-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 58px;
  height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  cursor: pointer;
  background: linear-gradient(135deg, #6366f1, #2563eb);
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.22);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    filter 0.18s ease;
}

.rps-top-button:hover {
  transform: translateY(-1px);
  filter: saturate(1.08);
  box-shadow: 0 18px 36px rgba(37, 99, 235, 0.28);
}

.rps-top-button:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.2);
}

body.rps-modal-open {
  overflow: hidden;
}

.rps-modal-root {
  position: fixed;
  inset: 0;
  z-index: 60000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 3vw, 36px);
  pointer-events: none;
}

.rps-modal-root.is-mounted {
  display: flex;
}

.rps-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.36);
  opacity: 0;
  backdrop-filter: blur(10px);
  transition: opacity 0.22s ease;
  pointer-events: auto;
}

.rps-modal {
  position: relative;
  z-index: 1;
  width: min(95vw, 1440px);
  max-height: min(90vh, 920px);
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 38px 90px rgba(15, 23, 42, 0.28);
  opacity: 0;
  transform: translateY(14px) scale(0.975);
  transition:
    opacity 0.24s ease,
    transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

.rps-modal-root.is-open .rps-modal-backdrop {
  opacity: 1;
}

.rps-modal-root.is-open .rps-modal {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.rps-modal-content {
  max-height: min(90vh, 920px);
  overflow: auto;
  padding: clamp(22px, 3vw, 34px);
}

.rps-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.rps-modal-head p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.rps-modal-head h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(26px, 3vw, 42px);
  font-weight: 950;
  letter-spacing: 0;
}

.rps-modal-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.rps-save-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  color: #2563eb;
  font-size: 13px;
  font-weight: 850;
  background: #eff6ff;
  white-space: nowrap;
}

.rps-close-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.9);
  transition:
    color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.rps-close-button:hover {
  color: var(--danger);
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.rps-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.rps-summary-card {
  display: grid;
  gap: 8px;
  min-height: 92px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.rps-summary-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.rps-summary-card strong {
  color: var(--text);
  font-size: clamp(18px, 2vw, 26px);
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.rps-section {
  padding: 18px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #ffffff;
}

.rps-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.rps-section-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 950;
}

.rps-section-head p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
  text-align: right;
}

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

.rps-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.rps-field > span:first-child {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 900;
}

.rps-input-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 48px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.rps-input-shell:focus-within {
  border-color: rgba(37, 99, 235, 0.55);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.rps-input-shell input {
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  border: 0;
  outline: 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
  background: transparent;
  font-variant-numeric: tabular-nums;
}

.rps-input-shell em {
  padding-right: 14px;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 850;
}

.rps-field small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
}

.rps-table-scroll {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
}

.rps-table {
  width: 100%;
  min-width: 900px;
  border-collapse: separate;
  border-spacing: 0;
}

.rps-table th,
.rps-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 14px;
  font-weight: 850;
  text-align: left;
  vertical-align: middle;
}

.rps-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
  background: #f8fafc;
}

.rps-table tbody th {
  width: 34%;
}

.rps-table tbody th strong {
  display: block;
  margin-bottom: 4px;
  font-size: 16px;
  font-weight: 950;
}

.rps-table tbody th span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.rps-table td {
  font-variant-numeric: tabular-nums;
}

.rps-table tr:last-child th,
.rps-table tr:last-child td {
  border-bottom: 0;
}

.rps-table tr.is-best th,
.rps-table tr.is-best td {
  color: #166534;
  background: #dcfce7;
}

.rnp-page {
  max-width: 1760px;
  margin: 0 auto;
  padding: 10px 18px 36px;
}

.rnp-hero-card {
  position: relative;
  overflow: visible;
  border: 1px solid rgba(199, 210, 254, 0.72);
  border-radius: 30px;
  background:
    radial-gradient(circle at 10% 0%, rgba(99, 102, 241, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.94));
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.08);
}

.rnp-page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 18px 22px 12px;
}

.rnp-head-left {
  display: grid;
  gap: 16px;
  min-width: 0;
  max-width: none;
}

.rnp-store-tabs,
.rnp-article-tabs {
  display: flex;
  gap: 10px;
  padding: 0 22px 12px;
  overflow-x: auto;
}

.rnp-store-tabs {
  align-items: center;
  min-width: 0;
  padding: 0;
  overflow-x: auto;
  overflow-y: visible;
}

.rnp-top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
  white-space: nowrap;
}

.rnp-store-tabs button,
.rnp-article-tabs button {
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 999px;
  color: var(--text-soft);
  font-weight: 900;
  background: rgba(255, 255, 255, 0.86);
  cursor: pointer;
  white-space: nowrap;
  transform: translateY(0);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}

.rnp-store-tabs button {
  min-height: 42px;
  height: 42px;
  padding: 0 22px;
  border-radius: 8px;
  font-size: 15px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.rnp-store-tabs button.is-active {
  color: #ffffff;
  border-color: transparent;
  background: linear-gradient(135deg, #6366f1, #2563eb);
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.2);
}

.rnp-selected-list {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  min-width: 0;
  padding: 0 22px 18px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.rnp-selected-wrap {
  display: grid;
  grid-template-columns: minmax(190px, max-content) 44px;
  flex: 0 0 auto;
  width: auto;
  max-width: 390px;
  --rnp-article-card-bg: #ffffff;
}

.rnp-selected-article {
  display: grid;
  grid-template-columns: 64px minmax(110px, max-content);
  align-items: center;
  width: 100%;
  min-height: 86px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 8px;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  color: var(--text);
  text-align: left;
  background: var(--rnp-article-card-bg);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
  cursor: pointer;
}

.rnp-selected-article.is-active {
  border-color: rgba(37, 99, 235, 0.72);
  box-shadow:
    inset 0 0 0 2px rgba(37, 99, 235, 0.58),
    0 18px 42px rgba(37, 99, 235, 0.18);
}

.rnp-selected-wrap.is-dark-card .rnp-selected-article {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.24);
}

.rnp-selected-wrap.is-dark-card .rnp-selected-text em {
  color: rgba(255, 255, 255, 0.84);
}

.rnp-selected-wrap.is-dark-card .rnp-selected-thumb {
  background: rgba(255, 255, 255, 0.18);
}

.rnp-selected-wrap.is-dark-card .rnp-selected-thumb b {
  color: #ffffff;
}

.rnp-selected-wrap.is-dark-card .rnp-selected-article.is-active {
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.58),
    0 18px 40px rgba(15, 23, 42, 0.16);
}

.rnp-selected-article.is-empty {
  grid-template-columns: 1fr;
  width: min(100%, 328px);
  padding: 18px;
  cursor: default;
}

.rnp-selected-thumb {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-left: 14px;
  overflow: hidden;
  border-radius: 8px;
  color: #2563eb;
  background: #eff6ff;
}

.rnp-selected-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rnp-selected-thumb b {
  font-size: 24px;
  line-height: 1;
}

.rnp-selected-text {
  display: grid;
  gap: 5px;
  min-width: 0;
  max-width: 240px;
  padding: 0 12px;
}

.rnp-selected-text strong,
.rnp-selected-text em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rnp-selected-text strong {
  font-size: 14px;
  font-style: normal;
  font-weight: 950;
  text-transform: uppercase;
}

.rnp-selected-text em {
  color: var(--text-soft);
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
}

.rnp-selected-arrow {
  display: grid;
  place-items: center;
  width: 44px;
  min-height: 86px;
  border: 0;
  border-radius: 0 8px 8px 0;
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb, #0f49ef);
  cursor: pointer;
}

.rnp-selected-arrow svg {
  width: 22px;
  height: 22px;
  transition: transform 0.18s ease;
}

.rnp-selected-arrow[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.rnp-modal-layer {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: auto;
  background: rgba(15, 23, 42, 0.22);
  backdrop-filter: blur(10px);
}

.rnp-article-popover {
  position: relative;
  z-index: 9001;
  width: min(910px, calc(100vw - 48px));
  padding: 34px 38px 32px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 34px 96px rgba(15, 23, 42, 0.26);
}

.rnp-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 28px;
}

.rnp-popover-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rnp-popover-title {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.rnp-popover-title strong {
  color: var(--text);
  font-size: 26px;
  font-weight: 950;
}

.rnp-popover-title span {
  color: #64748b;
  font-size: 16px;
  font-weight: 900;
}

.rnp-popover-head button {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 24px;
  line-height: 1;
  background: #f1f5f9;
  cursor: pointer;
}

.rnp-popover-head .rnp-delete-article-button {
  color: #dc2626;
  background: #fff1f2;
  box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.22);
}

.rnp-delete-article-button svg {
  width: 22px;
  height: 22px;
}

.rnp-popover-body {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 28px;
  align-items: start;
}

.rnp-card-color-field {
  display: grid;
  gap: 14px;
  align-self: start;
}

.rnp-card-color-field > span,
.rnp-photo-label {
  color: var(--text-soft);
  font-size: 15px;
  font-weight: 950;
}

.rnp-card-color-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 13px;
  min-width: 0;
  overflow-x: auto;
  padding: 2px;
  scrollbar-width: none;
}

.rnp-card-color-grid::-webkit-scrollbar {
  display: none;
}

.rnp-card-color-grid button {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: var(--rnp-card-swatch);
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.55);
  cursor: pointer;
}

.rnp-card-color-grid button.is-active {
  box-shadow:
    0 0 0 2px #2563eb,
    0 10px 20px rgba(37, 99, 235, 0.22);
}

.rnp-article-tabs {
  padding-top: 2px;
}

.rnp-article-tabs button {
  display: grid;
  gap: 2px;
  min-width: 156px;
  padding: 9px 13px;
  text-align: left;
  border-radius: 16px;
}

.rnp-article-tabs button span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.rnp-article-tabs button.is-active {
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.22);
  background: #eff6ff;
}

.rnp-article-tabs small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.rnp-layout {
  display: grid;
  grid-template-columns: minmax(248px, 300px) minmax(0, 1fr);
  gap: 14px;
  padding: 0 22px 22px;
}

.rnp-layout.is-settings-collapsed {
  grid-template-columns: minmax(220px, 248px) minmax(0, 1fr);
}

.rnp-product-card {
  min-width: 0;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.06);
}

.rnp-product-card {
  align-self: start;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.rnp-product-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.rnp-article-popover label,
.rnp-product-card label,
.rnp-settings-card label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.rnp-article-popover label {
  gap: 12px;
}

.rnp-article-popover label span,
.rnp-product-card label span,
.rnp-settings-card label span {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 950;
}

.rnp-article-popover label span,
.rnp-photo-label {
  font-size: 15px;
}

.rnp-article-popover input,
.rnp-product-card input,
.rnp-table input {
  width: 100%;
  min-width: 0;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  text-align: center;
  background: #ffffff;
  font-variant-numeric: tabular-nums;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.rnp-article-popover input {
  height: 56px;
  padding: 0 18px;
  border-radius: 11px;
  font-size: 17px;
  text-align: left;
  font-weight: 750;
}

.rnp-article-popover .rnp-product-title-field input {
  height: 56px;
  font-size: 17px;
}

.rnp-article-popover input:focus,
.rnp-product-card input:focus,
.rnp-table input:focus {
  border-color: rgba(99, 102, 241, 0.52);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.08);
}

.rnp-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  color: #047857;
  font-size: 12px;
  font-weight: 950;
  background: #d1fae5;
}

.rnp-photo-wrap {
  position: relative;
  display: grid;
  gap: 12px;
  min-width: 0;
}

.rnp-popover-lower {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 28px;
  align-items: stretch;
}

.rnp-popover-lower-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: auto 1fr auto;
  gap: 28px 28px;
  align-content: stretch;
}

.rnp-popover-lower-fields .rnp-card-color-field,
.rnp-popover-lower-fields .rnp-popover-actions {
  grid-column: 1 / -1;
}

.rnp-photo-button {
  display: grid;
  place-items: center;
  overflow: hidden;
  width: 100%;
  height: 284px;
  aspect-ratio: auto;
  border: 1px dashed rgba(99, 102, 241, 0.45);
  border-radius: 12px;
  color: #4f46e5;
  background: linear-gradient(180deg, #f8faff, #eef2ff);
  cursor: pointer;
  touch-action: none;
}

.rnp-popover-info .rnp-photo-button {
  aspect-ratio: 1 / 0.78;
}

.rnp-photo-button.has-image {
  border-style: solid;
  border-color: rgba(226, 232, 240, 0.92);
  background: #ffffff;
  cursor: grab;
}

.rnp-photo-button.has-image:active {
  cursor: grabbing;
}

.rnp-photo-button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.rnp-photo-button span {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 8px;
  border-radius: 999px;
  font-size: 30px;
  font-weight: 800;
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(79, 70, 229, 0.14);
}

.rnp-photo-button b {
  font-size: 13px;
  font-weight: 950;
}

.rnp-photo-menu {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 6;
  display: grid;
  gap: 6px;
  min-width: 150px;
  padding: 8px;
  border: 1px solid rgba(226, 232, 240, 0.96);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
}

.rnp-photo-menu button {
  min-height: 34px;
  border: 0;
  border-radius: 10px;
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  text-align: left;
  background: #f8fafc;
  cursor: pointer;
}

.rnp-photo-menu button:hover {
  color: #1d4ed8;
  background: #eff6ff;
}

.rnp-settings-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 20px;
  background: #f8fafc;
}

.rnp-settings-card.is-collapsed {
  padding: 0;
  background: transparent;
}

.rnp-settings-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 14px;
  color: var(--text);
  font-size: 15px;
  font-weight: 950;
  background: #ffffff;
  cursor: pointer;
}

.rnp-settings-toggle svg {
  width: 18px;
  height: 18px;
  color: #6366f1;
  transition: transform 0.18s ease;
}

.rnp-settings-card:not(.is-collapsed) .rnp-settings-toggle svg {
  transform: rotate(180deg);
}

.rnp-settings-meta {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

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

.rnp-popover-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 20px;
  align-self: end;
  margin-top: 0;
}

.rnp-settings-date-field {
  display: grid;
  gap: 8px;
  min-width: 112px;
  margin-right: auto;
}

.rnp-settings-date-field span {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 950;
}

.rnp-settings-date-field select {
  width: 112px;
  height: 58px;
  padding: 0 14px;
  border: 1px solid rgba(226, 232, 240, 0.96);
  border-radius: 14px;
  color: var(--text);
  font-size: 16px;
  font-weight: 950;
  text-align: center;
  background: #ffffff;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.05);
}

.rnp-apply-settings-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 144px;
  min-height: 58px;
  padding: 0 24px;
  border: 0;
  border-radius: 14px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 950;
  cursor: pointer;
  background: linear-gradient(135deg, #6366f1, #2563eb);
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.16);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.rnp-apply-settings-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(37, 99, 235, 0.22);
}

.rnp-empty-product {
  display: grid;
  gap: 6px;
  min-height: 220px;
  align-content: center;
  text-align: center;
}

.rnp-empty-product strong {
  color: var(--text);
  font-size: 18px;
  font-weight: 950;
}

.rnp-empty-product span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.35;
}

.rnp-workspace {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 0 22px 22px;
}

.rnp-month-switch {
  display: flex;
  align-items: center;
  min-width: 0;
}

.rnp-month-switch button,
.rnp-soft-button,
.rnp-secondary-button,
.rnp-icon-button,
.rnp-primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  font-weight: 950;
  cursor: pointer;
}

.rnp-month-switch button {
  width: 36px;
  min-height: 36px;
  color: #4f46e5;
  font-size: 24px;
  background: #eef2ff;
}

.rnp-month-switch input {
  width: 190px;
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
  background: #ffffff;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.05);
}

.rnp-icon-button {
  width: 48px;
  min-width: 48px;
  min-height: 48px;
  border: 1px solid rgba(199, 210, 254, 0.9);
  border-radius: 12px;
  color: #2563eb;
  background: #eef4ff;
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.1);
}

.rnp-icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rnp-icon-button:disabled {
  cursor: default;
  opacity: 0.55;
  box-shadow: none;
}

.rnp-soft-button {
  padding: 0 16px;
  color: var(--text-soft);
  background: #f1f5f9;
}

.rnp-secondary-button {
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid rgba(199, 210, 254, 0.9);
  border-radius: 8px;
  color: #3157d5;
  font-size: 14px;
  background: rgba(239, 246, 255, 0.9);
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.08);
}

.rnp-secondary-button:disabled {
  cursor: default;
  opacity: 0.62;
  box-shadow: none;
}

.rnp-popover-actions .rnp-soft-button {
  min-width: 144px;
  min-height: 58px;
  padding: 0 24px;
  border-radius: 14px;
  font-size: 16px;
}

.rnp-primary-button {
  min-height: 48px;
  padding: 0 22px;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(135deg, #6366f1, #2563eb);
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.2);
}

.rnp-api-status {
  margin: -2px 22px 12px;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.rnp-bulk-layer {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(15, 23, 42, 0.24);
  backdrop-filter: blur(12px);
}

.rnp-bulk-modal {
  width: min(1160px, calc(100vw - 56px));
  max-height: calc(100vh - 56px);
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 24px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 30px 90px rgba(15, 23, 42, 0.24);
}

.rnp-bulk-head,
.rnp-bulk-controls,
.rnp-bulk-actions {
  display: flex;
  align-items: center;
}

.rnp-bulk-head {
  justify-content: space-between;
  gap: 18px;
}

.rnp-bulk-head div {
  display: grid;
  gap: 4px;
}

.rnp-bulk-head strong {
  color: var(--text);
  font-size: 24px;
  font-weight: 950;
}

.rnp-bulk-head span {
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 850;
}

.rnp-bulk-head button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  color: #475569;
  font-size: 28px;
  font-weight: 900;
  cursor: pointer;
  background: #f1f5f9;
}

.rnp-bulk-controls {
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.rnp-bulk-controls label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 850;
}

.rnp-bulk-controls input[type="date"] {
  width: 176px;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
  background: #ffffff;
}


.rnp-bulk-upload span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rnp-bulk-upload b {
  flex: 0 0 auto;
  color: #2563eb;
  font-size: 16px;
  font-weight: 950;
}

.rnp-bulk-table-wrap {
  min-height: 0;
  overflow: auto;
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 18px;
}

.rnp-bulk-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 960px;
}

.rnp-bulk-table th,
.rnp-bulk-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.82);
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
  text-align: left;
  vertical-align: middle;
}

.rnp-bulk-table th:nth-child(2),
.rnp-bulk-table td:nth-child(2) {
  width: 16%;
}

.rnp-bulk-table th:nth-child(3),
.rnp-bulk-table th:nth-child(4),
.rnp-bulk-table th:nth-child(5),
.rnp-bulk-table td:nth-child(3),
.rnp-bulk-table td:nth-child(4),
.rnp-bulk-table td:nth-child(5) {
  text-align: center;
}

.rnp-bulk-table th:first-child,
.rnp-bulk-table td:first-child {
  width: 32%;
}

.rnp-bulk-table th:nth-child(3),
.rnp-bulk-table td:nth-child(3) {
  width: 16%;
}

.rnp-bulk-table th:nth-child(4),
.rnp-bulk-table td:nth-child(4) {
  width: 19%;
}

.rnp-bulk-table th:nth-child(5),
.rnp-bulk-table td:nth-child(5) {
  width: 17%;
}

.rnp-bulk-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--text-soft);
  background: #f8fafc;
}

.rnp-bulk-table tr:last-child td {
  border-bottom: 0;
}

.rnp-bulk-store-row td {
  padding: 10px 14px;
  color: #2563eb;
  font-size: 14px;
  font-weight: 950;
  text-align: left !important;
  background: linear-gradient(90deg, rgba(239, 246, 255, 0.96), rgba(248, 250, 252, 0.96));
}

.rnp-bulk-product {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.rnp-bulk-product strong {
  display: block;
  min-width: 0;
  color: var(--text);
  font-size: 14px;
  font-style: normal;
  font-weight: 950;
  line-height: 1.25;
  white-space: normal;
}

.rnp-bulk-thumb {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 10px;
  color: #2563eb;
  background: #eef4ff;
}

.rnp-bulk-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rnp-bulk-table input {
  width: 124px;
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
  text-align: center;
  background: #ffffff;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
}




.rnp-bulk-actions {
  justify-content: flex-end;
  gap: 12px;
}

.rnp-metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(160px, 1fr));
  gap: 18px;
}

.rnp-metric-card {
  display: grid;
  gap: 10px;
  min-height: 118px;
  padding: 20px;
  border: 1px solid rgba(226, 232, 240, 0.86);
  border-radius: 16px;
  background: #ffffff;
}

.rnp-metric-card span {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 950;
  line-height: 1.2;
}

.rnp-metric-card strong {
  color: var(--text);
  font-size: clamp(18px, 1.6vw, 25px);
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.rnp-metric-yellow {
  background: linear-gradient(180deg, #fff7d6, #ffffff);
}

.rnp-metric-green {
  background: linear-gradient(180deg, #dcfce7, #ffffff);
}

.rnp-metric-red {
  background: linear-gradient(180deg, #fee2e2, #ffffff);
}

.rnp-metric-bright {
  background: linear-gradient(180deg, #bbf7d0, #ffffff);
}

.rnp-metric-blue {
  background: linear-gradient(180deg, #dbeafe, #ffffff);
}

.rnp-table-shell {
  overflow: auto;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 22px;
  background: #ffffff;
}

.rnp-table {
  width: 100%;
  min-width: 1240px;
  border-collapse: separate;
  border-spacing: 0;
}

.rnp-table th,
.rnp-table td {
  height: 58px;
  padding: 10px 12px;
  border-right: 1px solid rgba(226, 232, 240, 0.82);
  border-bottom: 1px solid rgba(226, 232, 240, 0.82);
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}

.rnp-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  color: #64748b;
  font-size: 12px;
  font-weight: 950;
  background: #f8fafc;
}

.rnp-table .rnp-row-title {
  position: sticky;
  left: 0;
  z-index: 3;
  width: 220px;
  min-width: 220px;
  text-align: left;
  background: #ffffff;
  box-shadow: 10px 0 22px rgba(15, 23, 42, 0.04);
}

.rnp-table thead .rnp-row-title {
  z-index: 5;
  background: #f8fafc;
}

.rnp-table input {
  height: 38px;
  max-width: 106px;
  margin: 0 auto;
  padding: 0 8px;
}

.rnp-col-day {
  min-width: 116px;
}

.rnp-col-week,
.rnp-table thead .rnp-col-week {
  min-width: 132px;
  background: #f1f5f9;
}

.rnp-col-month,
.rnp-table thead .rnp-col-month {
  min-width: 148px;
  background: #e0e7ff;
}

.rnp-row-sold th,
.rnp-row-sold td {
  background: #fff7d6;
}

.rnp-row-sold .rnp-row-title {
  background: #fef3c7;
}

.rnp-row-revenue th,
.rnp-row-revenue td {
  color: #15803d;
  background: #ecfdf5;
}

.rnp-row-revenue .rnp-row-title {
  background: #dcfce7;
}

.rnp-row-ads th,
.rnp-row-ads td {
  color: #b91c1c;
  background: #fff1f2;
}

.rnp-row-ads .rnp-row-title {
  background: #fee2e2;
}

.rnp-row-profit th,
.rnp-row-profit td {
  color: #047857;
  background: #d9f99d;
}

.rnp-row-profit .rnp-row-title {
  color: #166534;
  background: #bbf7d0;
}

.rnp-table .rnp-col-week {
  font-weight: 950;
  background: #f1f5f9;
}

.rnp-table .rnp-col-month {
  font-weight: 950;
  background: #e0e7ff;
}

.rnp-row-sold .rnp-col-month {
  color: #92400e;
  background: #fde68a;
}

.rnp-row-revenue .rnp-col-month {
  color: #166534;
  background: #bbf7d0;
}

.rnp-row-ads .rnp-col-month {
  color: #991b1b;
  background: #fecaca;
}

.rnp-row-profit .rnp-col-month {
  color: #065f46;
  background: #86efac;
}

@keyframes rnp-focus-column-pulse {
  0%,
  100% {
    --rnp-focus-column-color: rgba(37, 99, 235, 0.25);
  }

  50% {
    --rnp-focus-column-color: rgba(37, 99, 235, 0.95);
  }
}

.rnp-table th.is-focus-date,
.rnp-table td.is-focus-date {
  animation: rnp-focus-column-pulse 1.4s ease-in-out infinite;
  box-shadow:
    inset 2px 0 0 var(--rnp-focus-column-color),
    inset -2px 0 0 var(--rnp-focus-column-color);
}

.rnp-table thead th.is-focus-date {
  box-shadow:
    inset 2px 0 0 var(--rnp-focus-column-color),
    inset -2px 0 0 var(--rnp-focus-column-color),
    inset 0 2px 0 var(--rnp-focus-column-color);
}

.rnp-table tbody tr:last-child td.is-focus-date {
  box-shadow:
    inset 2px 0 0 var(--rnp-focus-column-color),
    inset -2px 0 0 var(--rnp-focus-column-color),
    inset 0 -2px 0 var(--rnp-focus-column-color);
}

.is-negative-value {
  color: #b91c1c;
}

.rnp-margin-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 70px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-weight: 950;
}

.rnp-margin-badge.is-positive {
  color: #047857;
  background: #d1fae5;
}

.rnp-margin-badge.is-negative {
  color: #b91c1c;
  background: #fee2e2;
}

.rnp-margin-badge.is-neutral {
  color: #64748b;
  background: #f1f5f9;
}

.rnp-margin-badge.is-month {
  min-width: 84px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

@media (max-width: 1180px) {
  .rnp-page-head {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .rnp-head-left {
    max-width: none;
  }

  .rnp-top-actions {
    justify-content: start;
  }

  .rnp-metrics-grid {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }

  .rnp-apply-settings-button {
    align-self: end;
  }
}

@media (max-width: 900px) {
  .rnp-page {
    padding: 12px;
  }

  .rnp-layout,
  .rnp-page-head,
  .rnp-store-tabs,
  .rnp-article-tabs,
  .rnp-workspace {
    padding-left: 16px;
    padding-right: 16px;
  }

  .rnp-page-head {
    align-items: stretch;
  }

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

  .rnp-month-switch input,
  .rnp-secondary-button,
  .rnp-primary-button {
    width: 100%;
  }

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

  .rnp-article-popover {
    width: min(100%, calc(100vw - 56px));
  }

  .rnp-popover-body,
  .rnp-popover-lower,
  .rnp-popover-lower-fields,
  .rnp-settings-grid {
    grid-template-columns: 1fr;
  }

  .rnp-card-color-field,
  .rnp-popover-actions {
    grid-column: 1 / -1;
  }

  .rnp-popover-lower-fields {
    grid-template-rows: none;
  }
}

@media (max-width: 1100px) {
  .rps-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 720px) {
  .rps-modal-root {
    padding: 10px;
  }

  .rps-modal {
    width: 100%;
    border-radius: 22px;
  }

  .rps-modal-head,
  .rps-section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .rps-section-head p {
    text-align: left;
  }

  .rps-summary-grid,
  .rps-fields-grid {
    grid-template-columns: 1fr;
  }
}

.audit-log-button {
  cursor: pointer;
  appearance: none;
}

.privacy-toggle-button {
  cursor: pointer;
  appearance: none;
}

.privacy-toggle-button.is-hidden-mode {
  color: var(--primary) !important;
  background: rgba(239, 246, 255, 0.92);
  box-shadow: 0 14px 34px rgba(37, 99, 235, 0.14) !important;
}

.privacy-toggle-button:hover,
.audit-log-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(37, 99, 235, 0.12) !important;
}

body.amounts-hidden .acc-value,
body.amounts-hidden .acc-subvalue,
body.amounts-hidden .amount-cell,
body.amounts-hidden .metric-value,
body.amounts-hidden .metric-caption,
body.amounts-hidden #catTable td:last-child,
body.amounts-hidden .category-total-amount-pill,
body.amounts-hidden .subcategory-amount-cell,
body.amounts-hidden .audit-log-amount {
  position: relative;
  color: transparent !important;
  text-shadow: none !important;
}

body.amounts-hidden .acc-value::after,
body.amounts-hidden .acc-subvalue::after,
body.amounts-hidden .amount-cell::after,
body.amounts-hidden .metric-value::after,
body.amounts-hidden .metric-caption::after,
body.amounts-hidden #catTable td:last-child::after,
body.amounts-hidden .category-total-amount-pill::after,
body.amounts-hidden .subcategory-amount-cell::after,
body.amounts-hidden .audit-log-amount::after {
  content: "***";
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: inherit;
  color: currentColor;
  color: var(--text-soft);
  font: inherit;
  font-weight: inherit;
  letter-spacing: 0.04em;
}

body.amounts-hidden .amount-cell::after,
body.amounts-hidden #catTable td:last-child::after,
body.amounts-hidden .category-total-amount-pill::after,
body.amounts-hidden .subcategory-amount-cell::after {
  justify-content: flex-start;
}

body.amounts-hidden .acc-value::after,
body.amounts-hidden .metric-value::after {
  color: var(--text);
}

body.amounts-hidden .acc-subvalue::after,
body.amounts-hidden .metric-caption::after {
  color: var(--muted);
}

.audit-log-panel {
  position: fixed;
  top: 82px;
  right: 28px;
  z-index: 80;
  width: min(420px, calc(100vw - 32px));
  max-height: min(640px, calc(100vh - 118px));
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(22px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px) scale(0.98);
  transition: opacity 0.16s ease, transform 0.16s ease;
  overflow: hidden;
}

.audit-log-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.audit-log-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
}

.audit-log-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 850;
  letter-spacing: 0;
}

.audit-log-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.audit-log-head button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  box-shadow: none;
}

.audit-log-list {
  overflow: auto;
  padding: 8px;
}

.audit-log-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 10px;
  border-radius: var(--radius-sm);
}

.audit-log-row:hover {
  background: var(--surface-soft);
}

.audit-log-dot {
  width: 9px;
  height: 9px;
  margin-top: 7px;
  border-radius: 999px;
  background: var(--muted);
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.12);
}

.audit-log-dot.create {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
}

.audit-log-dot.update {
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.audit-log-dot.delete {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
}

.audit-log-main {
  min-width: 0;
}

.audit-log-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.audit-log-line strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.audit-log-line time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.audit-log-title {
  margin-top: 4px;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-log-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.audit-log-meta span {
  max-width: 100%;
  padding: 4px 7px;
  border-radius: 999px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.1;
}

.audit-log-fields {
  color: var(--primary) !important;
  background: rgba(37, 99, 235, 0.08) !important;
}

.audit-log-empty {
  padding: 28px 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  text-align: center;
}

@media (max-width: 900px) {
  .audit-log-panel {
    top: 84px;
    right: 12px;
    left: 12px;
    width: auto;
    max-height: calc(100vh - 148px);
  }
}

.audit-log-panel {
  top: 76px;
  right: 20px;
  width: min(720px, calc(100vw - 40px));
  max-height: min(820px, calc(100vh - 100px));
  border-color: rgba(148, 163, 184, 0.28);
  border-radius: 24px;
  background:
    radial-gradient(circle at 92% 4%, rgba(219, 234, 254, 0.82), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
  box-shadow: 0 28px 84px rgba(15, 23, 42, 0.22);
}

.audit-log-head {
  align-items: center;
  padding: 18px 20px 12px;
  border-bottom-color: rgba(226, 232, 240, 0.82);
}

.audit-log-head h2 {
  font-size: 20px;
}

.audit-log-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.audit-log-head-actions button,
.audit-log-export,
.audit-log-load-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 850;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.audit-log-head-actions #auditLogClose {
  width: 34px;
  min-width: 34px;
  padding: 0;
  font-size: 22px;
}

.audit-log-toolbar {
  display: grid;
  gap: 10px;
  padding: 12px 20px 10px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.76);
}

.audit-log-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.audit-log-search svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: #64748b;
  stroke-width: 2.1;
  stroke-linecap: round;
}

.audit-log-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
}

.audit-log-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.audit-log-filters select {
  width: 100%;
  min-height: 34px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 850;
}

.audit-log-finance-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 850;
}

.audit-log-finance-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.audit-log-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.76);
}

.audit-log-stats div {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.70);
}

.audit-log-stats span {
  display: block;
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}

.audit-log-stats strong {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.audit-log-list {
  padding: 14px 18px 18px;
  overflow: auto;
}

.audit-log-date-group {
  display: grid;
  gap: 8px;
}

.audit-log-date-group + .audit-log-date-group {
  margin-top: 18px;
}

.audit-log-date-group h3 {
  position: sticky;
  top: -14px;
  z-index: 1;
  width: fit-content;
  margin: 0 0 2px 26px;
  padding: 5px 10px;
  border: 1px solid rgba(148, 163, 184, 0.20);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.audit-log-timeline {
  position: relative;
  display: grid;
  gap: 10px;
}

.audit-log-timeline::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 11px;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.22), rgba(148, 163, 184, 0.18));
}

.audit-log-row {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  padding: 0;
  border-radius: 18px;
  transition: transform 0.16s ease;
}

.audit-log-row:hover {
  background: transparent;
  transform: translateY(-1px);
}

.audit-log-dot {
  position: relative;
  z-index: 1;
  width: 12px;
  height: 12px;
  margin: 18px auto 0;
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.12);
}

.audit-log-dot.create {
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14);
}

.audit-log-dot.update {
  background: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.14);
}

.audit-log-dot.delete {
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.14);
}

.audit-log-dot.transfer {
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.16);
}

.audit-log-dot.rate {
  background: #8b5cf6;
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.16);
}

.audit-log-card {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  color: inherit;
  text-align: left;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.07);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.audit-log-card:hover {
  border-color: rgba(99, 102, 241, 0.28);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.10);
}

.audit-log-row.importance-high .audit-log-card {
  background: linear-gradient(135deg, rgba(255, 247, 237, 0.92), rgba(255, 255, 255, 0.86));
  border-color: rgba(251, 146, 60, 0.22);
}

.audit-log-row.importance-medium .audit-log-card {
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.88), rgba(255, 255, 255, 0.84));
}

.audit-log-row.importance-low .audit-log-card {
  background: rgba(255, 255, 255, 0.78);
}

.audit-log-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.audit-log-card-top strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.audit-log-card-top time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.audit-log-title {
  margin-top: 6px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 800;
}

.audit-log-summary {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.audit-log-meta {
  gap: 6px;
  margin-top: 9px;
}

.audit-log-meta span {
  background: rgba(248, 250, 252, 0.92);
}

.audit-log-fields {
  color: #4f46e5 !important;
  background: rgba(238, 242, 255, 0.92) !important;
}

.audit-log-load-more {
  width: 100%;
  margin-top: 14px;
}

.audit-row-focus {
  outline: 3px solid rgba(79, 70, 229, 0.28);
  outline-offset: -3px;
  animation: auditRowPulse 1.1s ease 2;
}

@keyframes auditRowPulse {
  0%,
  100% {
    background-color: transparent;
  }
  50% {
    background-color: rgba(238, 242, 255, 0.95);
  }
}

@media (max-width: 900px) {
  .audit-log-panel {
    top: 84px;
    right: 12px;
    left: 12px;
    width: auto;
    max-height: calc(100vh - 148px);
  }

  .audit-log-filters,
  .audit-log-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.audit-log-panel {
  width: min(760px, calc(100vw - 40px));
  max-height: min(820px, calc(100vh - 96px));
}

.audit-log-panel.is-peeking {
  opacity: 0.42;
  transform: translateX(calc(100% - 74px)) scale(0.985);
}

.audit-log-head {
  gap: 14px;
}

.audit-log-head-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.audit-log-head-actions button,
.audit-log-export,
.audit-log-load-more {
  min-height: 36px;
  height: 36px;
  line-height: 1;
}

.audit-log-export {
  min-width: 62px;
  padding-inline: 16px;
  border-radius: 14px;
}

.audit-log-head-actions #auditLogClose {
  width: 36px;
  min-width: 36px;
  height: 36px;
  border-radius: 50%;
}

.audit-log-toolbar {
  grid-template-columns: minmax(220px, 1fr);
  gap: 9px;
}

.audit-log-search,
.audit-log-filters select,
.audit-log-finance-toggle {
  min-height: 38px;
  height: 38px;
}

.audit-log-filters {
  grid-template-columns: repeat(5, minmax(112px, 1fr));
  align-items: center;
}

.audit-log-filters select {
  padding: 0 28px 0 10px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audit-log-finance-toggle {
  padding: 0 12px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.74);
}

.audit-log-stats-wrap {
  display: grid;
  gap: 8px;
  padding: 10px 20px 12px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.76);
}

.audit-log-stats-title {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 900;
}

.audit-log-stats {
  grid-template-columns: repeat(4, minmax(126px, 1fr));
  align-items: stretch;
  padding: 0;
  border-bottom: 0;
}

.audit-log-stats div {
  display: flex;
  min-height: 60px;
  flex-direction: column;
  justify-content: center;
  padding: 9px 10px;
  text-align: center;
}

.audit-log-stats span,
.audit-log-stats strong {
  text-align: center;
}

.audit-log-list {
  overflow-x: hidden;
}

.audit-log-timeline::before {
  left: 12px;
}

.audit-log-row {
  align-items: center;
}

.audit-log-row.is-selected .audit-log-card {
  border-color: rgba(79, 70, 229, 0.38);
  box-shadow: 0 16px 34px rgba(79, 70, 229, 0.13);
}

.audit-log-dot {
  margin: 0 auto;
}

.audit-log-card {
  min-height: 86px;
  cursor: default;
  padding: 12px 14px;
}

.audit-log-card-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 176px;
  gap: 16px;
  align-items: center;
}

.audit-log-row.is-clickable .audit-log-card {
  cursor: pointer;
}

.audit-log-row.is-clickable .audit-log-card:hover {
  border-color: rgba(79, 70, 229, 0.34);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.12);
}

.audit-log-row.is-static .audit-log-card {
  opacity: 0.88;
}

.audit-log-card-copy {
  min-width: 0;
}

.audit-log-card-side {
  display: grid;
  justify-items: end;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-align: right;
}

.audit-log-card-side span,
.audit-log-card-side time,
.audit-log-card-side strong,
.audit-log-card-side em {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.audit-log-card-side time {
  font-style: normal;
  font-variant-numeric: tabular-nums;
}

.audit-log-card-side .audit-log-amount,
.audit-log-card-side .audit-log-fields {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
}

.audit-log-card-side .audit-log-amount {
  background: rgba(240, 253, 244, 0.92);
  color: #15803d;
  font-size: 12px;
  font-weight: 900;
}

.audit-log-card-side .audit-log-amount.delete {
  background: rgba(254, 242, 242, 0.92);
  color: #dc2626;
}

.audit-log-card-side .audit-log-amount.transfer,
.audit-log-card-side .audit-log-amount.rate {
  background: rgba(255, 251, 235, 0.94);
  color: #b45309;
}

.audit-log-card-side .audit-log-fields {
  font-style: normal;
  font-size: 11px;
  font-weight: 900;
}

.audit-log-card-top {
  min-width: 0;
}

.audit-log-card-top strong,
.audit-log-title,
.audit-log-summary {
  overflow: visible;
  white-space: normal;
  text-overflow: clip;
  overflow-wrap: anywhere;
}

.audit-log-card-top {
  gap: 10px;
}

.audit-log-title {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
}

.audit-log-summary {
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
}

.audit-log-card-top time {
  min-width: 42px;
  text-align: right;
}

.audit-log-no-link {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}

@media (max-width: 760px) {
  .audit-log-panel {
    right: 10px;
    left: 10px;
    width: auto;
  }

  .audit-log-panel.is-peeking {
    transform: translateX(calc(100% - 58px)) scale(0.985);
  }

  .audit-log-head {
    align-items: flex-start;
  }

  .audit-log-head-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

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

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

  .audit-log-card-main {
    grid-template-columns: 1fr;
  }

  .audit-log-card-side {
    justify-items: start;
    text-align: left;
  }
}

.cloud-status-icon {
  position: relative !important;
  display: inline-flex !important;
  flex: 0 0 auto !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: visible !important;
  color: var(--danger) !important;
}

.cloud-status-icon svg {
  margin-left: 0 !important;
}

.cloud-status-icon.active {
  color: var(--success) !important;
}

.firebase-status,
.storage-status,
.realtime-status {
  display: none !important;
}

.icon-button {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  color: var(--text-soft);
  border-color: var(--line);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.icon-button:hover:not(:disabled) {
  color: var(--primary);
  border-color: rgba(37, 99, 235, 0.26);
  background: var(--primary-soft);
  box-shadow: var(--shadow-sm);
}

.icon-button.danger:hover:not(:disabled) {
  color: var(--danger);
  border-color: rgba(220, 38, 38, 0.24);
  background: var(--danger-soft);
}

.icon-button svg {
  width: 15px;
  height: 15px;
}

@media (max-width: 900px) {
  body {
    padding: 96px var(--space-3) var(--space-3);
  }

  .top-nav {
    top: 0;
    left: 0;
    right: 0;
    flex-wrap: wrap;
    flex-direction: row;
    width: 100%;
    height: auto;
    min-height: 72px;
    padding: var(--space-2);
    border-right: 0;
    border-bottom: 1px solid var(--line);
    margin-bottom: 0;
  }

  .top-nav::before {
    display: none;
  }

  .top-nav::after {
    display: none;
  }

  .top-nav a {
    width: auto;
    flex: 1 1 0;
    min-width: 0;
  }

  .top-nav button {
    justify-content: center;
    min-height: 42px;
    padding: 0;
    color: transparent !important;
    font-size: 0;
    gap: 0;
    overflow: hidden;
  }

  .top-nav button svg {
    display: block;
    margin: 0 !important;
    color: var(--text-soft) !important;
    opacity: 1;
  }

  .page-index .top-nav a[href="index.html"] button svg,
  .page-rnp .top-nav a[href="rnp.html"] button svg,
  .page-tasks .top-nav a[href="tasks.html"] button svg,
  .page-financial-calendar .top-nav a[href="financial-calendar.html"] button svg,
  .page-costing .top-nav a[href="costing.html"] button svg,
  .page-categories .top-nav a[href="categories.html"] button svg,
  .page-annual-report .top-nav a[href="annual-report.html"] button svg,
  .page-access .top-nav a[href="access.html"] button svg {
    color: var(--primary) !important;
  }

  .app-header {
    display: none;
  }

  body::before {
    display: none;
  }

  .card {
    width: 100%;
    margin-right: 0;
  }

  .card {
    padding: var(--space-4);
  }

  .accounts-stats {
    width: 100%;
  }

  .accounts-total-row {
    flex-direction: column;
    justify-content: stretch;
  }

  .dds-events-widget {
    width: 100%;
    margin-right: 0;
    max-width: none;
    border-bottom: 1px solid rgba(100, 116, 139, 0.16);
    padding: 4px 4px 10px;
  }

  .accounts-grid {
    flex-wrap: wrap;
    gap: 0;
    padding: 0;
  }

  .acc-card {
    flex: 1 1 220px;
    min-height: 68px;
  }

  .acc-card-total {
    flex-basis: 100%;
  }

  .grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "date"
      "from"
      "to"
      "cat"
      "sub"
      "amount"
      "note";
  }

  .usdt-rate-box,
  .usdt-rate-summary,
  .usdt-rate-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .usdt-rate-panel {
    position: static;
    width: 100%;
    margin-top: var(--space-2);
  }

  .usdt-rate-panel-grid {
    grid-template-columns: 1fr;
  }

  .filter-row,
  .access-form,
  .auth-form,
  .task-form,
  .task-filters,
  .task-summary-grid {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .task-form textarea {
    grid-column: auto;
  }

  #createTaskBtn {
    min-height: 42px;
  }

  .task-field-description {
    grid-column: auto;
  }

  .auth-actions {
    flex-direction: column;
  }

  table {
    display: table;
    white-space: nowrap;
    min-width: 760px;
  }

  .page-index #table {
    min-width: 0;
    white-space: normal;
  }

  .page-index .table-scroll {
    overflow-x: hidden;
  }

  .table-card {
    overflow: visible;
  }

  .table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
  }

  #catTable {
    min-width: 620px;
  }

  #membersTable,
  #invitesTable {
    min-width: 860px;
  }

  th {
    top: auto;
  }

  .cloud-status-wrap {
    position: fixed;
    top: auto;
    right: var(--space-3);
    bottom: var(--space-3);
  }
}

/* Sidebar clean overlay layout.
   One final rule set only:
   - the sidebar opens over the page without changing body/sidebar width variable;
   - the top header, title, rates and right buttons keep their own fixed positions;
   - heavy pages do not recalculate layout on sidebar open;
   - expanded menu uses clean glass style without separate item cards. */
@media (min-width: 901px) {
  :root {
    --sidebar-collapsed-width: 72px;
    --sidebar-expanded-width: 264px;
  }

  html,
  body {
    overflow-x: hidden;
  }

  body,
  body.sidebar-expanded {
    --sidebar-width: var(--sidebar-collapsed-width) !important;
    padding-left: calc(var(--sidebar-collapsed-width) + 32px) !important;
    transition: none !important;
  }

  body::before,
  body.sidebar-expanded::before {
    left: var(--sidebar-collapsed-width) !important;
    z-index: 25 !important;
    background: rgba(255, 255, 255, 0.72) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    box-shadow: none !important;
    transition: none !important;
  }

  .top-nav {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: var(--sidebar-collapsed-width) !important;
    min-width: var(--sidebar-collapsed-width) !important;
    max-width: var(--sidebar-expanded-width) !important;
    z-index: 1000 !important;
    background: rgba(255, 255, 255, 0.82) !important;
    backdrop-filter: blur(14px) saturate(130%) !important;
    -webkit-backdrop-filter: blur(14px) saturate(130%) !important;
    box-shadow: none !important;
    contain: layout paint style;
    will-change: width;
    transform: translateZ(0);
    transition:
      width 140ms cubic-bezier(.2, .8, .2, 1),
      padding 140ms cubic-bezier(.2, .8, .2, 1),
      background 140ms ease-out,
      box-shadow 140ms ease-out !important;
  }

  body.sidebar-expanded .top-nav {
    width: var(--sidebar-expanded-width) !important;
    min-width: var(--sidebar-expanded-width) !important;
    padding-left: 18px !important;
    padding-right: 18px !important;
    background: rgba(255, 255, 255, 0.90) !important;
    box-shadow: 18px 0 42px rgba(15, 23, 42, 0.12) !important;
  }

  body.sidebar-expanded main,
  body.sidebar-expanded .page,
  body.sidebar-expanded .page-shell,
  body.sidebar-expanded .content,
  body.sidebar-expanded .container,
  body.sidebar-expanded .app-shell,
  body.sidebar-expanded .rnp-page,
  body.sidebar-expanded .rnp-layout,
  body.sidebar-expanded .financial-calendar-page {
    margin-left: 0 !important;
    transform: none !important;
    left: auto !important;
  }

  #cloudStatusIcons,
  .cloud-status-wrap,
  .page-top-title,
  .page-title,
  .header-actions,
  .top-actions,
  .rates-row,
  .currency-rates,
  .currency-rates-bar {
    transform: none !important;
    margin-left: 0 !important;
  }

  .cloud-status-wrap {
    z-index: 46 !important;
  }

  .page-top-title {
    z-index: 45 !important;
  }

  .currency-rates-bar {
    z-index: 44 !important;
  }

  body.sidebar-expanded .top-nav a,
  body.sidebar-expanded .top-nav button {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
  }

  body.sidebar-expanded .top-nav button:hover {
    color: var(--primary) !important;
    background: rgba(37, 99, 235, 0.07) !important;
  }

  body.sidebar-expanded .top-nav button.active,
  body.sidebar-expanded .top-nav a[aria-current="page"] button,
  body.sidebar-expanded.page-index .top-nav a[href="index.html"] button,
  body.sidebar-expanded.page-rnp .top-nav a[href="rnp.html"] button,
  body.sidebar-expanded.page-tasks .top-nav a[href="tasks.html"] button,
  body.sidebar-expanded.page-financial-calendar .top-nav a[href="financial-calendar.html"] button,
  body.sidebar-expanded.page-costing .top-nav a[href="costing.html"] button,
  body.sidebar-expanded.page-categories .top-nav a[href="categories.html"] button,
  body.sidebar-expanded.page-annual-report .top-nav a[href="annual-report.html"] button,
  body.sidebar-expanded.page-access .top-nav a[href="access.html"] button {
    color: var(--primary) !important;
    background: rgba(37, 99, 235, 0.10) !important;
    border-color: transparent !important;
    box-shadow: none !important;
  }

  body.sidebar-expanded .top-nav button svg,
  body.sidebar-expanded .top-nav a {
    background: transparent !important;
    box-shadow: none !important;
  }
}


/* Access page clean layout */
.access-profile-summary {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 12px 0 10px;
}

.page-access #membersTable {
  width: 100%;
  table-layout: fixed;
}

.page-access #membersTable th,
.page-access #membersTable td {
  vertical-align: middle;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.page-access #membersTable th:nth-child(1),
.page-access #membersTable td:nth-child(1) {
  width: 22%;
}

.page-access #membersTable th:nth-child(2),
.page-access #membersTable td:nth-child(2) {
  width: 28%;
}

.page-access #membersTable th:nth-child(3),
.page-access #membersTable td:nth-child(3) {
  width: 16%;
}

.page-access #membersTable th:nth-child(4),
.page-access #membersTable td:nth-child(4) {
  width: 14%;
}

.page-access #membersTable th:nth-child(5),
.page-access #membersTable td:nth-child(5) {
  width: 20%;
}

.access-role-select,
.access-member-action-select {
  width: 100%;
  min-height: 38px;
}

.access-manage-cell {
  color: var(--muted);
  font-weight: 750;
}

.access-member-action-form {
  display: grid;
  grid-template-columns: minmax(145px, 1fr) 54px;
  gap: 8px;
  align-items: center;
  max-width: 260px;
}

.access-member-action-apply {
  width: 54px;
  min-width: 54px;
  min-height: 38px;
  padding: 0;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 850;
  box-shadow: none;
}

@media (max-width: 1180px) {
  .page-access #membersTable {
    min-width: 1040px;
  }
}
