/* Nifty 50 Decliner SIP Dashboard Stylesheet */
:root {
  --sidebar-bg: #0b132b;
  --sidebar-hover: #1c2541;
  --sidebar-active: #2563eb;
  --sidebar-text: #94a3b8;
  --sidebar-text-hover: #ffffff;
  
  --bg-main: #f1f5f9;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  
  --text-main: #1e293b;
  --text-muted: #64748b;
  
  --primary: #2563eb;
  --primary-light: #eff6ff;
  --success: #10b981;
  --success-light: #ecfdf5;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --warning: #f59e0b;
  --purple: #8b5cf6;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
}

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

/* Sidebar Backdrop for Mobile Drawer */
.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(11, 19, 43, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.sidebar-backdrop.active {
  display: block;
  opacity: 1;
  pointer-events: auto;
}
body.sidebar-active-locked {
  overflow: hidden;
}

/* Left Sidebar */
.sidebar {
  width: 260px;
  background-color: var(--sidebar-bg);
  color: #fff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 1.25rem 1rem;
}

.sidebar-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 1.25rem;
}
.sidebar-header-row .sidebar-brand {
  padding-bottom: 0;
  border-bottom: none;
  margin-bottom: 0;
}

.sidebar-close-btn {
  display: none;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.sidebar-close-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 1.25rem;
  text-decoration: none;
}

.brand-icon {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 32px;
}
.brand-icon span {
  width: 5px;
  background-color: var(--success);
  border-radius: 2px;
}
.brand-icon span:nth-child(1) { height: 16px; }
.brand-icon span:nth-child(2) { height: 24px; }
.brand-icon span:nth-child(3) { height: 30px; }
.brand-icon span:nth-child(4) { height: 20px; }

.brand-text h1 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.15;
}
.brand-text span.sub {
  font-size: 0.72rem;
  color: var(--success);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.sidebar-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0.9rem;
  color: var(--sidebar-text);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all 0.2s ease;
}

.sidebar-nav li a:hover {
  color: var(--sidebar-text-hover);
  background-color: var(--sidebar-hover);
}

.sidebar-nav li a.active {
  background-color: var(--sidebar-active);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.sidebar-nav .nav-icon {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

/* Sidebar Simulation Card at Bottom */
.sidebar-simulation-card {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  margin-top: 1rem;
}
.sim-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}
.sim-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
}
.sim-badge {
  background-color: var(--success);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
}
.sim-desc {
  font-size: 0.72rem;
  color: #94a3b8;
  line-height: 1.35;
}

/* Main Content Area */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Top Header Bar */
.top-header {
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
}

