:root {
  --fox-bg: #efefef;
  --fox-bg-accent: #e8e6e6;
  --fox-surface: #f7f6f6;
  --fox-card: rgba(239, 237, 237, 0.88);
  --fox-sidebar: #563937;
  --fox-sidebar-pill: #7a5654;
  --fox-text: #373737;
  --fox-muted: #8b8b8b;
  --fox-line: #dbd4d4;
  --fox-link: #4f74eb;
  --fox-blue: #89aefb;
  --fox-green: #2bbd8f;
  --fox-neon: #18ef2e;
  --fox-shadow: 0 24px 50px rgba(86, 57, 55, 0.1);
  --fox-shadow-sm: 0 10px 24px rgba(86, 57, 55, 0.08);
  --fox-radius-lg: 24px;
  --fox-radius-md: 18px;
  --fox-radius-sm: 12px;
  --fox-sidebar-width: 270px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at top left, rgba(122, 86, 84, 0.08), transparent 30%),
    radial-gradient(circle at top right, rgba(137, 174, 251, 0.08), transparent 28%),
    linear-gradient(180deg, var(--fox-bg) 0%, var(--fox-bg-accent) 100%);
  color: var(--fox-text);
  font-family: "Segoe UI", "Inter", "Helvetica Neue", sans-serif;
  letter-spacing: -0.01em;
}

img {
  display: block;
  max-width: 100%;
}

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

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

input,
select,
textarea {
  width: 100%;
  min-height: 50px;
  padding: 13px 16px;
  border: 1px solid var(--fox-line);
  border-radius: 14px;
  outline: none;
  background: rgba(252, 250, 250, 0.94);
  color: var(--fox-text);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(122, 86, 84, 0.45);
  box-shadow: 0 0 0 4px rgba(122, 86, 84, 0.12);
  background: #fffdfd;
}

input[type="radio"],
input[type="checkbox"],
input[type="hidden"] {
  width: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
}

input[type="color"] {
  min-height: 56px;
  padding: 6px;
  background: #fff;
}

