/* ============================================================
   BANK — Sistema de Controle Financeiro
   Design System: Modern, Clean, Inspirational
   ============================================================ */

/* --- Variables --- */
:root {
  --primary:        #6366f1;
  --primary-dark:   #4f46e5;
  --primary-light:  #e0e7ff;
  --success:        #10b981;
  --success-light:  #d1fae5;
  --danger:         #ef4444;
  --danger-light:   #fee2e2;
  --warning:        #f59e0b;
  --warning-light:  #fef3c7;
  --info:           #3b82f6;
  --info-light:     #dbeafe;
  --purple:         #8b5cf6;
  --pink:           #ec4899;

  --bg:             #f1f5f9;
  --surface:        #ffffff;
  --surface-2:      #f8fafc;
  --border:         #e2e8f0;
  --border-light:   #f1f5f9;

  --text:           #1e293b;
  --text-muted:     #64748b;
  --text-light:     #94a3b8;
  --text-white:     #ffffff;

  --sidebar-bg:     #0f172a;
  --sidebar-text:   #94a3b8;
  --sidebar-active: #6366f1;
  --sidebar-width:  260px;
  --header-h:       64px;

  --radius-sm:      8px;
  --radius:         12px;
  --radius-lg:      16px;
  --radius-xl:      24px;

  --shadow-sm:      0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:         0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -1px rgba(0,0,0,.04);
  --shadow-lg:      0 10px 25px -3px rgba(0,0,0,.08), 0 4px 6px -2px rgba(0,0,0,.04);
  --shadow-xl:      0 20px 40px -4px rgba(0,0,0,.10);

  --transition:     all .2s cubic-bezier(.4,0,.2,1);
  --font:           'Inter', system-ui, -apple-system, sans-serif;
}

/* Dark Mode */
.dark {
  --bg:           #0f172a;
  --surface:      #1e293b;
  --surface-2:    #162032;
  --border:       #334155;
  --border-light: #1e293b;
  --text:         #f1f5f9;
  --text-muted:   #94a3b8;
  --text-light:   #64748b;
  --sidebar-bg:   #020617;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: .9375rem;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .3s, color .3s;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
hr { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }
img { max-width: 100%; }

/* --- Layout --- */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 1000;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.sidebar-logo {
  height: 48px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 12px;
  background: rgba(255,255,255,.08);
  padding: 6px;
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 4px 16px rgba(0,0,0,.35), 0 0 24px rgba(99,102,241,.25);
}

.brand-icon {
  width: 40px; height: 40px;
  background: var(--primary);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 1.1rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(99,102,241,.4);
}

.brand-text { flex: 1; }
.brand-name  { display: block; color: #fff; font-weight: 700; font-size: 1.05rem; line-height: 1.2; }
.brand-sub   { display: block; color: #64748b; font-size: .7rem; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; }

.btn-sidebar-close {
  display: none;
  background: none; border: none;
  color: var(--sidebar-text); cursor: pointer;
  font-size: 1.1rem; padding: 4px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 12px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #334155 transparent;
}

.nav-section-label {
  color: #475569;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  padding: 12px 8px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-weight: 500;
  font-size: .875rem;
  transition: var(--transition);
  margin-bottom: 2px;
  text-decoration: none;
}

.nav-item:hover {
  background: rgba(255,255,255,.06);
  color: #e2e8f0;
  text-decoration: none;
}

.nav-item.active {
  background: rgba(99,102,241,.18);
  color: #a5b4fc;
  position: relative;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: var(--primary);
  border-radius: 0 4px 4px 0;
}

.nav-icon {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  font-size: .9rem;
  flex-shrink: 0;
  transition: var(--transition);
}

.nav-item:hover .nav-icon { background: rgba(255,255,255,.08); }
.nav-item.active .nav-icon { background: rgba(99,102,241,.3); color: #a5b4fc; }

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-user-info {
  flex: 1;
  overflow: hidden;
}

.sidebar-user-info span {
  display: block;
  color: #e2e8f0;
  font-weight: 600;
  font-size: .825rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-info small {
  color: #64748b;
  font-size: .72rem;
  text-transform: capitalize;
}

.btn-logout {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  color: #64748b;
  border-radius: 8px;
  transition: var(--transition);
  text-decoration: none;
}

.btn-logout:hover { background: rgba(239,68,68,.15); color: var(--danger); text-decoration: none; }

.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 999;
  backdrop-filter: blur(2px);
}

/* --- Main Content --- */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

/* --- Top Header --- */
.top-header {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0; z-index: 100;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.header-left { display: flex; align-items: center; gap: 14px; min-width: 0; }

.header-title h1 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: .78rem;
  color: var(--text-muted);
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); text-decoration: none; }

.header-right { display: flex; align-items: center; gap: 8px; }

.btn-icon {
  width: 36px; height: 36px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition);
  font-size: .9rem;
}

.btn-icon:hover { background: var(--border); color: var(--text); }

.btn-sidebar-toggle {
  background: none; border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px;
  transition: var(--transition);
}

.btn-sidebar-toggle:hover { color: var(--primary); }

.header-user {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  transition: var(--transition);
  position: relative;
  user-select: none;
}

.header-user:hover { border-color: var(--primary); background: var(--primary-light); }
.header-user .fa-chevron-down { font-size: .7rem; color: var(--text-muted); transition: var(--transition); }
.header-user.open .fa-chevron-down { transform: rotate(180deg); }

.user-info { text-align: left; }
.user-name  { display: block; font-weight: 600; font-size: .825rem; color: var(--text); }
.user-role  { display: block; font-size: .72rem; color: var(--text-muted); text-transform: capitalize; }

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  padding: 8px;
  display: none;
  z-index: 200;
  animation: fadeIn .15s ease;
}

.header-user.open .user-dropdown { display: block; }

.user-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .85rem;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
}

