/* ============================================================
   Finance ZionPlan - Apple Design System
   ============================================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --bg: #ffffff;
  --bg2: #f4f7fc;
  --bg3: #e8e8ed;
  --border: #e8e8ed;
  --text: #1d1d1f;
  --text2: #7a7a7a;
  --text3: #b0b0b5;
  --primary: #0066cc;
  --primary-hover: #0071e3;
  --success: #34c759;
  --warning: #ff9f0a;
  --danger: #ff3b30;
  --info: #5ac8fa;
  --purple: #af52de;
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-width: 250px;
  --header-height: 64px;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --bg2: #1e293b;
  --bg3: #2c2c2e;
  --border: #38383a;
  --text: #f5f5f7;
  --text2: #98989d;
  --text3: #636366;
  --primary: #2997ff;
  --primary-hover: #40a9ff;
  --success: #30d158;
  --warning: #ffd60a;
  --danger: #ff453a;
  --info: #64d2ff;
  --purple: #bf5af2;
}

html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow-x: hidden; }
body {
    font-family: var(--font-family);
    background: var(--bg2);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    max-width: 100vw;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
img { max-width: 100%; height: auto; }

/* ---------- Layout ---------- */
#app { display: flex; min-height: 100vh; overflow-x: hidden; }

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg);
  border-right: none;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s ease;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  background: var(--bg2);
  overflow-x: hidden;
}

.container { padding: 20px 24px; max-width: 100%; margin: 0; }

/* ---------- Auth ---------- */
.auth-wrapper {
  min-height: 100vh;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg2);
}
.auth-wrapper > .alert { width: 100%; max-width: 520px; margin-bottom: 16px; }
.auth-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 48px;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}
.auth-header { text-align: center; margin-bottom: 32px; }
.auth-logo { height: 160px; width: auto; display: block; margin: 0 auto 16px; border-radius: 24px; }
.auth-subtitle { color: var(--text2); font-size: 15px; margin-top: 4px; }
.auth-form .form-group { margin-bottom: 24px; }
.auth-form input { padding: 14px 16px; font-size: 15px; }
.auth-links { display: flex; justify-content: space-between; margin-top: 20px; font-size: 13px; }

@media (max-width: 1024px) {
  .auth-card { padding: 40px; max-width: 480px; }
  .auth-logo { height: 130px; }
}
@media (max-width: 768px) {
  .auth-card { padding: 32px; max-width: 440px; }
  .auth-logo { height: 110px; }
  .auth-subtitle { font-size: 14px; }
}
@media (max-width: 480px) {
  .auth-wrapper { padding: 16px; align-items: flex-start; padding-top: 40px; }
  .auth-card { padding: 24px 20px; border-radius: 16px; max-width: 100%; }
  .auth-logo { height: 90px; }
  .auth-subtitle { font-size: 13px; }
  .auth-form .form-group { margin-bottom: 16px; }
  .auth-form input { font-size: 16px; padding: 12px 14px; }
  .auth-links { font-size: 12px; }
}
@media (max-width: 360px) {
  .auth-card { padding: 20px 16px; }
  .auth-logo { height: 72px; }
}

/* ---------- Sidebar (dinzo style) ---------- */
.sidebar-brand { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: center; height: var(--header-height); box-sizing: border-box; }
.brand-link { display: flex; align-items: center; gap: 8px; color: var(--text) !important; }
.brand-logo { height: 52px; width: auto; display: block; border-radius: 14px; }
.sidebar-install-text { transition: opacity 0.2s; }
.sidebar-install-text:hover { opacity: 0.8; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 0; -ms-overflow-style: none; scrollbar-width: none; }
.sidebar-nav::-webkit-scrollbar { display: none; }
.nav-label { padding: 14px 18px 5px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text3); font-weight: 600; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 18px;
  color: var(--text2) !important; font-size: 13px; font-weight: 500;
  transition: all 0.2s; border-radius: 0;
}
.nav-item:hover { background: var(--bg2); color: var(--text) !important; }
.nav-item.active { background: var(--bg2); color: var(--primary) !important; }
.sidebar-footer { padding: 14px 18px; border-top: 1px solid var(--border); font-size: 11px; color: var(--text3); }

/* ---------- Topbar (dinzo style) ---------- */
.topbar {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--bg);
  border-bottom: none;
  position: sticky;
  top: 0;
  z-index: 50;
}
.sidebar-toggle { display: none; background: none; border: none; color: var(--text); cursor: pointer; padding: 6px; }
.topbar-search {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 10px;
  padding: 6px 12px; width: 280px; min-width: 0; flex-shrink: 1;
}
.topbar-search input { background: none; border: none; color: var(--text); outline: none; flex: 1; font-size: 12px; }
.topbar-search input::placeholder { color: var(--text3); }
.topbar-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.topbar-btn { color: var(--text2); padding: 6px; border-radius: 8px; transition: background 0.2s; border: none; outline: none; }
.topbar-btn:hover { background: var(--bg2); color: var(--text); }
.topbar-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.topbar-user { display: flex; align-items: center; gap: 6px; }
.user-name { font-size: 13px; font-weight: 500; }
.btn-logout { padding: 6px; color: var(--text2); border-radius: 8px; transition: all 0.2s; }
.btn-logout:hover { background: rgba(255,59,48,0.1); color: var(--danger); }

/* ---------- Page Header (dinzo style) ---------- */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.page-header h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); margin: 0; }
.page-subtitle { font-size: 13px; color: var(--text2); margin-top: 2px; font-weight: 400; }
.page-actions { display: flex; gap: 8px; }