button,
.button-primary,
.button-link,
.danger-button,
a.button-primary,
a.button-link {
  min-height: 46px;
  padding: 11px 18px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

button:hover,
.button-primary:hover,
.button-link:hover,
.danger-button:hover,
a.button-primary:hover,
a.button-link:hover {
  transform: translateY(-1px);
  filter: saturate(1.02);
}

button,
.button-primary,
a.button-primary {
  background: linear-gradient(135deg, #563937 0%, #7a5654 100%);
  color: #fff8f8;
  box-shadow: 0 16px 30px rgba(86, 57, 55, 0.2);
}

.button-link,
a.button-link {
  background: rgba(122, 86, 84, 0.1);
  color: #6d4f4d;
  box-shadow: none;
}

.danger-button {
  background: linear-gradient(135deg, #d45757 0%, #b63f4b 100%);
  color: white;
  box-shadow: 0 14px 28px rgba(182, 63, 75, 0.18);
}

label {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: #584847;
}

p {
  line-height: 1.55;
}

.hidden {
  display: none !important;
}

.fox-shell {
  min-height: 100vh;
  padding: 42px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fox-page {
  width: min(1120px, 100%);
  display: grid;
  gap: 22px;
}

.fox-page.compact {
  width: min(760px, 100%);
}

.fox-hero {
  display: flex;
  align-items: center;
  gap: 16px;
}

.fox-hero img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border-radius: 18px;
  box-shadow: 0 14px 26px rgba(86, 57, 55, 0.12);
}

.fox-hero-copy h1,
.fox-card h1,
.panel h2,
.preset-card h2 {
  margin: 0;
}

.fox-hero-copy h1 {
  font-size: clamp(32px, 4vw, 46px);
  font-weight: 750;
  letter-spacing: -0.04em;
}

.fox-hero-copy p {
  margin: 4px 0 0;
  color: var(--fox-muted);
  font-size: 17px;
}

.fox-card,
.preset-card,
.panel {
  padding: 28px;
  background: var(--fox-card);
  border: 1px solid rgba(219, 212, 212, 0.95);
  backdrop-filter: blur(18px);
  box-shadow: var(--fox-shadow);
}

.fox-card {
  border-radius: 28px;
}

.fox-stack {
  display: grid;
  gap: 18px;
}

.fox-stack.tight {
  gap: 12px;
}

.fox-section-title {
  margin: 0;
  font-size: 24px;
  font-weight: 750;
  letter-spacing: -0.03em;
}

.fox-section-copy {
  margin: 0;
  color: var(--fox-muted);
}

.field-group {
  display: grid;
  gap: 8px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.inline-options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.inline-options label,
.choice-card {
  min-height: 52px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--fox-line);
  background: rgba(250, 247, 247, 0.95);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.actions form {
  margin: 0;
}

.message-error,
.message-success {
  margin: 0;
  padding: 14px 16px;
  border-radius: 16px;
  font-weight: 600;
  box-shadow: var(--fox-shadow-sm);
}

.message-error {
  background: #fff4f4;
  color: #b1414f;
  border: 1px solid #f2d0d4;
}

.message-success {
  background: #f1fbf6;
  color: #1f7a56;
  border: 1px solid #caead9;
}

.preset-list,
.feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.preset-list li,
.feature-list li {
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, #f5f3f3 0%, #ece8e8 100%);
  border: 1px solid #ddd5d5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(240px, 340px) minmax(0, 1fr);
  gap: 18px;
}

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

.category-link {
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, #f5f3f3 0%, #ece8e8 100%);
  border: 1px solid #ddd5d5;
  transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
  box-shadow: var(--fox-shadow-sm);
}

.category-link:hover {
  transform: translateY(-1px);
  border-color: #ccb0ae;
}

.category-link.active {
  background: linear-gradient(180deg, #f0e6e5 0%, #e9dddc 100%);
  border-color: #b99491;
}

.category-link + .category-link {
  margin-top: 0;
}

.category-meta {
  margin-top: 6px;
  color: var(--fox-muted);
  font-size: 14px;
}

.picker-box {
  margin-top: 14px;
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, #f7f4f4 0%, #efebeb 100%);
  border: 1px solid #e4dcdc;
}

.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(54px, 1fr));
  gap: 10px;
}

.icon-grid button {
  min-height: 50px;
  padding: 0;
  border-radius: 14px;
  background: white;
  color: #6e4a48;
  box-shadow: var(--fox-shadow-sm);
}

.icon-grid svg,
.icon-grid i {
  width: 22px;
  height: 22px;
}

.preview-box {
  margin-top: 16px;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, #f7f4f4 0%, #efebeb 100%);
  border: 1px solid #e4dcdc;
  display: flex;
  align-items: center;
  gap: 14px;
}

.icon-preview {
  width: 62px;
  height: 62px;
  border-radius: 16px;
  background: white;
  border: 1px solid #e7d8d8;
  display: grid;
  place-items: center;
  box-shadow: var(--fox-shadow-sm);
}

.icon-preview svg,
.icon-preview i {
  width: 30px;
  height: 30px;
}

.fox-link-row {
  display: flex;
  justify-content: center;
}

.fox-note {
  color: var(--fox-muted);
  font-size: 14px;
}

.app,
.dashboard-layout,
.fox-app,
body.fox-dashboard {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--fox-sidebar-width) minmax(0, 1fr);
}

.sidebar,
.side-nav,
.dashboard-sidebar,
.fox-sidebar {
  background: linear-gradient(180deg, #543535 0%, #4d3231 100%);
  color: #f6f1f1;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.brand,
.logo-row,
.sidebar-brand,
.fox-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 4px;
}

.brand img,
.logo-row img,
.sidebar-brand img,
.fox-brand img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  flex: 0 0 auto;
}

.brand h1,
.brand-title,
.logo-row span,
.sidebar-brand span,
.fox-brand span {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.nav,
.sidebar-nav,
.menu,
.fox-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav a,
.nav button,
.sidebar-nav a,
.menu a,
.fox-menu a,
.nav-item {
  min-height: 48px;
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  color: #f5efef;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 20px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.18s ease, transform 0.18s ease;
}

.nav a:hover,
.nav button:hover,
.sidebar-nav a:hover,
.menu a:hover,
.fox-menu a:hover,
.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.nav .active,
.nav a[aria-current="page"],
.sidebar-nav .active,
.menu .active,
.fox-menu .active,
.nav-item.active {
  background: var(--fox-sidebar-pill);
}

.nav svg,
.nav i,
.sidebar-nav svg,
.menu svg,
.fox-menu svg,
.nav-item svg {
  width: 34px;
  height: 34px;
  stroke-width: 2.2;
  flex: 0 0 auto;
}

.sidebar .spacer,
.fox-sidebar .spacer,
.sidebar-spacer {
  flex: 1 1 auto;
}

.main,
.dashboard-main,
.content,
.fox-main {
  min-width: 0;
  padding: 18px 14px;
}

.topbar,
.dashboard-topbar,
.header-row,
.fox-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.page-title,
.dashboard-title,
.topbar h1,
.main h1:first-child {
  margin: 0;
  font-size: clamp(32px, 3vw, 42px);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.search,
.search-box,
.searchbar,
.topbar input[type="search"] {
  width: min(100%, 245px);
  height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  outline: none;
  background: #d6d6d6;
  color: #555;
}

.search::placeholder,
.search-box::placeholder,
.searchbar::placeholder,
.topbar input[type="search"]::placeholder {
  color: #8d8d8d;
}

.icon-button,
.bell-button,
.topbar-action {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  display: grid;
  place-items: center;
  color: #6f6f6f;
  cursor: pointer;
}

.icon-button svg,
.bell-button svg,
.topbar-action svg {
  width: 34px;
  height: 34px;
  stroke-width: 1.8;
}

.dashboard-grid,
.content-grid,
.main-grid,
.fox-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.9fr);
  gap: 16px;
}

.card,
.panel,
.widget,
.fox-card {
  background: var(--fox-card);
  border-radius: var(--fox-radius-lg);
  box-shadow: var(--fox-shadow);
}

.budget-card,
.expenses-card,
.progress-card,
.transaction-card,
.budget-panel,
.expenses-panel {
  background: var(--fox-card);
  border-radius: var(--fox-radius-lg);
  box-shadow: var(--fox-shadow);
}

.budget-card,
.expenses-card {
  min-height: 286px;
  padding: 12px 18px 16px;
}

.card-title,
.panel-title,
.budget-card h2,
.expenses-card h2,
.progress-card h2 {
  margin: 0 0 8px;
  font-size: 23px;
  font-weight: 400;
}

.budget-content,
.budget-body,
.chart-wrap {
  display: grid;
  grid-template-columns: minmax(220px, 240px) minmax(0, 1fr);
  align-items: center;
  gap: 24px;
}

.donut,
.budget-ring,
.chart-donut {
  width: 230px;
  height: 230px;
  margin: 2px auto 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--fox-card) 0 44%, transparent 45%),
    conic-gradient(
      #f7e806 0deg 30deg,
      #b5d515 30deg 60deg,
      #11c70e 60deg 90deg,
      #21bcaf 90deg 120deg,
      #1772d7 120deg 150deg,
      #4250d7 150deg 180deg,
      #7924c3 180deg 210deg,
      #c92c8d 210deg 240deg,
      #ff3c1f 240deg 270deg,
      #ff651d 270deg 300deg,
      #f8a40d 300deg 330deg,
      #e6cc24 330deg 360deg
    );
  position: relative;
}