.user-dropdown a:hover { background: var(--bg); }
.user-dropdown a.text-danger { color: var(--danger); }
.user-dropdown a.text-danger:hover { background: var(--danger-light); }

/* --- Avatar --- */
.user-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: .75rem;
  letter-spacing: .05em;
  flex-shrink: 0;
}

.user-avatar.sm { width: 32px; height: 32px; font-size: .7rem; border-radius: 8px; }

/* --- Flash Messages --- */
.flash {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 24px 0;
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 500;
  animation: slideDown .3s ease;
  position: relative;
}

.flash-success { background: var(--success-light); color: #065f46; border: 1px solid #6ee7b7; }
.flash-error   { background: var(--danger-light);  color: #991b1b; border: 1px solid #fca5a5; }
.flash-warning { background: var(--warning-light); color: #92400e; border: 1px solid #fcd34d; }
.flash-info    { background: var(--info-light);    color: #1e40af; border: 1px solid #93c5fd; }

.flash-close {
  margin-left: auto;
  background: none; border: none;
  cursor: pointer; opacity: .6;
  color: inherit; font-size: .85rem;
  transition: var(--transition);
}

.flash-close:hover { opacity: 1; }

/* --- Page Body --- */
.page-body { padding: 24px; flex: 1; }

/* --- Cards --- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: var(--transition);
}

.card:hover { box-shadow: var(--shadow); }

.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-size: .9375rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title i { color: var(--primary); }

.card-body { padding: 22px; }
.card-footer { padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); }

/* --- Stat Cards --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.stat-card.primary::before  { background: var(--primary); }
.stat-card.success::before  { background: var(--success); }
.stat-card.danger::before   { background: var(--danger); }
.stat-card.warning::before  { background: var(--warning); }

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.stat-info { flex: 1; min-width: 0; }

.stat-label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  white-space: nowrap;
}

.stat-sub {
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.stat-card.primary .stat-icon  { background: var(--primary-light); color: var(--primary); }
.stat-card.success .stat-icon  { background: var(--success-light); color: var(--success); }
.stat-card.danger  .stat-icon  { background: var(--danger-light);  color: var(--danger); }
.stat-card.warning .stat-icon  { background: var(--warning-light); color: var(--warning); }

/* --- Grid Layouts --- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

/* --- Account Cards --- */
.account-card {
  border-radius: var(--radius-lg);
  padding: 22px;
  color: #fff;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  cursor: default;
}

.account-card::after {
  content: '';
  position: absolute;
  top: -30%; right: -10%;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  pointer-events: none;
}

.account-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-xl); }

.account-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}

.account-card-icon {
  width: 44px; height: 44px;
  background: rgba(255,255,255,.2);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  backdrop-filter: blur(4px);
}

.account-card-actions { display: flex; gap: 6px; position: relative; z-index: 2; }

.account-card-actions a,
.account-card-actions button {
  width: 32px; height: 32px;
  background: rgba(255,255,255,.15);
  border: none;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.9);
  font-size: .8rem;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
}

