/* ===== VARIABLES ===== */
:root {
  /* DARK THEME */
  --bg-main: #0f172a;
  --bg-surface: #1e293b;
  --bg-sidebar: #020617;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-sidebar: #94a3b8;
  
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  
  --border: #334155;
  --radius: 8px;
  --radius-lg: 12px;
  
  --font-sans: 'Inter', sans-serif;
}

/* ===== RESET ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
}

/* ===== DEMO BANNER ===== */
.demo-banner {
  background-color: #450a0a;
  border-bottom: 1px solid #7f1d1d;
  color: #fca5a5;
  padding: 10px 24px;
  font-size: 0.9rem;
  z-index: 100;
  position: relative;
}
.text-center { text-align: center; }

/* ===== LAYOUT ===== */
.app-layout {
  display: flex;
  min-height: calc(100vh - 41px);
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: 250px;
  background-color: var(--bg-sidebar);
  color: #fff;
  display: flex;
  flex-direction: column;
}
.sidebar-brand {
  height: 70px;
  display: flex; align-items: center; gap: 12px;
  padding: 0 24px;
  font-size: 1.25rem; font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.sidebar-nav {
  list-style: none; padding: 24px 12px; flex: 1;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; margin-bottom: 8px;
  color: var(--text-sidebar);
  border-radius: var(--radius);
  cursor: pointer; font-weight: 500; font-size: 0.95rem;
  transition: all 0.2s;
}
.nav-item:hover, .nav-item.active {
  background: rgba(255,255,255,0.05);
  color: #fff;
}
.sidebar-bottom {
  padding: 24px; border-top: 1px solid rgba(255,255,255,0.05);
}

.lang-toggle {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: rgba(255,255,255,0.05); color: #fff;
  border: 1px solid rgba(255,255,255,0.1);
  padding: 10px; border-radius: var(--radius); cursor: pointer;
  font-weight: 600; transition: 0.2s;
}
.lang-toggle:hover { background: rgba(255,255,255,0.1); }

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  display: flex; flex-direction: column;
  overflow-x: hidden;
}
.topbar {
  height: 70px; background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.page-title h1 { font-size: 1.25rem; font-weight: 600; margin-bottom: 2px; }
.page-title .subtitle { font-size: 0.85rem; color: var(--text-muted); }

.user-profile { display: flex; align-items: center; gap: 12px; }
.avatar { width: 36px; height: 36px; background: var(--primary); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 600; }
.user-info .name { font-size: 0.9rem; font-weight: 600; }
.user-info .role { font-size: 0.75rem; color: var(--text-muted); }

/* TABS */
.tab-content-container {
  flex: 1;
  position: relative;
}
.tab-pane {
  display: none;
}
.tab-pane.active {
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.3s ease-in-out;
}

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

.dashboard-grid {
  padding: 32px; display: flex; flex-direction: column; gap: 32px;
}

/* STATS ROW */
.stats-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px;
}
.stat-card {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 24px; display: flex; align-items: center; gap: 16px;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}
.stat-icon {
  width: 50px; height: 50px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.bg-blue { background: rgba(59, 130, 246, 0.1); color: #60a5fa; }
.bg-green { background: rgba(16, 185, 129, 0.1); color: #34d399; }
.bg-purple { background: rgba(168, 85, 247, 0.1); color: #c084fc; }

.stat-details { display: flex; flex-direction: column; gap: 4px; }
.stat-label { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-val { font-size: 1.5rem; font-weight: 700; color: var(--text-main); }

/* WIDGET ROW */
.widget-row {
  display: grid; grid-template-columns: 1fr 380px; gap: 24px; align-items: start;
}
@media(max-width: 1100px) {
  .widget-row { grid-template-columns: 1fr; }
}

.panel {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); overflow: hidden;
}
.panel-header {
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.panel-header h2 { font-size: 1.1rem; font-weight: 600; }
.badge-live {
  display: flex; align-items: center; gap: 6px; background: rgba(16, 185, 129, 0.1); color: #34d399;
  padding: 4px 10px; border-radius: 99px; font-size: 0.75rem; font-weight: 700;
}
.badge-live .dot { width: 6px; height: 6px; background: #34d399; border-radius: 50%; }
.panel-body { padding: 24px; }

/* DATA TABLE */
.table-responsive { overflow-x: auto; margin-bottom: 16px; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; }
.data-table th { padding: 12px 16px; background: rgba(0,0,0,0.2); font-size: 0.85rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; border-bottom: 2px solid var(--border); }
.data-table td { padding: 16px; border-bottom: 1px solid var(--border); font-size: 0.95rem; font-weight: 500; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: rgba(0,0,0,0.1); }
.price-val { font-family: 'Inter', sans-serif; color: var(--text-main); }
.panel-hint { font-size: 0.8rem; color: var(--text-muted); font-style: italic; }

.status-badge { display: inline-block; padding: 4px 10px; border-radius: 99px; font-size: 0.8rem; font-weight: 600; }
.status-badge.success { background: rgba(16, 185, 129, 0.1); color: #34d399; }
.status-badge.warning { background: rgba(245, 158, 11, 0.1); color: #fbbf24; }
.status-badge.danger { background: rgba(239, 68, 68, 0.1); color: #f87171; }

/* CALCULATOR FORM */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-size: 0.9rem; font-weight: 500; color: var(--text-main); }
.form-control {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 6px;
  font-family: var(--font-sans); font-size: 0.95rem; transition: 0.2s;
  outline: none; background: #0f172a; color: var(--text-main);
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); }
.form-control[readonly] { background: rgba(0,0,0,0.2); color: var(--text-muted); cursor: not-allowed; }

.calc-result {
  background: rgba(0,0,0,0.2); border: 1px dashed var(--border); padding: 16px; border-radius: 8px;
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
}
.result-label { font-size: 0.85rem; color: var(--text-muted); }
.result-unit-val { font-size: 1.1rem; font-weight: 500; color: var(--text-main); }
.result-val { font-size: 1.75rem; font-weight: 700; color: var(--primary-hover); }

/* PLACEHOLDER CHART */
.chart-container {
  width: 100%;
}

.w-100 { width: 100%; }
.mt-3 { margin-top: 16px; }
.mt-2 { margin-top: 8px; }

/* BUTTONS */
.btn {
  display: inline-flex; justify-content: center; align-items: center;
  padding: 12px 24px; border-radius: 6px; border: none; font-weight: 600; font-size: 0.95rem;
  cursor: pointer; transition: 0.2s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }

/* POWERED BY */
.powered-badge {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--bg-surface); border: 1px solid var(--border); box-shadow: 0 4px 6px -1px rgba(0,0,0,0.5);
  padding: 10px 16px; border-radius: 99px; font-size: 0.85rem; color: var(--text-muted);
  display: flex; align-items: center; gap: 6px; transition: 0.2s; z-index: 100;
  text-decoration: none;
}
.powered-badge:hover { transform: translateY(-2px); box-shadow: 0 10px 15px -3px rgba(0,0,0,0.5); }
.powered-badge strong { color: var(--text-main); }

/* ===== MOBILE RESPONSIVE ===== */
.mobile-menu-btn {
  display: none;
  cursor: pointer;
  color: var(--text-main);
}
.sidebar-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.6); z-index: 999;
  opacity: 0; visibility: hidden; transition: 0.3s;
}
.sidebar-overlay.active {
  opacity: 1; visibility: visible;
}

@media(max-width: 900px) {
  .sidebar {
    position: fixed; left: -260px; top: 0; bottom: 0;
    z-index: 1000; width: 260px;
    transition: left 0.3s ease;
  }
  .sidebar.active {
    left: 0;
  }
  .mobile-menu-btn { display: block; }
  .topbar { padding: 0 16px; }
  .page-title h1 { font-size: 1rem; }
  .page-title .subtitle { display: none; }
  .dashboard-grid { padding: 16px; gap: 16px; }
  .user-info { display: none; }
  .stat-card { padding: 16px; }
  .panel-body { padding: 16px; }
  .panel-header { padding: 16px; }
}
