
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --sidebar: #111b2c;
  --text: #172236;
  --muted: #8490a3;
  --border: #e9edf3;
  --green: #19a875;
  --green-light: #e6f7ef;
  --red: #e76b70;
  --purple: #8171df;
  --orange: #f0a44b;
  --radius: 16px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
  display: flex;
}

.sidebar {
  width: 245px;
  flex-shrink: 0;
  background: var(--sidebar);
  color: #fff;
  padding: 30px 18px 20px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: 'Manrope', sans-serif;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.8px;
  padding: 0 8px;
  margin-bottom: 49px;
}

.brand-icon {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--green);
  color: white;
  font-size: 21px;
}

.brand-light {
  color: #45d8a1;
}

.nav-label {
  color: #718096;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 0 12px;
  margin-bottom: 15px;
}

.navigation {
  display: grid;
  gap: 7px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 46px;
  padding: 0 13px;
  border-radius: 10px;
  color: #aab5c7;
  transition: background 0.2s, color 0.2s;
}

.nav-link:hover,
.nav-link.active {
  background: #1d3041;
  color: #54e0aa;
}

.nav-icon {
  width: 20px;
  font-size: 19px;
  text-align: center;
}

.sidebar-bottom {
  margin-top: auto;
}

.upgrade-card {
  padding: 18px 15px;
  margin: 35px 0 22px;
  border: 1px solid #2b3c4e;
  border-radius: 13px;
  background: linear-gradient(140deg, #1b2e3d, #172538);
}

.upgrade-symbol {
  color: #51d8a4;
  font-size: 21px;
}

.upgrade-card h3 {
  margin: 9px 0 5px;
  font-size: 13px;
}

.upgrade-card p {
  color: #98a8b9;
  font-size: 11px;
  line-height: 1.7;
}

.profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 4px 0;
  border-top: 1px solid #2a3748;
}

.avatar {
  width: 37px;
  height: 37px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #d9f2e7;
  color: #167a58;
  font-weight: 700;
}

.profile-info {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 3px;
}

.profile-info strong {
  font-size: 11px;
}

.profile-info span {
  font-size: 10px;
  color: #98a8b9;
}

.profile-dots {
  color: #aab5c7;
  letter-spacing: 2px;
}

.main-content {
  flex: 1;
  min-width: 0;
  padding: 34px 38px 20px;
}

.topbar,
.topbar-actions,
.welcome-row,
.panel-heading,
.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar {
  gap: 20px;
  margin-bottom: 30px;
}

.eyebrow {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.4px;
  margin-bottom: 5px;
}

h1,
h2,
h3 {
  font-family: 'Manrope', sans-serif;
  letter-spacing: -0.6px;
}

.topbar h1 {
  font-size: 28px;
  font-weight: 800;
}

.topbar-actions {
  gap: 12px;
}

.date-chip,
.period-select,
.select-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 13px;
  color: #586579;
  white-space: nowrap;
}

.primary-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  border: none;
  border-radius: 9px;
  background: var(--green);
  color: #fff;
  padding: 12px 17px;
  font-weight: 600;
  box-shadow: 0 5px 14px #19a87522;
}

.primary-btn:hover {
  background: #138d62;
}

.primary-btn span {
  font-size: 18px;
}

.welcome-row {
  gap: 16px;
  margin-bottom: 24px;
}

.welcome-row h2 {
  font-size: 19px;
  margin-bottom: 4px;
}

.welcome-row h2 span {
  color: var(--orange);
}

.welcome-row p,
.panel-heading p {
  color: var(--muted);
  font-size: 12px;
}

.period-select {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
}

.period-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 17px;
  margin-bottom: 22px;
}

.summary-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 18px;
  min-width: 0;
}

.balance-card {
  background: #15283a;
  color: #fff;
  border-color: #15283a;
}

.card-top {
  color: #7f8ca0;
  font-size: 12px;
  gap: 8px;
}

.balance-card .card-top {
  color: #b4c5d5;
}

.card-icon {
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  border-radius: 10px;
  background: #eef1ff;
  color: var(--purple);
  font-size: 19px;
}

.income-icon {
  background: #e6f7ef;
  color: var(--green);
}

.expense-icon {
  background: #fff0ee;
  color: var(--red);
}

.savings-icon {
  background: #fff4e5;
  color: var(--orange);
}

.summary-card h2 {
  font-size: clamp(17px, 1.7vw, 23px);
  margin: 19px 0 12px;
  font-weight: 800;
  white-space: nowrap;
}

.card-note {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 10px;
  color: var(--muted);
}

.balance-card .card-note {
  color: #b4c5d5;
}

.trend {
  font-weight: 700;
}

.trend.up {
  color: var(--green);
}

.trend.down {
  color: #e4a054;
}

