:root {
  --primary-emerald: #059669;
  --bg-slate: #f8fafc;
  --white: #ffffff;
  --text-dark: #0f172a;
  --text-secondary: #475569;
  --border: #e2e8f0;
  --font-family: 'Plus Jakarta Sans', sans-serif;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
}

body {
  background-color: var(--bg-slate);
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Consultation Top Bar */
.consultation-topbar {
  background: #0f172a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--white);
  padding: 10px 0;
  font-size: 0.85rem;
  z-index: 1001;
  width: 100%;
}

.topbar-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.pulse-icon {
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseGreen 1.5s infinite;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.topbar-text {
  font-weight: 500;
  color: #94a3b8;
}

.topbar-btn {
  background: var(--primary-emerald);
  color: var(--white);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.75rem;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.topbar-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* App Layout Grid */
.app-layout {
  display: flex;
  flex-grow: 1;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px;
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 40px;
}

.sidebar-brand i {
  color: var(--primary-emerald);
}

.sidebar-brand span span {
  color: var(--primary-emerald);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item {
  background: none;
  border: none;
  padding: 12px 16px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}

.nav-item:hover {
  background: #f1f5f9;
  color: var(--text-dark);
}

.nav-item.active {
  background: rgba(5, 150, 105, 0.08);
  color: var(--primary-emerald);
}

.sidebar-footer {
  margin-top: auto;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: center;
}

/* Main Panel */
.main-panel {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.panel-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 20px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-header h2 {
  font-size: 1.4rem;
  font-weight: 800;
}

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

.user-role {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.avatar {
  width: 36px;
  height: 36px;
  background-color: var(--primary-emerald);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
}

/* Panel Content */
.panel-content {
  padding: 40px;
  flex-grow: 1;
  overflow-y: auto;
}

.tab-pane {
  display: none;
}

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

/* Overview Widgets */
.finance-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
  margin-bottom: 30px;
}

.finance-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 30px;
  box-shadow: var(--shadow);
}

.balance-card {
  background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
  color: var(--white);
  border: none;
  display: flex;
  flex-direction: column;
}

.finance-card h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  font-weight: 700;
  margin-bottom: 12px;
}

.balance-card h3 {
  color: #a7f3d0;
}

.finance-card .val {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 20px;
}

.indicators {
  display: flex;
  gap: 24px;
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 16px;
}

.indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
}

.indicator.inc { color: #34d399; }
.indicator.exp { color: #f87171; }

/* Budget Progress Rows */
.budget-summary-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.budget-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.budget-row-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 700;
}

.budget-row-label {
  color: var(--text-dark);
}

.budget-row-vals {
  color: var(--text-secondary);
}

.progress-bar-container {
  height: 8px;
  background: #f1f5f9;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.progress-bar {
  height: 100%;
  background: var(--primary-emerald);
  border-radius: 10px;
  transition: width 0.4s;
}

.progress-bar.warning {
  background-color: #f59e0b;
}

.progress-bar.danger {
  background-color: #ef4444;
}

/* Two column layout */
.two-col-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px;
}

.widget-card {
  background: var(--white);
  border: 1px solid var(--border);
  padding: 30px;
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.widget-card h3 {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 20px;
}

/* Form Styles */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.form-group input, .form-group select {
  background-color: #FFFFFF !important;
  color: #0F172A !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.95rem;
  outline: none;
}

.form-group input:focus, .form-group select:focus {
  border-color: var(--primary-emerald) !important;
}

/* Buttons */
.btn {
  border: none;
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.btn-primary {
  background-color: var(--primary-emerald);
  color: var(--white);
}

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

.btn-sm-action {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  background-color: #f1f5f9;
  border: 1px solid var(--border);
  cursor: pointer;
  font-weight: 700;
}

.btn-sm-action:hover {
  background-color: #e2e8f0;
}

.w-full { width: 100%; }
.mt-4 { margin-top: 16px; }

/* Tables */
.table-container {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th, td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
}

th {
  background: #f8fafc;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

td {
  font-size: 0.9rem;
}

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

/* Category budget layout */
.budget-planning-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.budget-plan-card {
  background: var(--white);
  border: 1px solid var(--border);
  padding: 24px;
  border-radius: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.budget-plan-header h4 {
  font-weight: 800;
  font-size: 1.05rem;
}

.budget-plan-limit {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.budget-plan-limit strong {
  color: var(--text-dark);
}

.budget-input-row {
  display: flex;
  gap: 10px;
}

.budget-input-row input {
  width: 100px;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-weight: 700;
}

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

@media(max-width: 768px) {
  .app-layout {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 16px;
  }
  .sidebar-brand {
    margin-bottom: 20px;
  }
  .sidebar-nav {
    flex-direction: row;
    overflow-x: auto;
  }
  .panel-content {
    padding: 20px;
  }
}
