/* ==========================================================================
   Dragon Budget CSS - Premium Dark Glassmorphism Styling
   ========================================================================== */

/* Color Variables & Config */
:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --card-bg: rgba(255, 255, 255, 0.03);
  --card-bg-hover: rgba(255, 255, 255, 0.06);
  --card-border: rgba(255, 255, 255, 0.06);
  --card-border-glow: rgba(99, 102, 241, 0.15);
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dark: #6b7280;
  
  /* Accent Colors */
  --primary: #6366f1; /* Indigo */
  --primary-glow: rgba(99, 102, 241, 0.4);
  --success: #0d9488; /* Teal */
  --success-glow: rgba(13, 148, 136, 0.3);
  --danger: #db2777; /* Rose/Pink */
  --danger-glow: rgba(219, 39, 119, 0.3);
  --warning: #d97706; /* Amber */
  --info: #0284c7; /* Sky */
  
  --sidebar-width: 260px;
  --header-height: 80px;
  --transition-speed: 0.3s;
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

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

/* Sidebar Styling */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  border-right: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
  padding: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
}

.logo-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--success) 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  box-shadow: 0 4px 15px var(--primary-glow);
  animation: logo-glow 3s infinite alternate;
}

@keyframes logo-glow {
  0% { box-shadow: 0 4px 15px var(--primary-glow); }
  100% { box-shadow: 0 4px 20px var(--success-glow); }
}

.brand-text h1 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(to right, #ffffff, #c7d2fe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text span {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dark);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  border-radius: 10px;
  transition: all var(--transition-speed) ease;
  border: 1px solid transparent;
}

.nav-item i {
  font-size: 16px;
  width: 20px;
  text-align: center;
  transition: transform var(--transition-speed) ease;
}

.nav-item:hover {
  background: var(--card-bg-hover);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.05);
}

.nav-item:hover i {
  transform: translateX(3px);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.15) 0%, rgba(99, 102, 241, 0.03) 100%);
  color: var(--primary);
  border: 1px solid rgba(99, 102, 241, 0.2);
  font-weight: 600;
  box-shadow: inset 0 0 10px rgba(99, 102, 241, 0.05);
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--card-border);
  padding-top: 20px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  font-size: 32px;
  color: var(--text-muted);
}

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

.user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

.user-role {
  font-size: 11px;
  color: var(--text-muted);
}

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

/* Top Header */
.top-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 30px;
  position: sticky;
  top: 0;
  background-color: rgba(10, 14, 23, 0.8);
  backdrop-filter: blur(12px);
  z-index: 90;
}

.header-title h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.header-title p {
  font-size: 13px;
  color: var(--text-muted);
}

/* Glass Cards System */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
  transition: transform var(--transition-speed) cubic-bezier(0.16, 1, 0.3, 1),
              border-color var(--transition-speed) ease,
              box-shadow var(--transition-speed) ease;
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.3);
}

/* Card Header */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 12px;
}

.card-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
  background: #4f46e5;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.btn-secondary {
  background: var(--card-bg);
  color: var(--text-main);
  border-color: var(--card-border);
}

.btn-secondary:hover {
  background: var(--card-bg-hover);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-block {
  width: 100%;
}

.btn-gradient {
  background: linear-gradient(135deg, var(--primary) 0%, var(--success) 100%);
  color: #fff;
  border: none;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-gradient:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-danger-outline {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(219, 39, 119, 0.3);
  padding: 6px 12px;
  font-size: 12px;
}

.btn-danger-outline:hover {
  background: rgba(219, 39, 119, 0.1);
  border-color: var(--danger);
}

/* Tabs Panel Routing */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Summary Grid (Top widgets) */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 30px;
}

.summary-card {
  display: flex;
  align-items: center;
  gap: 20px;
  position: relative;
  overflow: hidden;
}

.summary-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.gradient-cyan::before { background: var(--success); }
.gradient-purple::before { background: var(--primary); }
.gradient-rose::before { background: var(--danger); }

.summary-card:hover {
  transform: translateY(-4px);
}

.card-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.gradient-cyan .card-icon {
  background: rgba(13, 148, 136, 0.15);
  color: #2dd4bf;
}

.gradient-purple .card-icon {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
}

.gradient-rose .card-icon {
  background: rgba(219, 39, 119, 0.15);
  color: #f472b6;
}

.card-data h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 4px;
}

.card-data h2 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.card-sub {
  font-size: 11px;
  color: var(--text-dark);
  display: block;
  margin-top: 2px;
}

/* Dashboard Grid Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.8fr 1.2fr;
  gap: 24px;
  margin-bottom: 30px;
}

@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.chart-container {
  min-height: 380px;
}

.chart-wrapper {
  position: relative;
  height: 280px;
  width: 100%;
}

.quick-log-card {
  display: flex;
  flex-direction: column;
}

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

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

label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
select {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
}

input:focus,
select:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.15);
}

select option {
  background-color: var(--bg-secondary);
  color: var(--text-main);
}

/* Badges */
.badge {
  display: inline-flex;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  text-transform: uppercase;
}

