/* ==========================================================================
   El-Mouhassib DZ - Stylesheet
   Modern Fintech Design for Algerian E-Commerce Cash On Delivery Calculator
   ========================================================================== */

:root {
  /* Color Palette - Dark Mode Default */
  --bg-main: #0b0f19;
  --bg-card: rgba(18, 24, 38, 0.85);
  --bg-card-hover: rgba(26, 34, 52, 0.95);
  --bg-input: #151d30;
  --bg-accent-soft: rgba(16, 185, 129, 0.12);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #10b981;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --primary: #10b981;       /* Emerald Green - Success & Profit */
  --primary-hover: #059669;
  --primary-light: #34d399;

  --accent-blue: #3b82f6;   /* Ad Spend & Facebook Blue */
  --accent-amber: #f59e0b;  /* Call Center Amber */
  --accent-purple: #8b5cf6; /* Logistics & Delivery Purple */
  --accent-rose: #f43f5e;   /* Return & Damage Red/Rose */

  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #10b981;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 25px rgba(16, 185, 129, 0.25);

  --font-ar: 'Cairo', system-ui, -apple-system, sans-serif;
  --font-en: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme */
[data-theme="light"] {
  --bg-main: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.95);
  --bg-card-hover: #ffffff;
  --bg-input: #f8fafc;
  --bg-accent-soft: rgba(16, 185, 129, 0.08);
  --border-color: #e2e8f0;
  --border-focus: #10b981;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.2);
}

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

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

body {
  font-family: var(--font-ar);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

html[dir="ltr"] body {
  font-family: var(--font-en);
}

/* Background Ambient Glow */
.bg-glow {
  position: fixed;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(140px);
  z-index: -1;
  opacity: 0.15;
}
.bg-glow-1 {
  top: -100px;
  right: -100px;
  background: radial-gradient(circle, var(--primary), transparent 70%);
}
.bg-glow-2 {
  bottom: 10%;
  left: -150px;
  background: radial-gradient(circle, var(--accent-blue), transparent 70%);
}

/* Container */
.container {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.app-header {
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(11, 15, 25, 0.85);
  transition: background-color 0.3s ease;
}
[data-theme="light"] .app-header {
  background-color: rgba(241, 245, 249, 0.9);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

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

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), #059669);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 900;
  font-size: 1.25rem;
  box-shadow: var(--shadow-glow);
}

.brand-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-title {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fff 40%, var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
[data-theme="light"] .brand-title {
  background: linear-gradient(135deg, #0f172a 40%, var(--primary-hover));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Language Selector */
.lang-selector {
  display: flex;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 2px;
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

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

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

/* Preset Bar */
.presets-bar {
  background: rgba(18, 24, 38, 0.4);
  border-bottom: 1px solid var(--border-color);
  padding: 10px 0;
}
[data-theme="light"] .presets-bar {
  background: rgba(248, 250, 252, 0.8);
}

.presets-container {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow-x: auto;
  white-space: nowrap;
  padding-bottom: 4px;
}

.presets-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.presets-list {
  display: flex;
  align-items: center;
  gap: 8px;
}

.preset-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: inherit;
}

.preset-btn:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.preset-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.preset-dot.standard { background-color: var(--primary); }
.preset-dot.high { background-color: var(--accent-purple); }
.preset-dot.low { background-color: var(--accent-amber); }
.preset-dot.bundle { background-color: var(--accent-blue); }

.reset-btn {
  background: transparent;
  color: var(--text-muted);
  border: 1px dashed var(--border-color);
}
.reset-btn:hover {
  color: var(--danger);
  border-color: var(--danger);
}

/* Buttons & Badges */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.86rem;
  font-family: inherit;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #059669);
  color: white;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-dim);
}

.icon-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}
.icon-btn:hover {
  border-color: var(--primary);
}

[data-theme="dark"] .theme-icon-light { display: none; }
[data-theme="dark"] .theme-icon-dark { display: inline-block; }
[data-theme="light"] .theme-icon-dark { display: none; }
[data-theme="light"] .theme-icon-light { display: inline-block; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
}
.badge-accent {
  background: rgba(16, 185, 129, 0.15);
  color: var(--primary-light);
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.badge-outline {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

/* Grid Layout */
.main-content {
  padding: 28px 20px 60px;
}

.calc-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 24px;
  align-items: start;
}

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

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-md);
  margin-bottom: 20px;
  transition: var(--transition);
  overflow: hidden;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}
[data-theme="light"] .card:hover {
  border-color: #cbd5e1;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.border-b-none {
  border-bottom: none;
}