.account-card-actions a:hover,
.account-card-actions button:hover { background: rgba(255,255,255,.3); }

.account-card-bank { font-size: .78rem; opacity: .8; margin-bottom: 4px; }
.account-card-name { font-size: 1.05rem; font-weight: 700; margin-bottom: 2px; }
.account-card-num  { font-size: .78rem; opacity: .75; font-family: 'Courier New', monospace; }

.account-card-balance {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.15);
}

.account-card-balance-label { font-size: .72rem; opacity: .75; text-transform: uppercase; letter-spacing: .05em; }
.account-card-balance-value { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; }

/* --- Tables --- */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}

th {
  background: var(--surface-2);
  padding: 12px 16px;
  text-align: left;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
  vertical-align: middle;
}

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

tr:hover td { background: var(--surface-2); }

.table-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.table-empty i { font-size: 2rem; margin-bottom: 12px; opacity: .4; }

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}

.badge-primary   { background: var(--primary-light); color: var(--primary-dark); }
.badge-success   { background: var(--success-light); color: #065f46; }
.badge-danger    { background: var(--danger-light);  color: #991b1b; }
.badge-warning   { background: var(--warning-light); color: #92400e; }
.badge-info      { background: var(--info-light);    color: #1e40af; }
.badge-secondary { background: var(--bg);            color: var(--text-muted); }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}

.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.98); }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99,102,241,.3);
}

.btn-primary:hover { background: var(--primary-dark); color: #fff; box-shadow: 0 6px 16px rgba(99,102,241,.4); }

.btn-success {
  background: var(--success);
  color: #fff;
  box-shadow: 0 4px 12px rgba(16,185,129,.3);
}

.btn-success:hover { background: #059669; color: #fff; }

.btn-danger {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 4px 12px rgba(239,68,68,.3);
}

.btn-danger:hover { background: #dc2626; color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-outline:hover { background: var(--bg); border-color: var(--text-muted); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}

.btn-ghost:hover { background: var(--bg); color: var(--text); }

.btn-sm { padding: 6px 12px; font-size: .8rem; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }

.btn-icon-only {
  width: 36px; height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .875rem;
}

/* --- Forms --- */
.form-group { margin-bottom: 18px; }

label {
  display: block;
  font-size: .825rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-control, select, textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: .875rem;
  transition: var(--transition);
  appearance: none;
  -webkit-appearance: none;
}

.form-control:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}

.form-control::placeholder { color: var(--text-light); }

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

textarea { resize: vertical; min-height: 90px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

.form-text { font-size: .78rem; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: .78rem; color: var(--danger); margin-top: 4px; }

.input-group {
  display: flex;
  align-items: stretch;
}

.input-group .form-control { border-radius: var(--radius-sm) 0 0 var(--radius-sm); flex: 1; }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-group-text {
  padding: 10px 14px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  color: var(--text-muted);
  font-size: .875rem;
  display: flex; align-items: center;
  white-space: nowrap;
}

/* --- Filter Bar --- */
.filter-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.filter-bar .form-group { margin-bottom: 0; min-width: 150px; flex: 1; }

/* --- Modal --- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(3px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn .2s ease;
}

.modal-backdrop.open { display: flex; }

.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp .25s cubic-bezier(.4,0,.2,1);
}

.modal-lg { max-width: 720px; }
.modal-xl { max-width: 860px; max-height: 96vh; }
.modal-nested { z-index: 2100; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-title { font-size: 1rem; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.modal-body  { padding: 20px 24px; }
.modal-xl .modal-body { padding: 16px 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

.btn-modal-close {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 32px; height: 32px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  font-size: .875rem;
  transition: var(--transition);
}

.btn-modal-close:hover { background: var(--danger-light); border-color: var(--danger); color: var(--danger); }

/* --- Conta Ícone --- */
.conta-icone {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: .875rem;
}

/* --- Transaction Item --- */
.tx-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}

.tx-item:last-child { border-bottom: none; }

.tx-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem;
  flex-shrink: 0;
}

.tx-icon.credito { background: var(--success-light); color: var(--success); }
.tx-icon.debito  { background: var(--danger-light);  color: var(--danger); }

.tx-info { flex: 1; min-width: 0; }

.tx-desc {
  font-weight: 600;
  font-size: .875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx-meta { font-size: .75rem; color: var(--text-muted); margin-top: 2px; }

.tx-valor {
  font-weight: 700;
  font-size: .9375rem;
  white-space: nowrap;
}

.tx-valor.credito { color: var(--success); }
.tx-valor.debito  { color: var(--danger); }

/* --- Chart containers --- */
.chart-container { position: relative; }

/* --- Login Page --- */
.login-page {
  min-height: 100vh;
  display: flex;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
}

.login-left {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 56px;
  position: relative;
  overflow: hidden;
}

.login-left-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.login-left::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 40% 40%, rgba(99,102,241,.25) 0%, transparent 65%);
}