/* ---------- Stats Grid (dinzo style) ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card {
  background: var(--bg); border-radius: 14px; padding: 16px 18px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 2px 8px rgba(0,0,0,0.02);
  border: 1px solid #f0f0f0;
  transition: box-shadow 0.2s, transform 0.2s;
  position: relative; overflow: hidden;
}
.stat-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); transform: translateY(-1px); }
.stat-card__icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stat-card--income .stat-card__icon { background: rgba(52,199,89,0.12); color: var(--success); }
.stat-card--expense .stat-card__icon { background: rgba(255,59,48,0.12); color: var(--danger); }
.stat-card--pending .stat-card__icon { background: rgba(255,159,10,0.12); color: var(--warning); }
.stat-card--balance .stat-card__icon { background: rgba(0,102,204,0.12); color: var(--primary); }
.stat-card--investment .stat-card__icon { background: rgba(175,82,222,0.12); color: var(--purple); }
.stat-card__icon .material-symbols-outlined { font-size: 20px; }
.stat-card__info { flex: 1; min-width: 0; }
.stat-card__label { display: block; font-size: 11px; color: var(--text2); font-weight: 500; text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 2px; }
.stat-card__value { display: block; font-size: 20px; font-weight: 700; color: var(--text); letter-spacing: -0.02em; font-feature-settings: "tnum"; }
.stat-card__trend { position: absolute; top: 16px; right: 16px; font-size: 10px; color: var(--text3); font-weight: 400; }

/* ---------- Filter Bar ---------- */
.filter-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.filter-bar__group { display: flex; gap: 8px; }
.filter-select {
  padding: 8px 32px 8px 12px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: 13px; font-family: inherit;
  cursor: pointer; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a7a7a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  transition: border-color 0.2s;
}
.filter-select:focus { outline: none; border-color: var(--primary); }
.filter-bar__search {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 4px 4px 4px 12px; flex: 1; max-width: 480px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.filter-bar__search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,102,204,0.1); }
.filter-bar__search .search-icon { font-size: 20px; color: var(--text3); }
.filter-bar__search input {
  flex: 1; border: none; background: none; color: var(--text);
  font-size: 13px; font-family: inherit; outline: none; padding: 6px 0;
}
.filter-bar__search input::placeholder { color: var(--text3); }
.filter-bar__search .btn { flex-shrink: 0; }

/* ---------- Table Card (dinzo style) ---------- */
.table-card {
  background: var(--bg); border-radius: 14px; overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 2px 8px rgba(0,0,0,0.02);
  border: 1px solid #f0f0f0;
}
.table-card__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.table-card__header h3 { font-size: 14px; font-weight: 600; color: var(--text); }
.table-card__count { font-size: 11px; color: var(--text3); font-weight: 500; }
.table-container { overflow-x: auto; }