.top-header-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.mobile-toggle-btn {
  display: none;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 38px;
  height: 38px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.mobile-toggle-btn:hover {
  background: #e2e8f0;
}

.mobile-brand-title {
  display: none;
  align-items: center;
  gap: 0.45rem;
}
.mobile-brand-main {
  font-weight: 800;
  font-size: 1rem;
  color: var(--text-main);
  letter-spacing: -0.2px;
}
.mobile-brand-badge {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  text-transform: uppercase;
}

.tagline {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
}
.tagline span {
  margin: 0 0.5rem;
  color: #cbd5e1;
}

.top-header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.market-status-box {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.82rem;
  text-align: right;
}
.market-status-box .date-text {
  font-weight: 600;
  color: var(--text-main);
}
.market-status-box .status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}
.status-pill.open { color: var(--success); }
.status-pill.closed { color: #f59e0b; }

.user-profile-menu {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
}
.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #e2e8f0;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}
.user-info-text {
  font-size: 0.85rem;
  font-weight: 600;
}

/* Content Container */
.content-body {
  padding: 1.75rem 2rem;
  flex: 1;
}

/* Cards & Layout */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.card-header-clean {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.card-header-clean h2, .card-header-clean h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}
.card-header-clean .header-action {
  font-size: 0.82rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}
.card-header-clean .header-action:hover {
  text-decoration: underline;
}

/* Next Scheduled Auto SIP Live Countdown Banner */
.sip-timer-banner {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.4rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.sip-timer-left {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  flex: 1;
  min-width: 0;
}

.sip-timer-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.pulse-indicator {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  background-color: #10b981;
  border: 2px solid #ffffff;
  border-radius: 50%;
  animation: pulse-ring 2s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.sip-timer-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.sip-timer-badge-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.badge-timer-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.badge-timer-status {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}
.badge-timer-status.executed {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.badge-timer-status.pending {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.sip-timer-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}
.sip-timer-title span {
  color: var(--primary);
}

.sip-timer-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.sip-timer-meta .bullet-sep {
  color: #cbd5e1;
}

/* Timer Countdown Clock Display */
.sip-timer-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.timer-countdown-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: #0b132b;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 15px rgba(11, 19, 43, 0.2);
}

.timer-unit-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 48px;
}

.timer-val {
  font-size: 1.45rem;
  font-weight: 800;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #38bdf8;
  line-height: 1;
  letter-spacing: -0.5px;
}

.timer-lbl {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.5px;
  margin-top: 3px;
}

.timer-colon {
  font-size: 1.3rem;
  font-weight: 700;
  color: #64748b;
  margin-top: -10px;
  user-select: none;
}

.quick-timer-inline {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 7px;
  border-radius: 4px;
}

/* Top 4 KPI Cards Grid */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.kpi-stat-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.15rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.kpi-icon-box {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #fff;
  flex-shrink: 0;
}
.kpi-icon-box.blue { background: linear-gradient(135deg, #0284c7, #38bdf8); }
.kpi-icon-box.green { background: linear-gradient(135deg, #059669, #34d399); }
.kpi-icon-box.purple { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
.kpi-icon-box.amber { background: linear-gradient(135deg, #d97706, #fbbf24); }

.kpi-details {
  display: flex;
  flex-direction: column;
}
.kpi-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 0.15rem;
}
.kpi-amount {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}
.kpi-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  font-weight: 500;
}
.kpi-sub.positive {
  color: var(--success);
  font-weight: 600;
}

/* Two-Column Grid Rows */
.grid-2col {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

/* Three-Column Grid Rows */
.grid-3col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

/* Modern Clean Tables & Containers */
.table-responsive,
.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

.table-clean,
.table-container table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  text-align: left;
}

.table-clean th,
.table-container table th {
  background: #f8fafc;
  color: #64748b;
  font-weight: 600;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.table-clean td,
.table-container table td {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
}

.table-clean tr:hover td,
.table-container table tr:hover td {
  background-color: #f8fafc;
}

/* Tabs */
.tab-wrapper {
  margin-bottom: 1.5rem;
}
.tab-header {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 1.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  white-space: nowrap;
}
.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: 0.65rem 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.tab-btn:hover {
  color: var(--text-main);
}
.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Progress Bars */
.progress-bar-wrap {
  width: 100%;
  height: 6px;
  background-color: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background-color: var(--warning);
  border-radius: 999px;
}

.stock-symbol {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}
.stock-symbol:hover {
  text-decoration: underline;
}

.badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
}
.badge-trade {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
}
.badge-trade.buy, .badge-buy {
  background-color: var(--success-light);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.badge-trade.sell, .badge-sell {
  background-color: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.text-neg, .text-danger {
  color: var(--danger);
  font-weight: 600;
}
.text-pos, .text-success {
  color: var(--success);
  font-weight: 600;
}

/* Standard Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}
.btn-primary {
  background-color: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover {
  background-color: #1d4ed8;
  color: #fff;
}
.btn-outline {
  background-color: #fff;
  color: var(--text-main);
  border-color: var(--border-color);
}
.btn-outline:hover {
  background-color: #f8fafc;
  border-color: #cbd5e1;
}
.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
}

/* Buttons */
.btn-primary-blue {
  background-color: var(--primary);
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
}
.btn-primary-blue:hover {
  background-color: #1d4ed8;
  color: #fff;
  text-decoration: none;
}

/* Quick Actions 2x2 Grid */
.quick-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.btn-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-md);
  color: #fff;
  border: none;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.2s ease;
}
.btn-action:hover {
  opacity: 0.92;
  text-decoration: none;
  color: #fff;
}
.btn-action.green { background-color: #10b981; }
.btn-action.blue { background-color: #2563eb; }
.btn-action.purple { background-color: #8b5cf6; }
.btn-action.dark { background-color: #475569; }

/* Target Status Progress Card */
.target-stat-row {
  display: flex;
  justify-content: space-between;
  margin-top: 1.25rem;
}
.target-stat-item {
  text-align: left;
}
.target-stat-item .label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}
.target-stat-item .val {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
}
.target-stat-item .val.green {
  color: var(--success);
}

.bar-wrap-clean {
  width: 100%;
  height: 8px;
  background-color: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin: 0.75rem 0 0.5rem 0;
}
.bar-fill-green {
  height: 100%;
  background-color: var(--success);
  border-radius: 999px;
}

/* Latest Alerts Feed */
.alerts-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.alert-feed-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  gap: 0.5rem;
}
.alert-feed-item .icon-text {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-main);
  font-weight: 500;
}
.alert-feed-item .icon-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
}
.alert-feed-item .icon-circle.green { background: #d1fae5; color: #059669; }
.alert-feed-item .icon-circle.blue { background: #dbeafe; color: #2563eb; }
.alert-feed-item .icon-circle.purple { background: #ede9fe; color: #7c3aed; }
.alert-feed-item .icon-circle.cyan { background: #cffafe; color: #0891b2; }

.alert-feed-item .time {
  color: var(--text-muted);
  font-size: 0.75rem;
  white-space: nowrap;
}

/* Dashboard Footer */
.dashboard-footer {
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-color);
  font-size: 0.78rem;
  color: var(--text-muted);
  background: #ffffff;
}
.dashboard-footer a {
  color: var(--text-muted);
  text-decoration: none;
  margin: 0 0.35rem;
}
.dashboard-footer a:hover {
  text-decoration: underline;
}

/* Donut Chart & Allocation Layout */
.allocation-card-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.5rem 0;
}

.donut-wrapper {
  position: relative;
  width: 190px;
  height: 190px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.donut-wrapper canvas {
  width: 100% !important;
  height: 100% !important;
}

.donut-center-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.donut-center-val {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.donut-center-lbl {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

.allocation-legend {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  flex: 1;
}

.allocation-legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
}

.allocation-legend-item .legend-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--text-main);
}

.allocation-legend-item .legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.allocation-legend-item .legend-pct {
  font-weight: 700;
  color: var(--text-main);
}

/* Performance Line Chart Layout */
.performance-legend {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.performance-legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-square {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}
.legend-square.green { background-color: #10b981; }
.legend-square.blue { background-color: #2563eb; }

.performance-chart-container {
  position: relative;
  height: 220px;
  width: 100%;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

/* Tablets & Small Desktops (<= 1200px) */
@media (max-width: 1200px) {
  .kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-2col {
    grid-template-columns: 1fr;
  }
  .grid-3col {
    grid-template-columns: 1fr;
  }
}

/* Tablets & Mobile Navigation Drawer (<= 900px) */
@media (max-width: 900px) {
  .app-container {
    flex-direction: column;
    min-width: 0;
  }

  /* Off-canvas mobile sidebar drawer */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    height: 100dvh;
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 6px 0 25px rgba(0, 0, 0, 0.4);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .sidebar-close-btn {
    display: flex;
  }

  /* Header controls for mobile */
  .mobile-toggle-btn {
    display: flex;
  }

  .mobile-brand-title {
    display: flex;
  }

  .tagline {
    display: none;
  }

  .top-header {
    padding: 0.75rem 1rem;
  }

  .top-header-right {
    gap: 0.75rem;
  }

  .content-body {
    padding: 1.15rem 1rem;
  }

  .grid-2col {
    grid-template-columns: 1fr;
  }

  .grid-3col {
    grid-template-columns: 1fr;
  }
}

/* Smartphones & Small Screens (<= 640px) */
@media (max-width: 640px) {
  .top-header {
    padding: 0.65rem 0.75rem;
  }

  .content-body {
    padding: 0.75rem 0.65rem;
  }

  /* Compact market status pill */
  .market-status-box .date-text {
    display: none;
  }
  .market-status-box svg {
    display: none;
  }
  .status-pill {
    font-size: 0.7rem;
    padding: 2px 6px;
  }

  .user-info-text {
    display: none;
  }

  .user-avatar {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
  }

  /* Responsive Auto SIP Timer Banner */
  .sip-timer-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
    padding: 0.95rem 0.85rem;
    margin-bottom: 1rem;
  }
  .sip-timer-left {
    gap: 0.85rem;
  }
  .sip-timer-icon-wrap {
    width: 42px;
    height: 42px;
    border-radius: 10px;
  }
  .sip-timer-icon-wrap svg {
    width: 20px;
    height: 20px;
  }
  .sip-timer-title {
    font-size: 0.96rem;
  }
  .timer-countdown-wrap {
    justify-content: center;
    width: 100%;
    padding: 0.55rem 0.5rem;
    gap: 0.3rem;
  }
  .timer-unit-box {
    min-width: 42px;
  }
  .timer-val {
    font-size: 1.25rem;
  }
  .timer-colon {
    font-size: 1.1rem;
    margin-top: -8px;
  }

  /* 2x2 Clean Grid for the 4 KPI stat cards */
  .kpi-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
    margin-bottom: 1rem;
  }

  .kpi-stat-card {
    padding: 0.75rem 0.65rem;
    gap: 0.65rem;
    border-radius: var(--radius-md);
  }

  .kpi-icon-box {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    font-size: 1rem;
  }

  .kpi-icon-box svg {
    width: 20px;
    height: 20px;
  }

  .kpi-label {
    font-size: 0.7rem;
    line-height: 1.2;
    margin-bottom: 0.15rem;
  }

  .kpi-amount {
    font-size: 1.15rem;
    line-height: 1.2;
    word-break: break-word;
  }

  .kpi-sub {
    font-size: 0.68rem;
  }

  /* Stacked Donut Chart & Legend */
  .allocation-card-body {
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    padding: 0.25rem 0;
  }

  .donut-wrapper {
    width: 170px;
    height: 170px;
    margin: 0 auto;
  }

  .allocation-legend {
    width: 100%;
  }

  /* Quick Actions Grid */
  .quick-actions-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .btn-action {
    padding: 0.65rem 0.45rem;
    font-size: 0.78rem;
    text-align: center;
  }

  .btn-action svg {
    flex-shrink: 0;
  }

  /* Cards */
  .card {
    padding: 0.95rem 0.85rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
  }

  .card-header-clean {
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
  }

  .card-header-clean h2,
  .card-header-clean h3 {
    font-size: 0.98rem;
  }

  /* Tables: Touch Horizontal Scroll */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    margin-bottom: 0.5rem;
  }

  .table-clean th,
  .table-clean td {
    padding: 0.55rem 0.6rem;
    font-size: 0.78rem;
  }

  /* Prevent iOS Safari Viewport Auto-Zoom */
  input[type="text"],
  input[type="password"],
  input[type="email"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px !important;
  }

  /* Dashboard Footer */
  .dashboard-footer {
    padding: 1rem 0.75rem;
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
    font-size: 0.74rem;
  }
}

/* Very Narrow Devices (<= 380px) */
@media (max-width: 380px) {
  .kpi-stat-card {
    padding: 0.65rem 0.5rem;
    gap: 0.5rem;
  }

  .kpi-icon-box {
    width: 32px;
    height: 32px;
  }

  .kpi-icon-box svg {
    width: 16px;
    height: 16px;
  }

  .kpi-amount {
    font-size: 1.02rem;
  }

  .kpi-label {
    font-size: 0.67rem;
  }

  .btn-action {
    padding: 0.6rem 0.35rem;
    font-size: 0.72rem;
  }

  .btn-action span {
    font-size: 0.72rem;
  }
}