.card-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-icon {
  font-size: 1.3rem;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.icon-emerald { background: rgba(16, 185, 129, 0.15); }
.icon-blue { background: rgba(59, 130, 246, 0.15); }
.icon-amber { background: rgba(245, 158, 11, 0.15); }
.icon-purple { background: rgba(139, 92, 246, 0.15); }
.icon-indigo { background: rgba(99, 102, 241, 0.15); }
.icon-rose { background: rgba(244, 63, 94, 0.15); }

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}
.card-title.text-sm {
  font-size: 0.95rem;
}

.card-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.card-desc.text-xs {
  font-size: 0.72rem;
}

.card-body {
  padding: 20px;
}

/* Form Controls */
.form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}
.form-row:last-child {
  margin-bottom: 0;
}

@media (max-width: 600px) {
  .form-row {
    flex-direction: column;
    gap: 12px;
  }
}

.flex-1 {
  flex: 1;
}

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

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.form-label-sm {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 8px;
  display: block;
}

.tooltip {
  cursor: help;
  font-size: 0.75rem;
  opacity: 0.7;
}

.input-addon {
  display: flex;
  align-items: center;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: var(--transition);
  overflow: hidden;
}

.input-addon:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.input-addon-sm {
  width: 90px;
  flex-shrink: 0;
}

.form-control {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-main);
  padding: 10px 14px;
  font-size: 0.95rem;
  font-weight: 700;
  outline: none;
  font-family: inherit;
}

.addon-text {
  padding: 0 14px;
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 700;
  user-select: none;
}

.select-control {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  padding: 10px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}
.select-control:focus {
  border-color: var(--border-focus);
}

/* Range Slider with Box */
.range-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.range-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  outline: none;
}
.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
  transition: var(--transition);
}
.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

/* Stat Box Inside Form */
.display-stat-box {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.stat-box-title {
  font-size: 0.74rem;
  color: var(--text-muted);
}
.stat-box-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent-blue);
  margin-top: 2px;
}
.stat-box-sub {
  font-size: 0.68rem;
  color: var(--text-dim);
}

/* Shipping Zone Buttons */
.delivery-presets {
  margin-bottom: 16px;
  background: rgba(139, 92, 246, 0.06);
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: var(--radius-md);
  padding: 12px;
}

.zone-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.zone-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}
.zone-btn:hover {
  color: var(--text-main);
  border-color: var(--accent-purple);
}
.zone-btn.active {
  background: rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
  border-color: var(--accent-purple);
}

/* Right Sticky Results Dashboard */
.results-column {
  position: sticky;
  top: 90px;
}

/* Highlight Profit Card */
.highlight-card {
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.15), rgba(18, 24, 38, 0.95) 60%);
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), var(--shadow-glow);
}

.highlight-card.loss-card {
  background: linear-gradient(145deg, rgba(239, 68, 68, 0.15), rgba(18, 24, 38, 0.95) 60%);
  border: 1px solid rgba(239, 68, 68, 0.35);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 25px rgba(239, 68, 68, 0.2);
}

.summary-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.2);
  color: var(--primary-light);
}
.highlight-card.loss-card .summary-status-badge {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.status-indicator-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--primary);
  box-shadow: 0 0 6px var(--primary);
}
.highlight-card.loss-card .status-indicator-dot {
  background-color: var(--danger);
  box-shadow: 0 0 6px var(--danger);
}

.net-margin-tag {
  font-size: 0.84rem;
  color: var(--text-muted);
}
.net-margin-tag strong {
  color: var(--primary-light);
  font-size: 1rem;
}
.highlight-card.loss-card .net-margin-tag strong {
  color: #fca5a5;
}

.hero-profit-section {
  padding: 10px 20px 24px;
}

.hero-label {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 600;
}

.hero-profit-number {
  font-size: 2.8rem;
  font-weight: 900;
  color: var(--primary-light);
  letter-spacing: -1px;
  margin: 4px 0 8px;
  text-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
}
.highlight-card.loss-card .hero-profit-number {
  color: #f87171;
  text-shadow: 0 2px 10px rgba(239, 68, 68, 0.3);
}

.hero-profit-sub {
  font-size: 0.9rem;
  color: var(--text-main);
}
.hero-profit-sub strong {
  color: var(--primary-light);
  font-size: 1.05rem;
}
.highlight-card.loss-card .hero-profit-sub strong {
  color: #f87171;
}

/* Metrics Grid in Hero */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  border-top: 1px solid var(--border-color);
  padding: 16px 20px;
  background: rgba(0, 0, 0, 0.15);
}

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

.metric-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-weight: 600;
}

.metric-val {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 2px;
}