.donut::after,
.budget-ring::after,
.chart-donut::after {
  content: attr(data-center);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #2f2f2f;
  font-size: 28px;
  font-weight: 700;
}

.legend,
.budget-legend,
.category-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.legend-item,
.category-item,
.budget-category {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  align-items: start;
}

.legend-item svg,
.legend-item i,
.category-item svg,
.budget-category svg {
  width: 18px;
  height: 18px;
  margin-top: 4px;
}

.legend-item strong,
.category-name,
.budget-category-name {
  display: block;
  font-size: 18px;
  line-height: 1.05;
}

.legend-item span,
.category-meta,
.budget-category-amount {
  color: #7f7f7f;
  font-size: 16px;
}

.expenses-header,
.panel-header,
.card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.link,
.view-all,
.expenses-header a {
  color: var(--fox-link);
  font-weight: 500;
}

.expense-list,
.upcoming-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 12px;
}

.expense-item,
.upcoming-item {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  font-size: 19px;
}

.expense-item svg,
.expense-item i,
.upcoming-item svg {
  width: 22px;
  height: 22px;
  color: var(--fox-blue);
}

.expense-date,
.upcoming-date {
  color: var(--fox-muted);
  font-weight: 600;
}

.expense-amount,
.upcoming-amount {
  font-size: 18px;
  color: #3f3f3f;
}