.balance-decoration {
  position: absolute;
  width: 90px;
  height: 90px;
  border: 18px solid #ffffff08;
  border-radius: 50%;
  right: -26px;
  bottom: -36px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(270px, 1fr);
  gap: 20px;
  margin-bottom: 22px;
  align-items: stretch;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 23px;
  min-width: 0;
}

.panel-heading {
  gap: 12px;
  margin-bottom: 22px;
}

.panel-heading h3 {
  font-size: 16px;
  margin-bottom: 4px;
}

.select-btn,
.more-btn {
  font-size: 11px;
}

.more-btn {
  border: 0;
  background: transparent;
  color: #7d8ba0;
  letter-spacing: 2px;
}

.chart-legend {
  display: flex;
  gap: 18px;
  color: #758197;
  font-size: 11px;
  margin-bottom: 17px;
}

.chart-legend span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.chart-legend i {
  width: 8px;
  height: 8px;
  border-radius: 3px;
}

.legend-income {
  background: var(--green);
}

.legend-expense {
  background: #a69aee;
}

.chart {
  height: 210px;
  display: flex;
  position: relative;
}

.chart-grid {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #99a3b2;
  font-size: 10px;
}

.chart-grid span {
  display: flex;
  align-items: center;
  gap: 9px;
}

.chart-grid span::after {
  content: "";
  height: 1px;
  background: #edf0f5;
  flex: 1;
}

.chart-bars {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  width: calc(100% - 41px);
  margin-left: 41px;
}

.bar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  flex: 1;
  gap: 10px;
  color: #8894a5;
  font-size: 10px;
}

.bar-pair {
  height: calc(100% - 21px);
  display: flex;
  align-items: flex-end;
  gap: 4px;
}

.bar {
  display: block;
  width: clamp(8px, 1.5vw, 17px);
  height: var(--h);
  border-radius: 4px 4px 1px 1px;
}

.bar.income {
  background: #24b782;
}

.bar.expense {
  background: #b2a6f1;
}

.current-month .bar.income {
  background: #117c57;
}

.budget-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 21px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 21px;
}

.muted {
  font-size: 11px;
  color: var(--muted);
}

.budget-total h2 {
  font-size: 22px;
  margin-top: 5px;
}

.budget-ring {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--green) 0 71.5%, #e9f1ed 71.5% 100%);
  flex-shrink: 0;
}

.ring-inner {
  width: 65px;
  height: 65px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.ring-inner strong {
  font-size: 13px;
}

.ring-inner span {
  font-size: 9px;
  color: var(--muted);
}

.budget-progress {
  margin-bottom: 17px;
}

.progress-label,
.progress-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.progress-label {
  font-size: 11px;
  margin-bottom: 9px;
}

.progress-label strong {
  font-size: 11px;
}

.progress-track {
  width: 100%;
  height: 6px;
  border-radius: 10px;
  background: #eef1f5;
  overflow: hidden;
}

.progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.food-progress {
  width: 62.5%;
  background: var(--green);
}

.transport-progress {
  width: 60%;
  background: var(--purple);
}

.shopping-progress {
  width: 82.5%;
  background: var(--orange);
}

.progress-foot {
  margin-top: 6px;
  color: var(--muted);
  font-size: 9px;
}

.transactions-panel {
  padding-bottom: 7px;
}

.transaction-heading {
  margin-bottom: 20px;
}

.view-all {
  color: var(--green);
  font-weight: 700;
  font-size: 11px;
  white-space: nowrap;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  white-space: nowrap;
}

thead {
  background: #f8f9fc;
}

th {
  padding: 13px 12px;
  color: #8b96a8;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.7px;
}

td {
  padding: 15px 12px;
  border-bottom: 1px solid #eff1f5;
  color: #7b8799;
  font-size: 11px;
}

tbody tr:last-child td {
  border-bottom: none;
}

.transaction-name {
  display: flex;
  align-items: center;
  gap: 11px;
}

.transaction-icon {
  width: 37px;
  height: 37px;
  flex-shrink: 0;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 15px;
}

.groceries {
  background: #fff3e5;
}

.salary {
  background: #e5f7ef;
  color: var(--green);
  font-size: 20px;
}

.transport {
  background: #edf0ff;
}

.freelance {
  background: #f0ebff;
  color: var(--purple);
}

.transaction-name span:last-child {
  display: grid;
  gap: 3px;
}

.transaction-name strong {
  color: #263349;
  font-size: 11px;
}

.transaction-name small {
  color: #9aa4b4;
  font-size: 10px;
}

.amount {
  font-weight: 700;
}

.income-amount {
  color: var(--green);
}

.expense-amount {
  color: #273348;
}

.status {
  display: inline-block;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 700;
}

.completed {
  background: #e8f8f0;
  color: #19885f;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 20px;
  color: #9aa4b4;
  font-size: 10px;
}

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}


.transaction-form-panel {
  margin-bottom: 22px;
}

.transaction-form-panel[hidden] {
  display: none;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px;
}

