﻿* {
  box-sizing: border-box;
}

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-strong: #f8fafc;
  --primary: #4b5cff;
  --primary-dark: #303fce;
  --success: #2ecc71;
  --danger: #eb5757;
  --text: #1f2a4d;
  --muted: #667085;
  --border: rgba(99, 102, 241, 0.15);
}

body {
  margin: 0;
  background: radial-gradient(circle at top, rgba(79, 70, 229, 0.14), transparent 30%),
    linear-gradient(180deg, #eef2ff 0%, #f8fafc 100%);
  color: var(--text);
  font-family: "Roboto", sans-serif;
}

.page-shell {
  min-height: 100vh;
  position: relative;
}

.page-warning {
  position: absolute;
  top: 22px;
  right: 22px;
  z-index: 30;
  width: auto;
  max-width: 360px;
}

.page-warning .warning-card {
  margin: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 18px 32px;
  background-color: #4338CA;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 400;
}



.topbar__account {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}

.topbar__account:hover {
  opacity: 0.92;
}

.topbar__dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 160px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 24px 45px rgba(15, 23, 42, 0.18);
  padding: 12px 0;
  overflow: hidden;
  z-index: 20;
}

.dropdown-item {
  width: 100%;
  padding: 12px 18px;
  text-align: left;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
}

.dropdown-item:hover {
  background: rgba(79, 70, 229, 0.08);
}

.layout {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 0 20px;
  position: relative;
}

.sidebar {
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: fixed;
  left: 16px;
  top: 84px;
  width: 280px;
  height: calc(100vh - 112px);
  overflow-y: auto;
  z-index: 10;
}

.main-content {
  margin: 0 auto;
  width: min(840px, calc(100% - 340px));
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sidebar__brand-icon {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: rgba(79, 70, 229, 0.12);
  font-size: 20px;
}

.sidebar__brand-label {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.sidebar__brand-subtitle {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-btn {
  width: 100%;
  display: inline-flex;
  gap: 12px;
  align-items: center;
  border: none;
  background: white;
  color: #4338CA;
  border-radius: 5px;
  border: solid #4338CA 1px;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.sidebar-btn:hover,
.sidebar-btn.active {
  background: #4338CA;
  color: #ffffff;
}

.sidebar-btn:hover img,
.sidebar-btn.active img {
  filter: brightness(0) invert(1);
}

.sidebar-btn img {
  margin-right: 10px;
  vertical-align: middle;
}

.main-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin: 0 auto;
  width: min(840px, calc(100% - 340px));
}

.hero-card {
  background-color: #4F46E5;
  border-radius: 24px;
  color: white;
  padding: 40px 32px;
  width: 100%;
  max-width: none;
  margin: 0 0 24px;
  text-align: center;
  box-shadow: 0 30px 60px rgba(79, 70, 229, 0.15);
}

.hero-card__icon {
  font-size: 28px;
  margin-bottom: 18px;
}

.hero-card h1 {
  margin: 0;
  font-size: clamp(26px, 3vw, 38px);
  letter-spacing: -0.03em;
}

.hero-card p {
  margin: 16px auto 0;
  max-width: 620px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 16px;
}

.content-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.content-card__header {
  display: flex;
  justify-content: center;
}

.content-card__header h2 {
  margin: 0;
  font-size: 28px;
  color: #4F46E5;
}

.panel {
  background: var(--surface);
  border-radius: 20px;
  padding: 22px 24px;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.06);
}

.panel--compact {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center
}

.field-label {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.input-group input,
.budget-row input,
.box-row input,
.transaction-tools input {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 15px;
  color: var(--text);
  background: #fff;
}

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

.budget-row input {
  flex: 1;
}

.btn {
  border: none;
  border-radius: 8px;
  padding: 14px 22px;
  font-weight: 600;
  cursor: pointer;
}

.btn--save {
  border-radius: 6px;
  width: 75.7px;
  height: 40px;
  background: #3B82F6;
  color: white;
  transition: background 0.2s ease, color 0.2s ease;
}

.box-row .btn--primary {
  background: #4338ca;
  color: #ffffff;
  border: 1px solid #4338ca;
}

.box-row .btn--primary:hover {
  background: #3730a3;
  color: #ffffff;
}

.btn--primary {
  background: white;
  border: 2px solid #4F46E5;
  color: #4F46E5;
  transition: background 0.2s ease, color 0.2s ease;
}

.btn--primary:hover {
  transition: background 0.2s ease, color 0.2s ease;
  background: #4F46E5;
  color: white;
}

.btn--success {
  background: #10b981;
  color: white;
}

.btn--danger {
  transition: background-color 0.2s ease;
  background: #ef4444;
  color: white;
}

.btn--danger:hover {
  transition: background-color 0.2s ease;
  background-color: #4338CA;
  color: white;
}

.btn--outline {
  background: white;
  border: 2px solid #4F46E5;
  color: #4F46E5;
  transition: background 0.2s ease, color 0.2s ease;
}

.btn--outline:hover {
  transition: background 0.2s ease, color 0.2s ease;
  background: #4F46E5;
  color: white;
}

#historyAddBtn,
#historySearchBtn {
  background: #4338ca;
  color: #ffffff;
  border: 1px solid #4338ca;
}

#historyAddBtn:hover,
#historySearchBtn:hover {
  background: #3730a3;
  color: #ffffff;
}

#historySortBtn {
  background: #ffffff;
  color: #111827;
  font-weight: 400;
  border: 1px solid rgba(15, 23, 42, 0.15);
}

#historySortBtn:hover {
  background: #4F46E5;
  color: #ffffff;
}

.panel--status {
  text-align: center;
  padding: 28px 24px;
}

