/* ==========================================================================
   BIAN & CBI Consumer Loan Management System - Core Design System & Tokens
   Modern Light Banking Aesthetic
   ========================================================================== */

:root {
  /* Primary Banking Palette */
  --primary-900: #0f172a;
  --primary-800: #1e3a8a;
  --primary-700: #1d4ed8;
  --primary-600: #2563eb;
  --primary-500: #3b82f6;
  --primary-400: #60a5fa;
  --primary-100: #dbeafe;
  --primary-50:  #eff6ff;

  /* Accent & Status Colors */
  --emerald-600: #059669;
  --emerald-500: #10b981;
  --emerald-100: #d1fae5;
  --emerald-50:  #ecfdf5;

  --amber-600:   #d97706;
  --amber-500:   #f59e0b;
  --amber-100:   #fef3c7;
  --amber-50:    #fffbeb;

  --rose-600:    #e11d48;
  --rose-500:    #f43f5e;
  --rose-100:    #ffe4e6;
  --rose-50:     #fff1f2;

  --indigo-600:  #4f46e5;
  --indigo-500:  #6366f1;
  --indigo-50:   #eef2ff;

  /* Neutral Backgrounds & Surfaces */
  --bg-app:        #f1f5f9;
  --bg-surface:    #ffffff;
  --bg-glass:      rgba(255, 255, 255, 0.85);
  --bg-card:       #ffffff;
  --bg-muted:      #f8fafc;

  /* Text & Border Colors */
  --text-main:     #0f172a;
  --text-muted:    #475569;
  --text-light:    #94a3b8;
  --border-light:  #e2e8f0;
  --border-focus:  #3b82f6;

  /* Shadows & Elevations */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);

  /* Geometry & Transitions */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
  font-family: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
  direction: rtl;
  text-align: right;
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* Sidebar Navigation */
.sidebar {
  width: 280px;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  z-index: 50;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

.brand-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-800) 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 22px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.brand-text h1 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary-900);
}

.brand-text p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.sidebar-nav {
  padding: 20px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.92rem;
  transition: all var(--transition-fast);
  cursor: pointer;
  border: 1px solid transparent;
}

.nav-item .nav-icon {
  font-size: 1.2rem;
  width: 24px;
  text-align: center;
}

.nav-item:hover {
  background: var(--primary-50);
  color: var(--primary-700);
}

.nav-item.active {
  background: linear-gradient(90deg, var(--primary-50) 0%, #ffffff 100%);
  color: var(--primary-700);
  font-weight: 700;
  border-right: 4px solid var(--primary-600);
  border-color: var(--primary-100);
  box-shadow: var(--shadow-sm);
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-muted);
  font-size: 0.78rem;
  color: var(--text-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Main Content Area */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-app);
}

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

.header-left-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.page-title h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary-900);
}

.page-title p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Content View Panels */
.content-view {
  padding: 32px;
  flex: 1;
  display: none;
  animation: fadeIn 0.25s ease-out;
}

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

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