.login-logo-wrap {
  margin-bottom: 32px;
}

.login-logo-wrap img {
  max-height: 160px;
  width: auto;
  object-fit: contain;
  border-radius: 28px;
  box-shadow: 0 16px 56px rgba(99,102,241,.45), 0 4px 16px rgba(0,0,0,.4);
  padding: 16px;
  background: rgba(255,255,255,.07);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.12);
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-bottom: 40px;
}

.login-brand-name { color: #fff; font-size: 1.8rem; font-weight: 800; letter-spacing: -.02em; }
.login-brand-sub  { color: #64748b; font-size: .9rem; font-weight: 500; }

.login-headline {
  color: #f1f5f9;
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 14px;
}

.login-headline span { color: #a5b4fc; }

.login-desc { color: #64748b; font-size: .92rem; line-height: 1.7; max-width: 400px; }

.login-features { margin-top: 36px; display: flex; flex-direction: column; gap: 14px; width: 100%; text-align: left; }

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

.login-feature-icon {
  width: 40px; height: 40px;
  background: rgba(99,102,241,.15);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #a5b4fc;
  font-size: .95rem;
  flex-shrink: 0;
}

.login-feature-text { color: #94a3b8; font-size: .875rem; }
.login-feature-text strong { color: #e2e8f0; display: block; font-size: .9rem; }

.login-right {
  flex: 1;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 56px;
}

/* Logo mobile — visível por padrão, ocultado no desktop */
/* Banner do logo mobile */
.login-mobile-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px 20px 26px;
  background: linear-gradient(160deg, #0f172a 0%, #1e293b 60%, #1a1040 100%);
  border-radius: 0 0 32px 32px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.login-mobile-logo::before {
  content: '';
  position: absolute;
  top: -40px; left: 50%;
  transform: translateX(-50%);
  width: 220px; height: 220px;
  background: radial-gradient(ellipse, rgba(99,102,241,.35) 0%, transparent 70%);
  pointer-events: none;
}

.login-mobile-logo img {
  height: 88px;
  width: auto;
  object-fit: contain;
  border-radius: 20px;
  padding: 13px;
  background: rgba(255,255,255,.07);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.15);
  box-shadow:
    0 0 0 6px rgba(99,102,241,.12),
    0 0 0 12px rgba(99,102,241,.06),
    0 10px 36px rgba(0,0,0,.5),
    0 4px 14px rgba(99,102,241,.4);
  position: relative;
  z-index: 1;
}

.login-mobile-sub {
  font-size: .72rem;
  font-weight: 700;
  color: rgba(165,180,252,.8);
  text-transform: uppercase;
  letter-spacing: .12em;
  position: relative;
  z-index: 1;
}

/* Conteúdo do formulário abaixo do banner */
.login-form-body { padding: 24px 20px 20px; }

/* Oculta no desktop — painel esquerdo já exibe o logo */
@media (min-width: 769px) {
  .login-mobile-logo { display: none; }
  .login-form-body   { padding: 0; }
}

.login-form-wrap { width: 100%; max-width: 400px; }
.login-submit-btn { margin-top: 24px; }

.login-form-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}

.login-form-sub { color: var(--text-muted); font-size: .875rem; margin-bottom: 32px; }

/* --- Progress/Loading --- */
.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(255,255,255,.8);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
}

.dark .loading-overlay { background: rgba(15,23,42,.8); }

.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

/* --- Extrato --- */
.extrato-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius-lg);
  padding: 28px;
  color: #fff;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.extrato-header::after {
  content: '';
  position: absolute;
  top: -40%; right: -5%;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,.07);
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 64px 24px;
}

.empty-state-icon {
  width: 72px; height: 72px;
  background: var(--bg);
  border-radius: var(--radius-xl);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  color: var(--text-light);
  margin: 0 auto 20px;
}

.empty-state h3 { font-size: 1.1rem; color: var(--text); margin-bottom: 8px; }
.empty-state p  { color: var(--text-muted); font-size: .875rem; margin-bottom: 24px; }

/* --- Color Picker --- */
.color-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.color-opt {
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: var(--transition);
}

.color-opt.selected,
.color-opt:hover { border-color: var(--text); transform: scale(1.15); }

/* --- Pagination --- */
.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
}