/* Funnel Visual */
.funnel-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.funnel-step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.funnel-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  opacity: 0.12;
  transition: width 0.4s ease;
}
html[dir="ltr"] .funnel-bar {
  right: auto;
  left: 0;
}

.funnel-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  z-index: 1;
}

.funnel-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.funnel-count {
  font-size: 0.92rem;
  font-weight: 800;
}

.funnel-arrow {
  text-align: center;
  font-size: 0.76rem;
  color: var(--text-dim);
  line-height: 1;
}

.funnel-split {
  display: flex;
  gap: 10px;
}

.delivered-box {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.25);
}

.returned-box {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.25);
}

/* Unit Economics Breakdown */
.unit-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.unit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
}

.unit-col-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
}

.unit-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.bg-product { background-color: var(--primary); }
.bg-ads { background-color: var(--accent-blue); }
.bg-delivery { background-color: var(--accent-purple); }
.bg-call { background-color: var(--accent-amber); }
.bg-fixed { background-color: #6366f1; }

.unit-col-val {
  font-weight: 700;
  color: var(--text-main);
}

.unit-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 4px 0;
}

.unit-total-cost, .unit-net-profit {
  font-size: 0.88rem;
  font-weight: 800;
}

/* Break-Even Cards */
.breakeven-card {
  border-color: rgba(244, 63, 94, 0.25);
}

.breakeven-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.be-item {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
}

.be-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  line-height: 1.3;
}

.be-value-wrap {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin: 6px 0 4px;
  flex-wrap: wrap;
}

.be-val {
  font-size: 1.25rem;
  font-weight: 900;
}

.be-val-sub {
  font-size: 0.74rem;
  color: var(--text-dim);
}

.be-tip {
  font-size: 0.67rem;
  color: var(--text-dim);
  line-height: 1.3;
}

/* Chart */
.chart-wrapper {
  position: relative;
  width: 170px;
  height: 170px;
  margin: 0 auto 16px;
}

.donut-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.donut-center-info {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  display: flex;
  flex-direction: column;
}

.donut-center-label {
  font-size: 0.68rem;
  color: var(--text-dim);
  font-weight: 600;
}

.donut-center-val {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--primary-light);
}

.chart-legend {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  font-size: 0.74rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
}
.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

/* Sensitivity Matrix Table */
.matrix-section {
  margin-top: 10px;
}

.table-responsive {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.sensitivity-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  font-size: 0.84rem;
}

.sensitivity-table th,
.sensitivity-table td {
  padding: 10px 12px;
  border: 1px solid var(--border-color);
}

.sensitivity-table th {
  background: var(--bg-input);
  color: var(--text-muted);
  font-weight: 700;
}

.matrix-cell {
  font-weight: 700;
  transition: transform 0.15s ease;
}

.matrix-cell:hover {
  transform: scale(1.05);
  box-shadow: inset 0 0 0 1px white;
}

.matrix-cell.matrix-high {
  background-color: rgba(16, 185, 129, 0.28);
  color: #34d399;
}
.matrix-cell.matrix-med {
  background-color: rgba(16, 185, 129, 0.14);
  color: #6ee7b7;
}
.matrix-cell.matrix-low {
  background-color: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
}
.matrix-cell.matrix-neg {
  background-color: rgba(239, 68, 68, 0.22);
  color: #fca5a5;
}

/* Tips Section */
.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.tip-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
}

.tip-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.tip-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.tip-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Footer */
.app-footer {
  border-top: 1px solid var(--border-color);
  padding: 24px 0;
  background: rgba(11, 15, 25, 0.6);
  font-size: 0.82rem;
  color: var(--text-muted);
}
.footer-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-sub {
  font-size: 0.74rem;
  color: var(--text-dim);
  margin-top: 3px;
}

/* Utility Classes */
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--primary-light) !important; }
.text-warning { color: var(--warning) !important; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.88rem;
  font-weight: 600;
  border: 1px solid var(--primary);
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: var(--transition);
  z-index: 100;
}
html[dir="rtl"] .toast {
  right: auto;
  left: 24px;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Print Only Styles */
.print-only {
  display: none;
}

@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .app-header, .presets-bar, .inputs-column, .tips-section, .matrix-section, .app-footer, .bg-glow {
    display: none !important;
  }
  .main-content {
    padding: 0 !important;
  }
  .calc-grid {
    display: block !important;
  }
  .results-column {
    position: static !important;
  }
  .print-only {
    display: block !important;
    padding: 20px;
  }
  .print-header {
    border-bottom: 2px solid #000;
    padding-bottom: 12px;
    margin-bottom: 20px;
  }
}