.form-grid label {
  display: grid;
  gap: 7px;
  color: #586579;
  font-size: 12px;
  font-weight: 600;
}

.form-grid input,
.form-grid select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.form-grid input:focus,
.form-grid select:focus {
  outline: 2px solid #19a87530;
  border-color: var(--green);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.form-message {
  margin-top: 10px;
  color: var(--green);
  font-size: 12px;
}

@media (max-width: 500px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}


/* Transaction search and filters */
.transaction-tools {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 180px 180px;
  gap: 12px;
  margin: 20px 0;
}

.transaction-tools input,
.transaction-tools select {
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--border, #263548);
  border-radius: 10px;
  background: var(--card-bg, #111c2d);
  color: inherit;
  font: inherit;
  outline: none;
}

.transaction-tools input:focus,
.transaction-tools select:focus {
  border-color: #6c7cff;
}

@media (max-width: 650px) {
  .transaction-tools {
    grid-template-columns: 1fr;
  }
}


.transaction-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.transaction-actions button {
  padding: 5px 9px;
  border: 1px solid #34445a;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.transaction-actions .transaction-edit-btn:hover {
  border-color: #818cf8;
  color: #a5b4fc;
}

.transaction-actions .transaction-delete-btn:hover {
  border-color: #f87171;
  color: #f87171;
}


/* SpendWise: Transaction Search and Filters */
.transaction-tools {
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) minmax(150px, 1fr) minmax(150px, 1fr);
  gap: 12px;
  margin: 20px 0;
  width: 100%;
}

.transaction-tools input,
.transaction-tools select {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #34445a;
  border-radius: 8px;
  background-color: #182436;
  color: #f1f5f9;
  font: inherit;
  box-sizing: border-box;
  opacity: 1;
}

.transaction-tools input::placeholder {
  color: #a0aec0;
  opacity: 1;
}

.transaction-tools select option {
  background-color: #182436;
  color: #f1f5f9;
}

.transaction-tools input:focus,
.transaction-tools select:focus {
  outline: 2px solid #818cf8;
  outline-offset: 1px;
}

@media (max-width: 700px) {
  .transaction-tools {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   SpendWise - Professional Delete Modal
======================================== */

.sw-modal-overlay[hidden] {
  display: none !important;
}

.sw-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(3, 8, 18, 0.76);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: sw-overlay-in 0.2s ease;
}

.sw-modal {
  width: 100%;
  max-width: 420px;
  padding: 30px;
  border: 1px solid #334155;
  border-radius: 18px;
  background: #111c2d;
  color: #f1f5f9;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  text-align: center;
  animation: sw-modal-in 0.22s ease;
  outline: none;
}

.sw-modal-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 18px;
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: 50%;
  background: rgba(248, 113, 113, 0.12);
  color: #f87171;
  font-size: 30px;
  font-weight: 700;
}

.sw-modal-icon span {
  line-height: 1;
}

.sw-modal h2 {
  margin: 0 0 10px;
  color: #f8fafc;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.35;
}

.sw-modal > p {
  margin: 0;
  color: #aab8ca;
  font-size: 14px;
  line-height: 1.7;
}

.sw-modal-transaction {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  margin: 22px 0;
  padding: 16px;
  border: 1px solid #2c3b50;
  border-radius: 12px;
  background: #172437;
  text-align: left;
  overflow-wrap: anywhere;
}

.sw-modal-transaction-label {
  color: #91a1b7;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
}

.sw-modal-transaction strong:first-of-type {
  color: #f1f5f9;
  font-size: 15px;
}

.sw-modal-transaction strong:last-of-type {
  color: #fca5a5;
  font-size: 18px;
}

.sw-modal-actions {
  display: flex;
  gap: 10px;
  width: 100%;
}

.sw-modal-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 45px;
  padding: 11px 14px;
  border-radius: 9px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.sw-cancel-btn {
  border: 1px solid #3a4a60;
  background: #1b2a3e;
  color: #e2e8f0;
}

.sw-cancel-btn:hover {
  border-color: #64748b;
  background: #26374d;
}

.sw-delete-btn {
  border: 1px solid #dc4545;
  background: #dc4545;
  color: #ffffff;
}

.sw-delete-btn:hover {
  border-color: #ef5555;
  background: #c93636;
}

.sw-modal-actions button:focus-visible {
  outline: 2px solid #a5b4fc;
  outline-offset: 3px;
}

.sw-modal-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

body.sw-modal-open {
  overflow: hidden;
}

@keyframes sw-overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sw-modal-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 480px) {
  .sw-modal {
    padding: 23px 18px;
    border-radius: 15px;
  }

  .sw-modal h2 {
    font-size: 20px;
  }

  .sw-modal-actions {
    flex-direction: column-reverse;
  }

  .sw-modal-actions button {
    width: 100%;
    min-height: 46px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sw-modal-overlay,
  .sw-modal {
    animation: none;
  }
}