.page-btn {
  min-width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  padding: 0 10px;
}

.page-btn:hover,
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* --- Utility Classes --- */
.text-success { color: var(--success) !important; }
.text-danger  { color: var(--danger)  !important; }
.text-muted   { color: var(--text-muted) !important; }
.text-primary { color: var(--primary) !important; }
.text-right   { text-align: right; }
.text-center  { text-align: center; }
.text-bold    { font-weight: 700; }
.text-sm      { font-size: .8rem; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mb-3  { margin-bottom: 12px; }
.mb-4  { margin-bottom: 16px; }
.mt-3  { margin-top: 12px; }
.mt-4  { margin-top: 16px; }
.w-100 { width: 100%; }

.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title i { color: var(--primary); }

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Extrato KPIs row (3 colunas → responsivo) --- */
.extrato-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,.2);
}

/* --- Transferência: grid origem → seta → destino --- */
.transfer-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
}

/* --- Print --- */
@media print {
  .sidebar, .top-header, .filter-bar, .btn, .flash,
  .no-print { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .card { box-shadow: none !important; border: 1px solid #e2e8f0 !important; }
  body { background: #fff !important; }
  .page-body { padding: 0 !important; }
}

/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */

/* ── 1024px — Tablets landscape ─────────────── */
@media (max-width: 1024px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── 768px — Tablets portrait / Mobile landscape */
@media (max-width: 768px) {
  /* Sidebar como gaveta */
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-xl); }
  .sidebar-overlay.open { display: block; }
  .btn-sidebar-close { display: flex; }
  .main-content { margin-left: 0; }

  /* Header */
  .top-header { padding: 0 14px; gap: 8px; }
  .user-info   { display: none; }                /* esconde nome/cargo, mantém avatar */
  .header-user { padding: 5px 8px; gap: 6px; }
  .header-user .fa-chevron-down { display: none; }
  .breadcrumb  { display: none; }
  .btn-icon    { width: 40px; height: 40px; }   /* touch target 40 px */

  /* Página */
  .page-body { padding: 14px; }
  .flash { margin: 10px 14px 0; }

  /* Grids */
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .stats-grid      { grid-template-columns: 1fr 1fr !important; } /* !important cobre inline style */

  /* Cards */
  .card-header { padding: 14px 16px; flex-wrap: wrap; }
  .card-body   { padding: 16px; }
  .card-footer { padding: 12px 16px; }
  .stat-card   { padding: 16px 14px; gap: 12px; }
  .stat-value  { font-size: 1.35rem; }
  .stat-icon   { width: 40px; height: 40px; font-size: 1rem; }

  /* Forms */
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .filter-bar            { padding: 12px; gap: 10px; }
  .filter-bar .form-group { min-width: calc(50% - 5px); }

  /* Botões de ação nas tabelas */
  .btn-icon-only { width: 38px; height: 38px; }

  /* Tabelas — rolar suave no iOS */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  th { padding: 10px 12px; font-size: .7rem; }
  td { padding: 10px 12px; font-size: .85rem; }

  /* Modal — full-width, desliza de baixo */
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal {
    max-width: 100%;
    max-height: 92vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    margin: 0;
  }
  .modal-xl        { max-width: 100%; max-height: 95vh; }
  .modal-xl .modal-body { padding: 12px 16px; }
  .modal-header    { padding: 16px 20px; }
  .modal-body      { padding: 16px 20px; }
  .modal-footer    { padding: 12px 20px; }

  /* Login — trava scroll no mobile de forma definitiva */
  body.login-body   { overflow: hidden; height: 100dvh; height: 100vh; }
  .login-page       { height: 100dvh; height: 100vh; min-height: unset; overflow: hidden; display: flex; flex-direction: column; }
  .login-left       { display: none; }
  .login-right      { flex: 1; min-height: 0; width: 100%; padding: 0; display: flex; flex-direction: column; overflow: hidden; }
  .login-form-wrap  { flex: 1; min-height: 0; max-width: 100%; padding: 0; display: flex; flex-direction: column; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .login-form-body  { padding: 20px 20px 24px; flex-shrink: 0; }
  .login-form-title { font-size: 1.35rem; margin-bottom: 4px; }
  .login-form-sub   { margin-bottom: 16px; }
  .form-group       { margin-bottom: 14px; }

  /* Extrato KPIs */
  .extrato-kpis { grid-template-columns: 1fr 1fr; gap: 12px; }

  /* Transferência — empilha em coluna */
  .transfer-grid { grid-template-columns: 1fr; }
  .transfer-arrow { display: none; }            /* seta visual some no mobile */

  /* Nav items — touch target maior */
  .nav-item { padding: 12px 12px; min-height: 44px; }
}

/* ── 480px — Mobile portrait ─────────────────── */
@media (max-width: 480px) {
  /* Tipografia */
  .header-title h1 { font-size: .9rem; }
  .stat-value      { font-size: 1.15rem; }
  .stat-label      { font-size: .72rem; }

  /* Stats — 1 coluna */
  .stats-grid { grid-template-columns: 1fr !important; }

  /* Extrato KPIs — 1 coluna */
  .extrato-kpis { grid-template-columns: 1fr; }

  /* Filter bar — coluna */
  .filter-bar .form-group { min-width: 100%; }

  /* Tabelas — célula menor */
  th, td { padding: 8px 10px; font-size: .78rem; }

  /* Modal — quase tela cheia */
  .modal, .modal-xl { max-height: 96vh; }
  .modal-header { padding: 14px 16px; }
  .modal-body   { padding: 12px 16px; }
  .modal-footer { padding: 10px 16px; flex-wrap: wrap; }
  .modal-footer .btn { flex: 1; justify-content: center; }

  /* Cards */
  .card-body   { padding: 12px; }
  .card-header { padding: 12px 14px; }
  .stat-card   { padding: 14px 12px; }

  /* Empty state */
  .empty-state { padding: 40px 16px; }

  /* Conta cards */
  .account-card { padding: 16px; }
  .account-card-balance-value { font-size: 1.4rem; }

  /* Login */
  .login-form-body  { padding: 16px 16px 20px; }
  .login-form-title { font-size: 1.2rem; }
  .form-group       { margin-bottom: 12px; }
  .login-submit-btn { margin-top: 14px; }
  .login-mobile-logo img { height: 150px; }
  .login-mobile-logo { padding: 24px 16px 22px; }
}