.wide-card,
.progress-card,
.transactions-card,
.activity-card {
  grid-column: 1 / -1;
  padding: 18px 28px 24px;
}

.progress-header,
.spending-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 18px;
}

.progress-header h2,
.spending-header h2 {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.progress-total,
.spending-total {
  font-size: 24px;
  color: #a4a4a4;
}

.progress-total strong,
.spending-total strong {
  color: #373737;
  font-weight: 500;
}

.progress-percent,
.spending-percent {
  font-size: 24px;
  color: #3d3d3d;
}

.edit-button,
.edit-icon {
  width: 34px;
  height: 34px;
  color: var(--fox-blue);
}

.progress-track,
.spending-track,
.progress-bar {
  position: relative;
  height: 34px;
  margin-top: 6px;
  border-radius: 999px;
  background: #d8d6d6;
  overflow: hidden;
}

.progress-fill,
.spending-fill,
.progress-value {
  height: 100%;
  width: var(--progress-width, 20%);
  border-radius: inherit;
  background: linear-gradient(90deg, #2abb90 0%, #32c190 100%);
}

.transaction-list,
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}

.transaction-item,
.activity-item {
  min-height: 90px;
  padding: 18px 22px;
  border-radius: var(--fox-radius-md);
  background: #d8d6d6;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
}

.transaction-icon,
.activity-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--fox-neon);
}

.transaction-icon svg,
.activity-icon svg,
.transaction-item > svg:first-child {
  width: 40px;
  height: 40px;
  stroke-width: 2.2;
}

.transaction-name,
.activity-name {
  font-size: 28px;
  font-weight: 500;
}

.transaction-date,
.activity-date {
  font-size: 27px;
  color: #474747;
}

.transaction-amount,
.activity-amount {
  font-size: 28px;
  color: #3c3c3c;
}

.text-green {
  color: var(--fox-neon);
}

.text-blue {
  color: var(--fox-blue);
}

.text-red {
  color: #ff3f3f;
}

.text-muted {
  color: var(--fox-muted);
}

@media (max-width: 1100px) {
  .dashboard-grid,
  .content-grid,
  .main-grid,
  .fox-grid {
    grid-template-columns: 1fr;
  }

  .budget-content,
  .budget-body,
  .chart-wrap {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .expenses-card {
    min-height: 0;
  }
}

@media (max-width: 860px) {
  .app,
  .dashboard-layout,
  .fox-app,
  body.fox-dashboard {
    grid-template-columns: 1fr;
  }

  .sidebar,
  .side-nav,
  .dashboard-sidebar,
  .fox-sidebar {
    gap: 10px;
  }

  .nav,
  .sidebar-nav,
  .menu,
  .fox-menu {
    overflow-x: auto;
    flex-direction: row;
    padding-bottom: 6px;
  }

  .sidebar .spacer,
  .fox-sidebar .spacer,
  .sidebar-spacer {
    display: none;
  }

  .topbar,
  .dashboard-topbar,
  .header-row,
  .fox-topbar,
  .progress-header,
  .spending-header,
  .transaction-item,
  .activity-item {
    grid-template-columns: 1fr;
  }

  .search,
  .search-box,
  .searchbar,
  .topbar input[type="search"] {
    width: 100%;
  }

  .wide-card,
  .progress-card,
  .transactions-card,
  .activity-card {
    padding-inline: 18px;
  }

  .field-grid,
  .layout {
    grid-template-columns: 1fr;
  }

  .transaction-name,
  .activity-name,
  .transaction-date,
  .activity-date,
  .transaction-amount,
  .activity-amount {
    font-size: 22px;
  }

  .fox-card,
  .preset-card,
  .panel {
    padding: 20px;
  }
}