.badge-success {
  background: rgba(13, 148, 136, 0.15);
  color: #2dd4bf;
}

.badge-danger {
  background: rgba(219, 39, 119, 0.15);
  color: #f472b6;
}

/* Tables Layout */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.data-table th {
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.data-table tbody tr {
  transition: background-color var(--transition-speed) ease;
}

.data-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.015);
}

.amount-income {
  color: #2dd4bf;
  font-weight: 700;
}

.amount-expense {
  color: #f472b6;
  font-weight: 700;
}

/* View All Link */
.view-all-link {
  font-size: 12px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.view-all-link:hover {
  text-decoration: underline;
}

/* Monthly & Yearly Planner Styles */
.planner-controls {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
}

.control-row {
  display: flex;
  gap: 20px;
}

.control-item {
  width: 160px;
}

.planner-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 768px) {
  .planner-grid {
    grid-template-columns: 1fr;
  }
  .planner-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
}

.budget-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Budget category item with progress bar */
.budget-progress-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.budget-item-header {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
}

.budget-item-name {
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.budget-item-delete {
  color: var(--text-dark);
  cursor: pointer;
  transition: color 0.2s ease;
}

.budget-item-delete:hover {
  color: var(--danger);
}

.budget-item-values {
  color: var(--text-muted);
}

.budget-progress-bg {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.budget-progress-fill {
  height: 100%;
  border-radius: 4px;
  width: 0;
  transition: width 0.5s ease-in-out;
}

.fill-expense {
  background: linear-gradient(90deg, #ec4899, #db2777);
  box-shadow: 0 0 10px rgba(219, 39, 119, 0.4);
}

.fill-income {
  background: linear-gradient(90deg, #14b8a6, #0d9488);
  box-shadow: 0 0 10px rgba(13, 148, 136, 0.4);
}

/* Action Header Bar */
.action-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.action-header-bar h3 {
  font-size: 18px;
  font-weight: 700;
}

/* Savings Goals Grid */
.goals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.goal-card {
  display: flex;
  flex-direction: column;
  position: relative;
}

.goal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.goal-title-area h4 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 2px;
}

.goal-category {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--primary);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.goal-actions {
  display: flex;
  gap: 8px;
}

.goal-action-btn {
  background: transparent;
  border: none;
  color: var(--text-dark);
  cursor: pointer;
  font-size: 14px;
  transition: color 0.2s ease;
}

.goal-action-btn:hover {
  color: var(--text-main);
}

.goal-action-btn.delete:hover {
  color: var(--danger);
}

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

.goal-metric-item {
  display: flex;
  flex-direction: column;
}

.goal-metric-label {
  font-size: 11px;
  color: var(--text-muted);
}

.goal-metric-val {
  font-size: 16px;
  font-weight: 700;
}

.goal-progress-container {
  margin-bottom: 18px;
}

.goal-progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.goal-progress-bar {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 5px;
  overflow: hidden;
}

.goal-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #a5b4fc);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
  width: 0%;
  transition: width 0.6s ease;
}

.goal-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 14px;
  margin-top: auto;
}

.goal-deadline {
  font-size: 11px;
  color: var(--text-dark);
}

/* Debts Layout */
.debts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

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

.debt-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
}

.debt-title h4 {
  font-size: 16px;
  font-weight: 700;
}

.debt-creditor {
  font-size: 11px;
  color: var(--danger);
  font-weight: 700;
  text-transform: uppercase;
}

.debt-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.debt-metric-block {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  padding: 8px 12px;
}

.debt-metric-lbl {
  font-size: 10px;
  color: var(--text-dark);
  text-transform: uppercase;
}

.debt-metric-val {
  font-size: 15px;
  font-weight: 700;
}

.debt-progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.debt-progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 20px;
}

.debt-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ec4899, #f43f5e);
  box-shadow: 0 0 10px rgba(236, 72, 153, 0.4);
  width: 0%;
  transition: width 0.6s ease;
}

.debt-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 14px;
  margin-top: auto;
}

.debt-interest-badge {
  font-size: 11px;
  color: var(--text-dark);
  font-weight: 600;
}

/* Debt free strategy calculator */
.debt-calculator-panel {
  margin-bottom: 24px;
}

.debt-calculator-panel h3 {
  font-size: 16px;
  margin-bottom: 8px;
  color: var(--primary);
}

.debt-calculator-panel p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.calc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

@media (max-width: 600px) {
  .calc-row {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
}

.calc-group {
  flex-grow: 1;
}

.calc-result {
  display: flex;
  gap: 30px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 12px 24px;
  border-radius: 12px;
}

.calc-label {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
}

.calc-result strong {
  font-size: 18px;
  color: var(--success);
}

/* Ledger List filter styles */
.ledger-filters {
  margin-bottom: 24px;
}

.filter-row {
  display: flex;
  gap: 20px;
}

.filter-group {
  width: 180px;
}

/* Modals Overlay & Animation */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 100%;
  max-width: 500px;
  background: rgba(17, 24, 39, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  transform: translateY(-20px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 12px;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: var(--text-main);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 16px;
}

/* Helpers */
.d-none {
  display: none !important;
}

.badge-active {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
}

.badge-achieved {
  background: rgba(13, 148, 136, 0.15);
  color: #2dd4bf;
}

/* Recurring Payments Checklist Styles */
.checklist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  transition: all 0.2s ease;
  margin-bottom: 8px;
}

.checklist-item:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.06);
}