.status-label {
  color: var(--muted);
  font-size: 14px;
}

.status-value {
  margin-top: 10px;
  font-size: 32px;
  font-weight: 400;
  color: #16a34a;
}

.box-section {
  padding: 24px;
}

.section-header h3 {
  color: #4F46E5;
  font-size: 30px;
  line-height: 36px;
  font-weight: 400;
  text-align: center;
  margin: 0 0 18px;
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

.profile-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-field label {
  font-size: 13px;
  color: var(--muted);
}

.profile-field input {
  width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 15px;
  background: #fff;
}

.profile-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.profile-actions .btn {
  flex: 1;
}

.box-row {
  display: grid;
  grid-template-columns: 1.6fr 1fr auto;
  gap: 14px;
  margin-bottom: 18px;
}

.box-row select {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  padding: 14px 16px;
  background: #fff;
  font-size: 15px;
  color: var(--text);
}

.category-item__title {
  font-weight: 700;
  margin-bottom: 4px;
}

.category-item__meta {
  font-size: 13px;
  color: var(--muted);
}

.category-list,
.transaction-list {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.category-item,
.transaction-item {
  width: min(100%, calc(33.333% - 12px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: var(--text);
  min-height: 110px;
}

.category-item::before,
.transaction-item::before {
  content: "$";
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: #000;
  font-size: 22px;
  font-weight: 700;
}

.category-item span:first-child,
.transaction-item span:first-child {
  font-weight: 600;
}

.item-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-left: auto;
}

.edit-btn,
.category-delete,
.text-btn {
  background: transparent;
  border: none;
  color: #000;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
}

.edit-btn:hover,
.category-delete:hover,
.text-btn:hover {
  background: rgba(15, 23, 42, 0.06);
}

.edit-btn {
  font-size: 18px;
  padding: 6px;
}

.edit-btn:hover {
  background: rgba(79, 70, 229, 0.1);
}

.item-actions button,
.text-btn {

  background: transparent;
  border: none;
  color: #f43f5e;
  font-weight: 700;
  cursor: pointer;
}

.transaction-tools {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  align-items: center;
}

.search-box {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  background: #fff;
  flex: 1;
  min-width: 220px;
}

.search-box input {
  border: none;
  outline: none;
  width: 100%;
  font-size: 15px;
}

.pagination {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.pagination button {
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: white;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
}

.pagination .active {
  background: var(--primary);
  color: white;
  border-color: transparent;
}

.alert-row {
  margin-top: 18px;
  padding: 14px 18px;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 14px;
  color: #b91c1c;
}

.summary-table {
  display: grid;
  gap: 10px;
}

.summary-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 0.8fr;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  background: #f8fafc;
  align-items: center;
}

.header-row {
  background: rgba(79, 70, 229, 0.06);
  font-weight: 700;
}

.status {
  display: inline-flex;
  justify-content: center;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 13px;
}

.status--good {
  background: #d1fae5;
  color: #15803d;
}

.status--bad {
  background: #fee2e2;
  color: #b91c1c;
}

.footer-bar {
  margin-top: 22px;
  padding: 18px 32px;
  text-align: center;
  color: #000000;
  font-size: 14px;
}

.history-grid {
  display: grid;
  gap: 18px;
}

.warning-card {
  background: #1e293b;
  color: #f8fafc;
  border-radius: 16px;
  padding: 16px 18px;
  position: relative;
}

.warning-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: transparent;
  border: none;
  color: #f8fafc;
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.warning-close:hover {
  background: rgba(248, 250, 252, 0.1);
}

.warning-title {
  font-weight: 700;
  margin-bottom: 6px;
}

.warning-text {
  font-size: 14px;
  color: #e2e8f0;
}

.history-entry-row,
.history-controls {
  display: flex;
  justify-content: space-around;
  gap: 12px;
  margin-bottom: 12px;
  align-items: center;
}

.history-entry-row {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.05);
}

.history-entry-row .history-input,
.history-search {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  min-width: 160px;
}

.history-entry-row .history-input {
  flex: 1;
}

.history-search {
  flex: 0;
}

.history-table-wrap {
  position: relative;
  background: white;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.history-warning {
  position: absolute;
  right: 16px;
  top: 16px;
  z-index: 5;
  width: auto;
  max-width: 360px;
}

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

.history-table th,
.history-table td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.history-table th {
  background: #f8fafc;
  font-weight: 700;
}

.history-table tbody tr:hover {
  background: rgba(79, 70, 229, 0.06);
}

.history-table .text-btn {
  color: #000000;
  font-size: 20px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-weight: 700;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 50;
}

.hidden {
  display: none !important;
}

.modal {
  width: min(560px, 100%);
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 30px 70px rgba(15, 23, 42, 0.16);
  overflow: hidden;
}

.modal__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: 24px 24px 0;
}

.modal__header h3 {
  margin: 0 0 8px;
  font-size: 22px;
  color: #111827;
}

.modal__header p {
  margin: 0;
  color: #6b7280;
  font-size: 14px;
}

.modal__close {
  border: none;
  background: transparent;
  font-size: 26px;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
  padding: 6px;
}

.modal__content {
  display: grid;
  gap: 16px;
  padding: 24px;
}

.modal__content p {
  margin: 0;
  color: #6b7280;
  font-size: 14px;
}

.modal__content label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  color: #374151;
}

.modal__content input,
.modal__content select {
  width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 15px;
  background: #fff;
  color: var(--text);
}

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 20px;
  margin-top: 8px;
}

.modal__actions .btn {
  min-width: 40px;
}


.modal__actions .btn--primary {
  background-color: #4338CA;
  color: white;
}



/* không có responsive trong figma */