/* ---------- Transaction Table (dinzo style) ---------- */
.table { width: 100%; border-collapse: collapse; }
.table thead th {
  padding: 10px 14px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text3); font-weight: 600; border-bottom: 1px solid var(--border);
  white-space: nowrap; user-select: none;
}
.table tbody td { padding: 12px 14px; border-bottom: 1px solid #f5f5f5; font-size: 13px; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background 0.15s; }
.table tbody tr:hover { background: #fafafa; }
.col-value { text-align: right; font-feature-settings: "tnum"; font-weight: 600; }
.col-actions { text-align: center; width: 90px; }
.col-account { }
.col-date { width: 60px; }
.col-date .date-day { display: block; font-size: 16px; font-weight: 700; color: var(--text); line-height: 1.2; }
.col-date .date-month { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text3); font-weight: 600; }

.transaction-desc { display: block; font-size: 14px; font-weight: 500; color: var(--text); }
.transaction-notes { display: block; font-size: 12px; color: var(--text3); margin-top: 2px; }

.value-income { color: var(--success); }
.value-expense { color: var(--danger); }

/* ---------- Detail Table (dinzo style) ---------- */
.detail-table { width: 100%; border-collapse: collapse; }
.detail-table td { padding: 8px 0; font-size: 13px; border-bottom: 1px solid #f5f5f5; vertical-align: top; }
.detail-table tr:last-child td { border-bottom: none; }
.detail-label { color: var(--text3); font-weight: 500; width: 45%; padding-right: 10px; }

/* ---------- Card Header ---------- */
.card-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-header h3 { font-size: 15px; font-weight: 600; color: var(--text); margin: 0; }

/* ---------- Trend ---------- */
.trend-up { color: var(--success); }
.trend-down { color: var(--danger); }

/* ---------- Three-Body Loading (uiverse.io) ---------- */
.three-body {
    --uib-size: 28px;
    --uib-speed: 0.8s;
    --uib-color: var(--primary, #5D3FD3);
    position: relative;
    display: inline-block;
    height: var(--uib-size);
    width: var(--uib-size);
    animation: spin78236 calc(var(--uib-speed) * 2.5) infinite linear;
    vertical-align: middle;
    margin-right: 6px;
}
.three-body__dot {
    position: absolute;
    height: 100%;
    width: 30%;
}
.three-body__dot:after {
    content: '';
    position: absolute;
    height: 0%;
    width: 100%;
    padding-bottom: 100%;
    background-color: var(--uib-color);
    border-radius: 50%;
}
.three-body__dot:nth-child(1) { bottom: 5%; left: 0; transform: rotate(60deg); transform-origin: 50% 85%; }
.three-body__dot:nth-child(1)::after { bottom: 0; left: 0; animation: wobble1 var(--uib-speed) infinite ease-in-out; animation-delay: calc(var(--uib-speed) * -0.3); }
.three-body__dot:nth-child(2) { bottom: 5%; right: 0; transform: rotate(-60deg); transform-origin: 50% 85%; }
.three-body__dot:nth-child(2)::after { bottom: 0; left: 0; animation: wobble1 var(--uib-speed) infinite calc(var(--uib-speed) * -0.15) ease-in-out; }
.three-body__dot:nth-child(3) { bottom: -5%; left: 0; transform: translateX(116.666%); }
.three-body__dot:nth-child(3)::after { top: 0; left: 0; animation: wobble2 var(--uib-speed) infinite ease-in-out; }
@keyframes spin78236 {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
@keyframes wobble1 {
    0%, 100% { transform: translateY(0%) scale(1); opacity: 1; }
    50% { transform: translateY(-66%) scale(0.65); opacity: 0.8; }
}
@keyframes wobble2 {
    0%, 100% { transform: translateY(0%) scale(1); opacity: 1; }
    50% { transform: translateY(66%) scale(0.65); opacity: 0.8; }
}

/* ---------- Category Pill ---------- */
.category-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 10px 2px 6px; border-radius: 980px;
  background: var(--bg2); font-size: 12px; color: var(--text2); font-weight: 500;
}
.category-pill .category-dot { width: 8px; height: 8px; }

/* ---------- Status Badge (dinzo style) ---------- */
.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 600;
  background: var(--bg2); color: var(--text2);
}
.status-badge--success { background: rgba(52,199,89,0.12); color: #1a7a3a; }
.status-badge--warning { background: rgba(255,159,10,0.12); color: #b35c00; }
.status-badge--danger { background: rgba(255,59,48,0.12); color: #c92a2a; }
.status-badge--attention { background: rgba(249,115,22,0.12); color: #c2410c; }
.status-badge--excellent { background: rgba(26,138,92,0.12); color: #1a8a5c; }
.status-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* ---------- Color Dot (dinzo style) ---------- */
.color-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ---------- Modal Close (dinzo style) ---------- */
.modal-close { background: none; border: none; color: var(--text2); font-size: 20px; cursor: pointer; padding: 4px; line-height: 1; }
.modal-close:hover { color: var(--text); }

/* ---------- Icon Buttons (dinzo style) ---------- */
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px; color: var(--text2);
  transition: all 0.15s; text-decoration: none; border: none; outline: none;
}
.btn-icon:hover { background: var(--bg2); color: var(--primary); }
.btn-icon:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn-icon .material-symbols-outlined { font-size: 16px; }
.btn-icon form { display: inline; }
.btn-icon button.btn-icon { border: none; background: none; cursor: pointer; font: inherit; color: inherit; padding: 0; }
.btn-icon button.btn-icon:hover { background: var(--bg2); color: var(--danger, #ef4444); }

/* ---------- Empty State (dinzo style) ---------- */
.empty-state { text-align: center; padding: 40px 16px; }
.empty-state__icon {
  display: flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 14px; margin: 0 auto 14px;
  background: var(--bg2); color: var(--text3);
}
.empty-state__icon .material-symbols-outlined { font-size: 28px; }
.empty-state__title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty-state__text { font-size: 13px; color: var(--text2); margin-bottom: 16px; max-width: 320px; margin-left: auto; margin-right: auto; }

/* ---------- Pagination (dinzo style) ---------- */
.pagination { display: flex; align-items: center; justify-content: center; gap: 3px; padding: 12px 16px; border-top: 1px solid var(--border); }
.pagination-pages { display: flex; gap: 2px; }
.pagination-page {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 30px; height: 30px; padding: 0 6px; border-radius: 8px;
  font-size: 12px; font-weight: 500; color: var(--text2);
  transition: all 0.15s; text-decoration: none;
}
.pagination-page:hover { background: var(--bg2); color: var(--text); }
.pagination-page.active { background: var(--primary); color: #fff; font-weight: 600; }
.pagination-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px; color: var(--text2);
  transition: all 0.15s; text-decoration: none;
}
.pagination-btn:hover { background: var(--bg2); color: var(--text); }
.pagination-btn .material-symbols-outlined { font-size: 16px; }

/* ---------- Forms (dinzo style) ---------- */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; font-weight: 500; color: var(--text2); margin-bottom: 5px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 9px 12px;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); font-size: 13px; font-family: inherit;
  transition: border-color 0.2s;
}
.form-group input:-webkit-autofill,
.form-group input:-webkit-autofill:hover,
.form-group input:-webkit-autofill:focus,
.form-group select:-webkit-autofill,
.form-group select:-webkit-autofill:hover,
.form-group select:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--bg2) inset !important;
  -webkit-text-fill-color: var(--text) !important;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,102,204,0.08); }
.form-group textarea { min-height: 80px; resize: vertical; }
.form-group select { cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ---------- Buttons (dinzo style) ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: 10px; font-size: 13px;
  font-weight: 600; font-family: inherit; cursor: pointer; transition: all 0.2s;
  border: none; text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { opacity: 0.9; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: 0.9; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--text2); background: var(--bg2); }
.btn-sm { padding: 5px 12px; font-size: 11px; border-radius: 8px; }
.btn-full { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- Cards (dinzo style) ---------- */
.card {
  background: var(--bg);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #f0f0f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 2px 8px rgba(0,0,0,0.02);
}
.card-shadows {
  overflow: visible;
}
.card-hover { transition: background 0.2s; cursor: pointer; }
.card-hover:hover { background: var(--bg2); }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.card-header h3 { font-size: 14px; font-weight: 600; }
.card-body { padding: 18px; }
.card-body.p-0 { padding: 0; }
.card-stat { display: flex; align-items: center; gap: 14px; padding: 18px; }
.card-stat-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.card-stat-label { display: block; font-size: 12px; color: var(--text2); }
.card-stat-value { display: block; font-size: 22px; font-weight: 700; margin-top: 4px; letter-spacing: -0.01em; }
.card-stat-value.income { color: var(--success); }
.card-stat-value.expense { color: var(--danger); }
.card-alert { }

/* ---------- Grid ---------- */
.row { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; }
.row.mt-4 { margin-top: 20px; }
.col-2 { grid-column: span 2; }
.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-6 { grid-column: span 6; }
.col-8 { grid-column: span 8; }
.col-12 { grid-column: span 12; }

/* ---------- Charts ---------- */
.chart-bars { display: flex; align-items: flex-end; gap: 12px; height: 200px; padding: 20px 0; }
.chart-bar-group { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.chart-bar-label { font-size: 11px; color: var(--text3); }
.chart-bars-inner { display: flex; align-items: flex-end; gap: 4px; width: 100%; height: 100%; justify-content: center; }
.chart-bar { width: 20px; border-radius: 4px 4px 0 0; transition: height 0.5s ease; min-height: 4px; }
.chart-bar.income { background: var(--success); }
.chart-bar.expense { background: var(--danger); }
.chart-legend { display: flex; justify-content: center; gap: 20px; margin-top: 12px; font-size: 13px; color: var(--text2); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot-income { background: var(--success); }
.dot-expense { background: var(--danger); }

/* ---------- Score ---------- */
.score-ring { display: flex; justify-content: center; margin: 10px 0; }

/* ---------- Category Items (dinzo style) ---------- */
.category-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #f5f5f5; }
.category-item:last-child { border-bottom: none; }
.category-info { display: flex; align-items: center; gap: 10px; }
.category-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.category-name { font-size: 13px; }
.category-value { display: flex; align-items: center; gap: 10px; }
.category-amount { font-weight: 600; font-size: 13px; }
.category-pct { font-size: 11px; color: var(--text3); }

/* ---------- Bills (dinzo style) ---------- */
.bill-list { display: flex; flex-direction: column; gap: 6px; }
.bill-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; background: var(--bg); border-radius: 10px; border: 1px solid #f0f0f0; }
.bill-info { display: flex; flex-direction: column; }
.bill-name { font-size: 13px; font-weight: 500; }
.bill-date { font-size: 11px; color: var(--text3); }
.bill-actions { display: flex; align-items: center; gap: 6px; }
.bill-amount { font-weight: 600; font-size: 13px; }

/* ---------- Goals (dinzo style) ---------- */
.goals-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.goal-card { background: var(--bg); border-radius: 12px; padding: 14px; border: 1px solid #f0f0f0; }
.goal-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.goal-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.goal-name { font-weight: 600; font-size: 13px; }
.progress-bar { height: 5px; background: #f0f0f0; border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.progress-info { display: flex; justify-content: space-between; font-size: 11px; color: var(--text2); margin-top: 5px; }

/* ---------- Badges (dinzo style) ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; }
.badge-success { background: rgba(52,199,89,0.12); color: #1a7a3a; }
.badge-warning { background: rgba(255,159,10,0.12); color: #b35c00; }
.badge-danger { background: rgba(255,59,48,0.12); color: #c92a2a; }
.badge-info { background: rgba(90,200,250,0.12); color: #0a7ab5; }
.badge-excellent { background: rgba(52,199,89,0.12); color: #1a7a3a; }
.badge-good { background: rgba(0,102,204,0.12); color: #0a5cb5; }
.badge-regular { background: rgba(255,159,10,0.12); color: #b35c00; }
.badge-critical { background: rgba(255,59,48,0.12); color: #c92a2a; }

/* ---------- Alerts (dinzo style) ---------- */
.alert {
  position: relative; padding: 10px 16px; border-radius: 10px;
  margin-bottom: 14px; font-size: 13px; display: flex; align-items: center; justify-content: space-between;
}
.alert-success { background: rgba(52,199,89,0.1); border: 1px solid rgba(52,199,89,0.2); color: #1a7a3a; }
.alert-error { background: rgba(255,59,48,0.1); border: 1px solid rgba(255,59,48,0.2); color: #c92a2a; }
.alert-warning { background: rgba(255,159,10,0.1); border: 1px solid rgba(255,159,10,0.2); color: #b35c00; }
.alert-info { background: rgba(90,200,250,0.1); border: 1px solid rgba(90,200,250,0.2); color: #0a7ab5; }
.alert-close { background: none; border: none; color: inherit; cursor: pointer; font-size: 18px; opacity: 0.6; padding: 0 4px; }

/* ---------- Tables ---------- */
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th { text-align: left; padding: 12px 16px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text3); font-weight: 600; border-bottom: 1px solid var(--border); }
tbody td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:hover { background: var(--bg2); }

/* ---------- Table Actions ---------- */
.table-actions { display: flex; gap: 4px; }

/* ---------- Status ---------- */
.status-pending { color: var(--warning); }
.status-paid, .status-received { color: var(--success); }
.status-overdue { color: var(--danger); }
.status-cancelled { color: var(--text3); }

/* ---------- Filters ---------- */
.filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-group label { font-size: 12px; color: var(--text3); }
.filter-group input, .filter-group select {
  padding: 8px 12px; background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: 13px;
}
.filter-group input:-webkit-autofill,
.filter-group input:-webkit-autofill:hover,
.filter-group input:-webkit-autofill:focus,
.filter-group select:-webkit-autofill,
.filter-group select:-webkit-autofill:hover,
.filter-group select:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--bg2) inset !important;
  -webkit-text-fill-color: var(--text) !important;
}
.filter-group select { cursor: pointer; }

/* ---------- Pagination ---------- */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 24px; }
.pagination a, .pagination span {
  padding: 8px 14px; border-radius: 980px; font-size: 14px;
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  transition: all 0.2s;
}
.pagination a:hover { border-color: var(--text2); }
.pagination .active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- Error Page ---------- */
.error-page { text-align: center; padding: 80px 20px; }
.error-code { font-size: 120px; font-weight: 800; color: var(--text); line-height: 1; letter-spacing: -0.03em; }
.error-page h1 { font-size: 28px; margin: 16px 0 8px; }
.error-page p { color: var(--text2); margin-bottom: 24px; }

/* ---------- Modal ---------- */
.modal { display: none; }
.modal.active {
  display: flex;
  position: fixed; inset: 0;
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.5);
}
.modal-content {
  position: relative;
  z-index: 1;
  background: var(--bg);
  border-radius: var(--radius);
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px; border-bottom: 1px solid var(--border); }
.modal-header h2 { font-size: 18px; }
.modal-body { padding: 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 20px; border-top: 1px solid var(--border); }

/* ---------- Empty State ---------- */
.empty-state { text-align: center; padding: 40px 20px; }
.empty-icon { display: flex; align-items: center; justify-content: center; margin-bottom: 16px; color: var(--text3); }
.empty-state p { color: var(--text2); font-size: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
  .col-3 { grid-column: span 6; }
  .col-4 { grid-column: span 6; }
  .col-8 { grid-column: span 12; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar-open .sidebar { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .sidebar-toggle { display: block; flex-shrink: 0; }
    .topbar { padding: 0 10px; gap: 6px; }
  .topbar-search { flex: 1; min-width: 0; padding: 6px 8px; width: 0; }
  .topbar-search input { font-size: 13px; width: 100%; }
  .topbar-right { gap: 4px; flex-shrink: 0; }
  .col-3, .col-4, .col-6, .col-8, .col-12 { grid-column: span 12; }
  .container { padding: 16px; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .filters { flex-direction: column; }
  .goals-grid { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar__search { max-width: none; }
  .col-date { width: auto; }
  .col-account { display: none; }
  .isf-top-card { grid-template-columns: 1fr; }
  .isf-section-diag { grid-column: span 1; }
  .isf-top-card { overflow-x: hidden; }
  .isf-metric-row { grid-template-columns: 1fr !important; gap: 8px; }
  .isf-metric-pts { text-align: left; }
  .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .stats-grid { grid-template-columns: 1fr; }
  .goals-grid { grid-template-columns: 1fr; }
  .page-actions { width: 100%; justify-content: flex-end; }
  .row { gap: 12px; }
  .credit-card-wrapper { width: 100%; }
  .credit-card { width: 100%; max-width: 100%; }
}

@media (max-width: 480px) {
  .topbar { padding: 0 8px; gap: 4px; }
  .sidebar-toggle { padding: 4px; }
  .topbar-search { padding: 4px 6px; }
  .topbar-search input { font-size: 12px; }
  .user-name { display: none; }
  .topbar-right { gap: 2px; }
  .topbar-btn { padding: 4px; }
  table { font-size: 12px; }
  thead th, tbody td { padding: 6px 8px; }
  .filter-bar__group { width: 100%; }
  .filter-bar__group select { flex: 1; }
  .col-date { display: none; }
  .table thead th:nth-child(4), .table tbody td:nth-child(4) { display: none; }
  .container { padding: 12px; }
  .page-header h1 { font-size: 20px; }
  .stats-grid { gap: 10px; }
  .stat-card { padding: 12px; gap: 10px; }
  .stat-card__icon { width: 32px; height: 32px; }
  .stat-card__value { font-size: 18px; }
  .goals-grid { gap: 10px; }
  .goal-card { padding: 12px; }
  .card { padding: 12px; }
  .card-header { padding: 10px 12px; }
  .card-body { padding: 10px 12px; }
  .detail-row { flex-direction: column; gap: 4px; }
  .detail-label { min-width: 0; }
  .detail-value { text-align: left; }
  .form-row { grid-template-columns: 1fr !important; }
  .btn { padding: 8px 14px; font-size: 13px; }
  .row { gap: 10px; }
  .credit-card { height: auto; min-height: 180px; }
  .isf-metric-row { padding: 6px 8px; }
  .isf-metric-icon { width: 28px; height: 28px; }
  .isf-pts-value { font-size: 13px; }
}

@media (max-width: 360px) {
  .topbar { padding: 0 6px; gap: 2px; }
  .sidebar-toggle { padding: 2px; }
  .topbar-search { padding: 3px 4px; }
  .topbar-search input { font-size: 11px; }
  .topbar-btn { padding: 2px; }
  .container { padding: 8px; }
  .page-header h1 { font-size: 18px; }
  .stat-card { padding: 10px; gap: 8px; }
  .stat-card__icon { width: 28px; height: 28px; }
  .stat-card__value { font-size: 16px; }
  .card { padding: 10px; }
  .card-header { padding: 8px 10px; }
  .card-body { padding: 8px 10px; }
  .btn { padding: 6px 12px; font-size: 12px; }
}

/* ---------- Utilities ---------- */
.text-center { text-align: center; }
.text-muted { color: var(--text2); }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 16px; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }

/* ---------- ISF Cards (dinzo style) ---------- */
.isf-top-card {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1.3fr;
  gap: 14px;
  background: var(--bg);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 2px 8px rgba(0,0,0,0.02);
  border: 1px solid #f0f0f0;
}
.isf-section-diag { display: flex; gap: 10px; align-items: flex-start; }
.isf-target-icon { flex-shrink: 0; width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; background: rgba(217,119,6,0.1); border-radius: 10px; }
.isf-diag-content { flex: 1; }
.isf-diag-content h3 { font-size: 12px; font-weight: 700; color: #d97706; display: flex; align-items: center; gap: 4px; margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.3px; }
.isf-diag-content p { font-size: 12px; color: var(--text); line-height: 1.5; }
.isf-section-fortes,
.isf-section-melhoria,
.isf-section-sugestoes { }
.isf-column-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; display: flex; align-items: center; gap: 5px; margin-bottom: 6px; }
.isf-title-fortes { color: #065f46; }
.isf-title-melhoria { color: #b45309; }
.isf-title-sugestoes { color: #1e40af; }
.isf-badge { width: 18px; height: 18px; border-radius: 5px; display: flex; align-items: center; justify-content: center; }
.isf-badge-fortes { background: rgba(52,199,89,0.15); color: #065f46; }
.isf-badge-melhoria { background: rgba(255,159,10,0.15); color: #b45309; }
.isf-badge-sugestoes { background: rgba(37,99,235,0.15); color: #1e40af; }
.isf-list { list-style: none; padding: 0; margin: 0; }
.isf-list li { font-size: 11px; color: var(--text2); padding: 2px 0; padding-left: 10px; position: relative; line-height: 1.4; }
.isf-list li::before { content: ''; position: absolute; left: 0; top: 8px; width: 4px; height: 4px; border-radius: 50%; background: var(--text3); }
.isf-sugestoes-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 3px; }
.isf-sugestoes-list li { font-size: 11px; color: var(--text2); display: flex; align-items: flex-start; gap: 5px; line-height: 1.4; }

.isf-bottom-card {
  background: var(--bg);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 2px 8px rgba(0,0,0,0.02);
  border: 1px solid #f0f0f0;
}
.isf-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}
.isf-title-wrapper { display: flex; align-items: center; gap: 8px; }
.isf-icon-box { width: 32px; height: 32px; background: rgba(37,99,235,0.1); border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.isf-score-wrapper { display: flex; align-items: center; gap: 10px; }
.isf-score-box { text-align: right; }
.isf-score-value { font-size: 24px; font-weight: 800; color: var(--text); letter-spacing: -0.02em; }
.isf-score-max { font-size: 12px; color: var(--text3); font-weight: 500; }
.isf-badge-level {
  display: inline-flex; align-items: center; padding: 3px 10px;
  border-radius: 6px; font-size: 11px; font-weight: 700;
  background: color-mix(in srgb, var(--isf-level-color) 15%, transparent);
  color: var(--isf-level-color);
}

.isf-metrics { display: flex; flex-direction: column; gap: 10px; }
.isf-metric-row {
  display: grid;
  grid-template-columns: 200px 1fr 100px;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--bg2);
}
.isf-metric-info { display: flex; align-items: center; gap: 8px; }
.isf-metric-icon {
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  color: #fff;
}
.isf-metric-icon .material-symbols-outlined { font-size: 15px; }
.isf-metric-text { }
.isf-metric-text h4 { font-size: 12px; font-weight: 600; color: var(--text); margin: 0; }
.isf-metric-text h4 span { color: var(--text3); font-weight: 500; }
.isf-metric-text p { font-size: 10px; color: var(--text3); margin: 1px 0 0; }
.isf-progress-track { height: 5px; background: #f0f0f0; border-radius: 3px; overflow: hidden; }
.isf-progress-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.isf-metric-pts { text-align: right; }
.isf-pts-value { font-size: 14px; font-weight: 700; color: var(--text); }
.isf-pts-value span { font-size: 10px; color: var(--text3); font-weight: 500; }
.isf-pts-pct { font-size: 10px; color: var(--text3); margin-top: 1px; }

/* ISF bar colors */
.bg-blue { background: #3b82f6; }
.bg-green { background: #22c55e; }
.bg-red { background: #ef4444; }
.bg-yellow { background: #eab308; }
.bg-purple { background: #a855f7; }
.bg-cyan { background: #06b6d4; }
.bar-blue { background: #3b82f6; }
.bar-green { background: #22c55e; }
.bar-red { background: #ef4444; }
.bar-yellow { background: #eab308; }
.bar-purple { background: #a855f7; }
.bar-cyan { background: #06b6d4; }
.score-blue { color: #2563eb; }
.score-green { color: #16a34a; }
.score-red { color: #dc2626; }
.score-yellow { color: #ca8a04; }
.score-purple { color: #9333ea; }
.score-cyan { color: #0891b2; }

@media (max-width: 992px) {
  .isf-top-card { grid-template-columns: 1fr 1fr; }
  .isf-section-diag { grid-column: span 2; }
  .isf-metric-row { grid-template-columns: 1fr; gap: 6px; }
}
@media (max-width: 768px) {
  .isf-top-card { grid-template-columns: 1fr; }
  .isf-section-diag { grid-column: span 1; }
  .isf-header { flex-direction: column; align-items: flex-start; }
}

/* ============================================
   Score Financeiro — ref: dinzo style
   ============================================ */

.isf-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
    border: 1px solid #f0f0f0;
}

.isf-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 8px;
}

.isf-card__eyebrow {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #94a3b8;
    margin: 0 0 2px;
}

.isf-card__title {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.isf-score-badge {
    text-align: right;
    flex-shrink: 0;
}

.isf-score-badge__value {
    display: block;
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
    color: var(--isf-color, #1e293b);
}

.isf-score-badge__label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    margin-top: 2px;
}

/* Gauge */
.isf-gauge-wrap {
    margin: 0 auto;
    max-width: 530px;
}

.isf-gauge-wrap svg {
    width: 100%;
    height: auto;
    display: block;
}

.isf-tick-label {
    font-size: 11px;
    font-weight: 600;
    fill: #b3bac6;
    font-family: -apple-system, "Segoe UI", Arial, sans-serif;
}

.gauge-needle { transform-origin: 0px 0px; transition: none; }
.gauge-needle__shaft { fill: #1e293b; }
.gauge-needle__tip { fill: #ffffff; opacity: 0.9; }
.gauge-pivot-ring { fill: #ffffff; stroke: #e2e8f0; stroke-width: 1.5; }
.gauge-pivot-dot { fill: #1e293b; }

.gauge-tip-halo { fill: var(--isf-color, #34d399); opacity: 0; }
.gauge-tip-halo.is-settled { animation: isfHaloPulse 1.8s ease-out 1; }

@keyframes isfHaloPulse {
    0%   { opacity: 0.35; r: 6; }
    100% { opacity: 0;    r: 22; }
}

/* Bottom row — score + stats lado a lado */
.isf-bottom-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

.isf-bottom-item {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: center;
}

.isf-bottom-divider {
    width: 1px;
    height: 28px;
    background: #e5e7eb;
    flex-shrink: 0;
}

.isf-bottom-item__icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.isf-bottom-item__icon svg {
    width: 16px !important;
    height: 16px !important;
    display: block !important;
}

.isf-bottom-item__icon--savings {
    background: #ecfdf5;
    color: #059669;
}

.isf-bottom-item__icon--overdue {
    background: #fef2f2;
    color: #ef4444;
}

.isf-bottom-item__text {
    display: flex;
    flex-direction: column;
}

.isf-bottom-item__value {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
}

.isf-bottom-item__label {
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.2;
}

/* Mobile */
@media (max-width: 480px) {
    .isf-card { padding: 16px; }
    .isf-card__header { flex-direction: column; gap: 4px; }
    .isf-score-badge { text-align: left; }
    .isf-gauge-wrap { max-width: 190px; }
    .isf-bottom-item__value { font-size: 13px; }
}

/* ---------- Print ---------- */
@media print {
  .sidebar, .topbar, .sidebar-toggle, .topbar-search, .page-actions, .filters, .btn, .table-actions { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .container { padding: 0 !important; }
  .card { break-inside: avoid; }
  body { background: #fff; color: #000; }
}

/* ---------- Banco Ícone (dinzo style) ---------- */
.banco-icone-fallback {
  flex-shrink: 0;
  border: 1px solid #f0f0f0;
}

/* ---------- Bulk Actions Bar ---------- */
.bulk-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1A73E8;
  color: white;
  padding: 12px 20px;
  border-radius: 12px;
  margin-bottom: 16px;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.bulk-left {
  font-size: 13px;
  font-weight: 600;
}

.bulk-right {
  display: flex;
  gap: 8px;
}

.bulk-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.bulk-btn .material-symbols-outlined {
  font-size: 16px;
}

.bulk-btn-edit {
  background: white;
  color: #1A73E8;
}

.bulk-btn-edit:hover {
  background: #E8F0FE;
}

.bulk-btn-delete {
  background: #FEE2E2;
  color: #DC2626;
}

.bulk-btn-delete:hover {
  background: #FECACA;
}

.bulk-btn-cancel {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  padding: 8px;
}

.bulk-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Row Selected State */
.row-selected {
  background-color: #F0F7FF !important;
}

.row-selected:hover {
  background-color: #E0EFFF !important;
}

/* Mobile Card Check */
.mobile-card-check {
  display: flex;
  align-items: center;
  padding-right: 12px;
}

/* ---------- Extrato Table (HTML exact design) ---------- */
.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}
.filter-bar__group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
}
.filter-search-inline {
  position: relative;
  flex: 1;
  min-width: 220px;
}
.filter-search-inline .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: #8e8e93;
}
.filter-search-inline input {
  width: 100%;
  padding: 8px 12px 8px 32px;
  border: 1px solid #eaeaea;
  border-radius: 10px;
  font-size: 13px;
  background: #fff;
  color: #1c1c1e;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.filter-search-inline input:-webkit-autofill,
.filter-search-inline input:-webkit-autofill:hover,
.filter-search-inline input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #fff inset !important;
  -webkit-text-fill-color: #1c1c1e !important;
}
.filter-select {
  padding: 8px 12px;
  border: 1px solid #eaeaea;
  border-radius: 10px;
  font-size: 13px;
  background: #fff;
  color: #1c1c1e;
  cursor: pointer;
  min-width: 140px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.filter-select:-webkit-autofill,
.filter-select:-webkit-autofill:hover,
.filter-select:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #fff inset !important;
  -webkit-text-fill-color: #1c1c1e !important;
}
.filter-select:focus, .filter-search-inline input:focus {
  outline: none;
  border-color: #0066cc;
}

.extrato-table-wrap {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  border: 1px solid #eaeaea;
  overflow: hidden;
}
.extrato-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  min-width: 900px;
}
.extrato-table thead {
  background-color: #fafafa;
  border-bottom: 1px solid #eaeaea;
}
.extrato-table thead th {
  padding: 16px 20px;
  font-size: 11px;
  font-weight: 700;
  color: #8e8e93;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: left;
  white-space: nowrap;
}
.extrato-th-check { width: 40px; padding-right: 0 !important; }
.extrato-th-date { width: 90px; }
.extrato-th-value { text-align: right !important; }
.sortable {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  color: #1c1c1e;
}

.extrato-table tbody tr {
  border-bottom: 1px solid #f0f0f2;
  transition: background-color 0.15s ease;
}
.extrato-table tbody tr:last-child td { border-bottom: none; }
.extrato-table tbody tr:hover { background-color: #fdfdfd; }

.extrato-table tbody td {
  padding: 14px 20px;
  font-size: 14px;
  color: #1c1c1e;
  vertical-align: middle;
}

/* Checkbox */
.extrato-td-check {
  width: 40px;
  padding-right: 0 !important;
}
.extrato-checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid #d1d1d6;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  background: white;
}
.extrato-checkbox:hover { border-color: #1A73E8; }
.extrato-checkbox.checked {
  background: #1A73E8;
  border-color: #1A73E8;
}
.extrato-checkbox.checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 6px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Date */
.extrato-td-date {
  width: 90px;
  color: #636366;
  font-size: 13.5px;
  white-space: nowrap;
}

/* Description */
.extrato-desc-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}
.bank-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
  flex-shrink: 0;
}
.extrato-desc-text {
  display: flex;
  flex-direction: column;
}
.extrato-desc-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.extrato-desc-title {
  font-weight: 600;
  color: #1c1c1e;
  font-size: 14px;
}
.extrato-status {
  font-size: 11px;
  color: #a0a0a5;
  margin-top: 2px;
}
.tag-whatsapp {
  background-color: #dcf8c6;
  color: #128c7e;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Category Badge */
.extrato-cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.extrato-cat-badge i,
.extrato-cat-badge svg {
  width: 12px !important;
  height: 12px !important;
  stroke-width: 2.5;
  flex-shrink: 0;
}

/* Category Colors */
.cat-assinaturas { background-color: #e0f2fe; color: #0284c7; }
.cat-saude { background-color: #d1fae5; color: #059669; }
.cat-casa { background-color: #f3e8ff; color: #9333ea; }
.cat-transporte { background-color: #e0f2fe; color: #0284c7; }
.cat-restaurantes { background-color: #ffedd5; color: #ea580c; }
.cat-salario { background-color: #dcfce7; color: #16a34a; }
.cat-mercado { background-color: #d1fae5; color: #059669; }
.cat-outros { background-color: #f3f4f6; color: #6b7280; }

/* Account */
.extrato-td-account {
  color: #636366;
  font-size: 13.5px;
}

/* Amount */
.extrato-td-value {
  text-align: right;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}
.extrato-td-value.extrato-value-in {
  color: #2e7d32 !important;
}
.extrato-td-value.extrato-value-in .extrato-cents {
  opacity: 0.8;
}
.extrato-td-value.extrato-value-out {
  color: #e53e3e !important;
}
.extrato-td-value.extrato-value-out .extrato-cents {
  opacity: 0.6;
  font-weight: 400;
}
.extrato-cents {
  font-weight: 400;
}

/* ---------- Extrato Responsiveness ---------- */
@media (max-width: 992px) {
  .extrato-table thead th,
  .extrato-table tbody td {
    padding: 12px;
    font-size: 13px;
  }
  .extrato-desc-cell { gap: 10px; }
  .bank-icon { width: 20px; height: 20px; font-size: 9px; }
  .extrato-cat-badge { font-size: 11px; padding: 3px 6px; gap: 4px; }
  .extrato-cat-badge i,
  .extrato-cat-badge svg { width: 10px !important; height: 10px !important; }
  .extrato-td-value { font-size: 13px; }
}

@media (max-width: 768px) {
  .extrato-table { min-width: 760px; }
  .extrato-table thead th { font-size: 10px; }
  .extrato-table tbody td { font-size: 12px; padding: 10px; }
  .extrato-desc-title { font-size: 12px; }
  .extrato-status { font-size: 10px; }
  .extrato-td-account { font-size: 12px; }
  .extrato-td-value { font-size: 12px; }
  .extrato-cat-badge { font-size: 10px; padding: 3px 5px; gap: 3px; }
  .extrato-cat-badge i,
  .extrato-cat-badge svg { width: 10px !important; height: 10px !important; }
}

@media (max-width: 640px) {
  .filter-bar__group { flex-direction: column; }
  .filter-search-inline { min-width: 0; }
  .filter-select { min-width: 0; width: 100%; }
  .extrato-table { min-width: 700px; }
  .bank-icon { width: 18px; height: 18px; border-radius: 5px; }
  .extrato-cat-badge { padding: 2px 4px; font-size: 9px; }
  .extrato-cat-badge i,
  .extrato-cat-badge svg { width: 10px !important; height: 10px !important; }
  .extrato-th-check, .extrato-td-check { display: none; }
}

/* MOBILE: Cards extrato */
.mobile-cards {
  display: none;
  flex-direction: column;
  gap: 12px;
  padding: 16px 0;
}

.mobile-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  border: 1px solid #eaeaea;
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-card-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.mobile-card-bank {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
}

.mobile-card-bank-nubank { background: #820AD1; color: #fff; }
.mobile-card-bank-itau { background: #EC7000; color: #fff; }
.mobile-card-bank-generic { background: #f1f5f9; color: #64748b; }

.mobile-card-body {
  flex: 1;
  min-width: 0;
}

.mobile-card-title {
  font-weight: 600;
  color: #1c1c1e;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.mobile-card-meta {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

.mobile-card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.mobile-card-date {
  font-size: 11px;
  color: #64748b;
  white-space: nowrap;
}

.mobile-card-category {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.mobile-card-category i,
.mobile-card-category svg {
  width: 12px !important;
  height: 12px !important;
  stroke-width: 2.5;
}

.mobile-card-amount {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}

.mobile-card-amount-negative { color: #e53e3e; }
.mobile-card-amount-positive { color: #2e7d32; }

.mobile-card-status {
  font-size: 10px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@media (max-width: 768px) {
  .extrato-table-wrap { display: none; }
  .mobile-cards { display: flex; }
}

/* ---------- Categories Page ---------- */
.cat-page {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.cat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cat-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cat-header h1 {
  font-size: 20px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.2;
  margin: 0;
}

.cat-header p {
  font-size: 13px;
  color: #64748b;
  margin: 0;
}

.icon-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}

.icon-badge.primary {
  width: 40px;
  height: 40px;
  background-color: #eff6ff;
  color: #2563eb;
}

.icon-badge.small {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.icon-badge.primary-light { background-color: #eff6ff; color: #2563eb; width: 36px; height: 36px; }
.icon-badge.green-light { background-color: #f0fdf4; color: #16a34a; width: 36px; height: 36px; }
.icon-badge.orange-light { background-color: #fff7ed; color: #ea580c; width: 36px; height: 36px; }
.icon-badge.purple-light { background-color: #faf5ff; color: #9333ea; width: 36px; height: 36px; }

.icon-badge i,
.icon-badge svg {
  width: 18px;
  height: 18px;
}

.icon-badge.small i,
.icon-badge.small svg {
  width: 14px;
  height: 14px;
}

.btn-primary {
  background-color: #2563eb;
  color: #ffffff;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover {
  background-color: #1d4ed8;
}

.btn-primary i,
.btn-primary svg {
  width: 16px;
  height: 16px;
}

.summary-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.summary-card {
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.2s ease;
}

.summary-card.active {
  background-color: #f8fafc;
  border-color: #e2e8f0;
}

.card-info {
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
}

.summary-card.active .card-title {
  color: #2563eb;
}

.card-count {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

.category-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-header.space-between {
  justify-content: space-between;
}

.header-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-header h2 {
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.2;
  margin: 0;
}

.section-header p {
  font-size: 12px;
  color: #64748b;
  margin: 0;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.category-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.item-left {
  display: flex;
  align-items: center;
}

.category-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

.item-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.item-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.item-actions {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.2s;
}

.category-item:hover .item-actions {
  opacity: 1;
}

.btn-edit {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.btn-edit:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: #1e293b;
}

.btn-edit i,
.btn-edit svg {
  width: 14px;
  height: 14px;
}

.btn-delete:hover {
  background-color: #fef2f2;
  color: #dc2626;
}

.category-tag.color-green { background-color: #f0fdf4; color: #16a34a; }
.category-tag.color-purple { background-color: #faf5ff; color: #9333ea; }
.category-tag.color-blue { background-color: #eff6ff; color: #2563eb; }
.category-tag.color-orange { background-color: #fff7ed; color: #ea580c; }
.category-tag.color-teal { background-color: #f0fdfa; color: #0d9488; }
.category-tag.color-slate { background-color: #f8fafc; color: #475569; }

@media (max-width: 1024px) {
  .grid-4, .summary-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .cat-header { flex-direction: column; align-items: flex-start; gap: 16px; }
  .item-actions { opacity: 1; }
}

@media (max-width: 600px) {
  .grid-4, .summary-cards { grid-template-columns: 1fr; }
}

/* ============================================================
   MESH GRADIENT BACKGROUND
   ============================================================ */

.bg-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.mesh-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.25;
    animation: floatBlob 20s infinite alternate ease-in-out;
}

.mesh-blob-1 {
    width: 500px;
    height: 500px;
    background: #3B82F6;
    top: -100px;
    left: -100px;
}

.mesh-blob-2 {
    width: 600px;
    height: 600px;
    background: #60A5FA;
    bottom: -150px;
    right: -100px;
}

.mesh-blob-3 {
    width: 350px;
    height: 350px;
    background: #818CF8;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes floatBlob {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, 40px) scale(1.08); }
}

[data-theme="dark"] .mesh-blob {
    opacity: 0.12;
}

[data-theme="dark"] .mesh-blob-1 {
    background: #1E3A8A;
}

[data-theme="dark"] .mesh-blob-2 {
    background: #1D4ED8;
}

[data-theme="dark"] .mesh-blob-3 {
    background: #4F46E5;
}

/* COLOR PICKER */
.color-picker { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.color-option { position: relative; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.color-option input { position: absolute; opacity: 0; width: 0; height: 0; }
.color-swatch {
    width: 30px; height: 30px; border-radius: 50%;
    border: 3px solid transparent;
    display: block;
    transition: transform 0.15s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}
.color-option:hover .color-swatch { transform: scale(1.12); }
.color-option input:checked + .color-swatch {
    border-color: #1A73E8;
    box-shadow: 0 0 0 3px rgba(26,115,232,0.25);
    transform: scale(1.08);
}
.color-check {
    position: absolute; width: 14px; height: 14px;
    fill: none; stroke: #fff; stroke-width: 3.5;
    opacity: 0; pointer-events: none;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.4));
    transition: opacity 0.15s;
}
.color-option input:checked ~ .color-check { opacity: 1; }