.checklist-item.paid {
  border-color: rgba(13, 148, 136, 0.15);
  background: rgba(13, 148, 136, 0.02);
}

.checklist-item-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.checklist-status-icon {
  font-size: 20px;
  width: 24px;
  text-align: center;
}

.checklist-status-icon.unpaid {
  color: var(--warning);
}

.checklist-status-icon.paid {
  color: #2dd4bf;
}

.checklist-details {
  display: flex;
  flex-direction: column;
}

.checklist-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  transition: all 0.2s ease;
}

.checklist-item.paid .checklist-title {
  text-decoration: line-through;
  color: var(--text-dark);
}

.checklist-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.checklist-action {
  display: flex;
  align-items: center;
}

/* ==========================================================================
   Responsive Styles & Media Queries
   ========================================================================== */

/* Mobile Sidebar Backdrop Overlay */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 14, 23, 0.7);
  backdrop-filter: blur(4px);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Sidebar Toggle & Close Buttons default states */
.mobile-nav-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 20px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 6px;
  transition: background-color 0.2s;
}

.mobile-nav-toggle:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.mobile-sidebar-close {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 28px;
  cursor: pointer;
  padding: 0 8px;
  line-height: 1;
  transition: color 0.2s;
}

.mobile-sidebar-close:hover {
  color: var(--text-main);
}

/* Desktop Sidebar Adjustments */
@media (min-width: 993px) {
  .sidebar {
    transform: translateX(0) !important;
  }
}

/* Media Query: Tablets & Smaller Desktops */
@media (max-width: 992px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform var(--transition-speed) cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 100;
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.5);
    overflow-y: auto; /* Ensure menu is scrollable on small landscape viewports */
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    padding: 0 20px 20px 20px;
  }

  .top-header {
    margin-bottom: 20px;
  }

  .mobile-nav-toggle {
    display: flex;
  }

  .mobile-sidebar-close {
    display: block;
  }

  .brand {
    justify-content: space-between;
    width: 100%;
    margin-bottom: 30px;
  }
}

/* Media Query: Mobile Devices */
@media (max-width: 768px) {
  /* Fluid typography optimization */
  body {
    font-size: 14px;
  }
  h2 {
    font-size: 20px !important;
  }
  h3 {
    font-size: 16px !important;
  }
  h4 {
    font-size: 14px !important;
  }
  .top-header h2 {
    font-size: 22px !important;
  }

  /* Compact padding optimization */
  .glass-card {
    padding: 16px !important;
  }

  .main-content {
    padding: 0 12px 12px 12px;
  }

  .top-header {
    height: auto;
    min-height: 80px;
    padding: 12px 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
  }

  .header-actions {
    width: 100%;
  }

  .header-actions .btn {
    width: 100%;
  }

  /* Table adaptations for smaller viewports - hide secondary columns */
  .hide-mobile {
    display: none !important;
  }

  /* Text-truncation to prevent table horizontal blowouts */
  .data-table td {
    max-width: 130px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Summary Grid - Stack into one clean column */
  .summary-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
    margin-bottom: 20px;
  }

  /* Card Grids - Stack into single column to prevent squeezing */
  .goals-grid, 
  .debts-grid {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }

  /* Filters wrapping */
  .filter-row {
    flex-direction: column;
    gap: 10px;
  }

  .filter-group {
    width: 100%;
  }

  /* Planner Controls wrapping */
  .planner-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .control-row {
    flex-direction: column;
    gap: 10px;
  }

  .control-item {
    width: 100%;
  }

  /* Table cell padding tweaks */
  .data-table th, 
  .data-table td {
    padding: 8px 10px;
    font-size: 12px;
  }

  /* Modal scaling */
  .modal-card {
    max-width: 95%;
    margin: 10px;
    padding: 16px;
  }
}

/* Media Query: Extra Small Mobile Phones */
@media (max-width: 576px) {
  .summary-card {
    padding: 12px 16px !important;
  }

  /* Compact form inputs & buttons for touch optimization */
  .form-group input, 
  .form-group select {
    padding: 10px 12px;
    font-size: 13px;
  }

  .btn {
    padding: 10px 18px;
    font-size: 13px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .calc-result {
    flex-direction: column;
    gap: 10px;
    padding: 10px;
  }

  .calc-row {
    gap: 12px;
  }
  
  .goal-metrics,
  .debt-metrics {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* Password Visibility Toggle */
.password-toggle-btn {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent !important;
  border: none !important;
  color: var(--text-dark) !important;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  height: 24px;
  width: 24px;
  padding: 0 !important;
  transition: color 0.2s ease;
}

.password-toggle-btn:hover {
  color: var(--primary) !important;
}

