/* ============================================================
   JACOB Web — Style Sheet
   ============================================================ */

/* ============================================================
   Theme Variables
   ============================================================ */
:root {
  --bg: #f8f9fb;
  --bg-gradient: linear-gradient(180deg, #f8f9fb 0%, #eef1f6 100%);
  --surface: #ffffff;
  --border: #e0e6ee;
  --text: #1f2937;
  --text-muted: #6b7280;
  --text-light: #9ca3af;

  --primary: #1a3a6b;
  --primary-light: #2c5aa0;
  --primary-glow: rgba(26,58,107,0.15);

  --accent: #f5a623;
  --accent-deep: #e67e22;
  --accent-glow: rgba(245,166,35,0.2);

  --jacob-bg: #1a3a6b;
  --jacob-text: #ffffff;
  --jacob-val: #f5d78e;
  --jacob-shadow: rgba(26,58,107,0.25);

  --user-bg: linear-gradient(135deg, #f5a623 0%, #e67e22 100%);
  --user-text: #ffffff;
  --user-val: #ffffff;
  --user-shadow: rgba(245,166,35,0.3);

  --stream-line: linear-gradient(180deg, transparent, #d0d7e0 20%, #d0d7e0 80%, transparent);
  --time-text: #6b7280;
  --time-border: #e0e6ee;
  --hover-overlay: rgba(0,0,0,0.5);
}

html[data-theme="dark"] {
  --bg: #0f1419;
  --bg-gradient: linear-gradient(180deg, #0f1419 0%, #0a0e12 100%);
  --surface: #1a1f2e;
  --border: #2d3748;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --text-light: #64748b;

  --primary: #476486;
  --primary-light: #5879a0;
  --primary-glow: rgba(71,100,134,0.35);

  --accent: #c7ae9b;
  --accent-deep: #b09a87;
  --accent-glow: rgba(199,174,155,0.3);

  --jacob-bg: #476486;
  --jacob-text: #ffffff;
  --jacob-val: #f5d78e;
  --jacob-shadow: rgba(71,100,134,0.4);

  --user-bg: #c7ae9b;
  --user-text: #1f2937;
  --user-val: #4b5563;
  --user-shadow: rgba(199,174,155,0.35);

  --stream-line: linear-gradient(180deg, transparent, #2d3748 20%, #2d3748 80%, transparent);
  --time-text: #94a3b8;
  --time-border: #2d3748;
  --hover-overlay: rgba(255,255,255,0.15);
}

/* ============================================================
   Base
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'IBM Plex Sans Arabic', 'Segoe UI', sans-serif;
  background: var(--bg-gradient);
  color: var(--text);
  direction: rtl;
  transition: background 0.4s ease, color 0.4s ease;
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 16px;
}

/* ============================================================
   Top Bar
   ============================================================ */
.topbar {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  gap: 10px;
  align-items: center;
}
.icon-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text);
  padding: 0;
}
.icon-btn:hover {
  transform: scale(1.08);
  border-color: var(--primary);
  box-shadow: 0 6px 20px var(--primary-glow);
}
.icon-btn.hidden { display: none; }

/* ============================================================
   Token Screen
   ============================================================ */
.token-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #1a3a6b 0%, #2c5aa0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.token-screen.hidden { display: none; }
.token-card {
  background: #fff;
  padding: 44px 40px;
  border-radius: 20px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  text-align: center;
}
.token-card .big-logo {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: linear-gradient(135deg, #1a3a6b, #2c5aa0);
  color: #fff;
  font-family: 'Reem Kufi', sans-serif;
  font-size: 36px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 22px;
  box-shadow: 0 8px 24px rgba(26,58,107,0.3);
}
.token-card h1 {
  font-size: 22px;
  margin-bottom: 8px;
  color: #1a3a6b;
  font-weight: 700;
}
.token-card .subtitle {
  font-size: 13.5px;
  color: #6b7280;
  margin-bottom: 28px;
}
.token-card input {
  width: 100%;
  padding: 15px 18px;
  border: 2px solid #e0e6ee;
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  text-align: center;
  direction: ltr;
  letter-spacing: 1px;
}
.token-card input:focus { border-color: #1a3a6b; }
.token-card button {
  width: 100%;
  padding: 15px;
  margin-top: 16px;
  background: linear-gradient(135deg, #1a3a6b, #2c5aa0);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 6px 20px rgba(26,58,107,0.3);
}
.token-card button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(26,58,107,0.4);
}
.token-card button:disabled {
  background: #cbd5e0;
  cursor: not-allowed;
  box-shadow: none;
}
.token-error {
  color: #e74c3c;
  font-size: 13px;
  margin-top: 14px;
  min-height: 18px;
}

/* ============================================================
   Header
   ============================================================ */
.app-header {
  text-align: center;
  padding: 90px 20px 20px;
}
.app-header .brand {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 14px 28px;
  background: var(--surface);
  border-radius: 100px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  border: 1px solid var(--border);
  transition: all 0.3s;
}
.app-header .brand .logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Reem Kufi', sans-serif;
  font-weight: 700;
  font-size: 24px;
  box-shadow: 0 4px 12px var(--primary-glow);
}
.app-header .brand .name {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.5px;
}
.app-header .brand .subtitle {
  font-size: 11.5px;
  color: var(--text-muted);
  letter-spacing: 1.2px;
  margin-top: 2px;
}
.app-header .status-line {
  margin-top: 20px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}
.app-header .status-line .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #27ae60;
  box-shadow: 0 0 0 4px rgba(39,174,96,0.15);
  animation: pulse 2s infinite;
}
.app-header .status-line .dot.offline {
  background: #e74c3c;
  box-shadow: 0 0 0 4px rgba(231,76,60,0.15);
  animation: none;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(39,174,96,0.15); }
  50% { box-shadow: 0 0 0 8px rgba(39,174,96,0.05); }
}

/* ============================================================
   Stream
   ============================================================ */
.stream {
  max-width: 1100px;
  margin: 0 auto;
  padding: 30px 40px 180px;
  position: relative;
  min-height: 60vh;
}
.stream::before {
  content: "";
  position: absolute;
  top: 30px;
  bottom: 180px;
  left: 50%;
  width: 2px;
  background: var(--stream-line);
  transform: translateX(-50%);
  z-index: 0;
}

.time-divider {
  position: relative;
  text-align: center;
  margin: 40px 0 28px;
  z-index: 1;
}
.time-divider span {
  display: inline-block;
  padding: 8px 22px;
  background: var(--surface);
  border: 1px solid var(--time-border);
  border-radius: 100px;
  font-size: 12.5px;
  color: var(--time-text);
  font-weight: 500;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* ============================================================
   Welcome
   ============================================================ */
.welcome {
  text-align: center;
  padding: 60px 20px;
  position: relative;
  z-index: 1;
}
.welcome .big-logo {
  width: 80px;
  height: 80px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  font-family: 'Reem Kufi', sans-serif;
  font-size: 42px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  box-shadow: 0 12px 32px var(--primary-glow);
}
.welcome h2 {
  font-size: 26px;
  color: var(--primary);
  margin-bottom: 10px;
  font-weight: 700;
}
.welcome p {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 30px;
}
.welcome .suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  max-width: 700px;
  margin: 0 auto;
}
.suggestion {
  padding: 12px 20px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 100px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  font-weight: 500;
}
.suggestion:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--primary-glow);
}

/* ============================================================
   Message
   ============================================================ */
.msg {
  position: relative;
  margin: 28px 0;
  padding-bottom: 24px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: msgIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================================
   Avatar
   ============================================================ */
.avatar-wrap {
  position: relative;
  margin-bottom: 14px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 2;
}
.avatar-wrap:hover .avatar-edit { opacity: 1; }
.avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Reem Kufi', sans-serif;
  font-weight: 700;
  font-size: 24px;
  color: #fff;
  border: 4px solid var(--bg);
  position: relative;
  z-index: 2;
  transition: all 0.3s;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.msg.jacob .avatar {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  box-shadow: 0 4px 16px var(--primary-glow);
}
.msg.user .avatar {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  box-shadow: 0 4px 16px var(--accent-glow);
  color: #1f2937;
}
.avatar-edit {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--hover-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 3;
  border: 4px solid transparent;
}

/* Remove photo button */
.avatar-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e74c3c;
  color: #fff;
  border: 2.5px solid var(--bg);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 5;
  padding: 0;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(231,76,60,0.4);
  transition: transform 0.2s;
}
.avatar-remove:hover { transform: scale(1.15); }
.avatar-wrap.has-photo .avatar-remove { display: flex; }

/* ============================================================
   Bubble
   ============================================================ */
.msg .bubble {
  max-width: 90%;
  padding: 24px 32px;
  border-radius: 22px;
  font-size: 16.5px;
  line-height: 1.8;
  text-align: right;
  position: relative;
  word-wrap: break-word;
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}
.msg.jacob .bubble {
  background: var(--jacob-bg);
  color: var(--jacob-text);
  border-radius: 22px 22px 6px 6px;
  box-shadow: 0 8px 28px var(--jacob-shadow);
}
.msg.user .bubble {
  background: var(--user-bg);
  color: var(--user-text);
  border-radius: 22px 22px 6px 6px;
  box-shadow: 0 8px 28px var(--user-shadow);
  font-weight: 500;
}

/* Markdown inside bubble */
/* 🆕 Bold = عنوان فرعي (لون مميز + بولد) */
.msg .bubble strong {
  font-weight: 700;
  color: #ffd66e;
  letter-spacing: 0.2px;
}
.msg.user .bubble strong {
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

/* 🆕 إلغاء الخط المائل تماماً */
.msg .bubble em { font-style: normal; font-weight: 600; opacity: 1; }

/* 🆕 العنوان الرئيسي (h3) — أكبر + خط سفلي */
.msg .bubble h3 {
  font-size: 18px;
  font-weight: 700;
  color: #ffd66e;
  margin: 14px 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  letter-spacing: 0.3px;
}
.msg.user .bubble h3 {
  color: #ffffff;
  border-bottom-color: rgba(0,0,0,0.15);
}
.msg .bubble code {
  background: rgba(255,255,255,0.15);
  padding: 2px 8px;
  border-radius: 6px;
  font-family: 'Consolas', monospace;
  font-size: 0.92em;
  direction: ltr;
  display: inline-block;
}
.msg.user .bubble code { background: rgba(0,0,0,0.08); }
.msg .bubble pre {
  background: rgba(0,0,0,0.25);
  color: #e8f1fb;
  padding: 12px 16px;
  border-radius: 10px;
  margin: 10px 0;
  overflow-x: auto;
  font-family: 'Consolas', monospace;
  font-size: 13px;
  direction: ltr;
  text-align: left;
  line-height: 1.5;
}
.msg.user .bubble pre { background: rgba(0,0,0,0.15); }
.msg .bubble pre code { background: none; padding: 0; }
.msg .bubble ul, .msg .bubble ol { padding-right: 22px; margin: 8px 0; }
.msg .bubble li { margin: 4px 0; }
.msg .bubble a { color: #8ec5ff; text-decoration: underline; }
.msg.user .bubble a { color: #4a5568; }

/* ============================================================
   Time (bottom-left)
   ============================================================ */
.msg .time {
  position: absolute;
  bottom: 0;
  left: 8px;
  font-size: 12px;
  color: var(--text-light);
  letter-spacing: 0.3px;
  opacity: 0.85;
}

/* ============================================================
   Actions (Copy)
   ============================================================ */
.msg .actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  opacity: 0;
  transition: opacity 0.2s;
}
.msg:hover .actions { opacity: 1; }
.action-btn {
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
}
.action-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ============================================================
   Typing Indicator
   ============================================================ */
.typing .bubble {
  display: flex;
  gap: 5px;
  padding: 18px 24px;
  align-items: center;
}
.typing .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--jacob-text);
  opacity: 0.5;
  animation: typing 1.4s infinite;
}
.typing .dot:nth-child(2) { animation-delay: 0.2s; }
.typing .dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-7px); opacity: 1; }
}

/* ============================================================
   Input Area
   ============================================================ */
.input-area {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 18px 20px;
  z-index: 50;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
  backdrop-filter: blur(10px);
}
html[data-theme="dark"] .input-area {
  background: rgba(26,31,46,0.95);
}
.input-box {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  gap: 12px;
  align-items: flex-end;
}
.input-box textarea {
  flex: 1;
  resize: none;
  min-height: 54px;
  max-height: 200px;
  padding: 15px 20px;
  border: 2px solid var(--border);
  border-radius: 14px;
  font-family: inherit;
  font-size: 15.5px;
  outline: none;
  transition: border-color 0.2s;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
}
.input-box textarea:focus { border-color: var(--primary); }
.input-box textarea::placeholder { color: var(--text-light); }
.send-btn {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  box-shadow: 0 4px 12px var(--primary-glow);
}
.send-btn:hover:not(:disabled) {
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--primary-glow);
}
.send-btn:disabled {
  background: #cbd5e0;
  cursor: not-allowed;
  box-shadow: none;
  opacity: 0.6;
}
.input-hint {
  max-width: 1100px;
  margin: 6px auto 0;
  font-size: 11px;
  color: var(--text-light);
  text-align: center;
}
kbd {
  background: var(--bg);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--border);
  font-family: 'Consolas', monospace;
  font-size: 10px;
  color: var(--text-muted);
}

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed;
  top: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--surface);
  color: var(--text);
  padding: 12px 24px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  border: 1px solid var(--border);
  font-size: 14px;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.success { border-right: 4px solid #27ae60; }
.toast.error { border-right: 4px solid #e74c3c; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .stream { padding: 30px 24px 200px; }
  .msg .bubble { max-width: 95%; padding: 20px 24px; font-size: 15.5px; }
}
@media (max-width: 600px) {
  body { font-size: 15px; }
  .topbar { top: 14px; }
  .icon-btn { width: 46px; height: 46px; font-size: 19px; }
  .app-header { padding: 76px 12px 12px; }
  .app-header .brand { padding: 12px 20px; gap: 12px; }
  .app-header .brand .name { font-size: 19px; }
  .app-header .brand .logo { width: 40px; height: 40px; font-size: 20px; }
  .stream { padding: 20px 14px 200px; }
  .msg .bubble { padding: 18px 22px; font-size: 15px; border-radius: 18px; }
  .avatar { width: 52px; height: 52px; font-size: 20px; border-width: 3px; }
  .input-area { padding: 14px 12px; }
  .input-box textarea { padding: 13px 16px; font-size: 15px; min-height: 50px; }
  .send-btn { width: 50px; height: 50px; font-size: 20px; }
  .welcome h2 { font-size: 22px; }
  .welcome .big-logo { width: 68px; height: 68px; font-size: 34px; }
  .suggestion { padding: 10px 16px; font-size: 13px; }
  .token-card { padding: 32px 26px; }
}
/* ============================================================
   🆕 v6.7.0 — Excel Import UI (Drag & Drop + Modal)
   ============================================================ */

/* ─── Drop Overlay ─── */
.drop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 58, 107, 0.85);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.drop-overlay.active {
  display: flex;
  pointer-events: all;
}
.drop-content {
  text-align: center;
  color: #fff;
  padding: 60px 80px;
  border: 3px dashed rgba(255, 255, 255, 0.5);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.05);
  animation: dropPulse 1.5s infinite ease-in-out;
}
.drop-icon {
  font-size: 64px;
  margin-bottom: 16px;
}
.drop-content h2 {
  margin: 0 0 8px 0;
  font-size: 24px;
  font-weight: 700;
}
.drop-content p {
  margin: 0;
  font-size: 15px;
  opacity: 0.8;
}
@keyframes dropPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.02); opacity: 0.95; }
}

/* ─── Import Modal ─── */
.import-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 2100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.import-modal.active {
  display: flex;
}
.import-modal-content {
  background: var(--surface);
  border-radius: 16px;
  max-width: 640px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  animation: modalSlideIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.import-modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.import-modal-header h3 {
  margin: 0;
  font-size: 17px;
  color: var(--primary);
  font-weight: 700;
}
.import-modal-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.import-modal-close:hover {
  background: var(--border);
  color: var(--text);
}

.import-modal-body {
  padding: 18px 22px;
  overflow-y: auto;
  flex: 1;
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.7;
}

/* ─── Import Stats ─── */
.import-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.import-stat:last-of-type {
  border-bottom: none;
}
.import-stat span {
  color: var(--text-muted);
}
.import-stat strong {
  color: var(--primary);
  font-weight: 700;
}

.import-divider {
  height: 1px;
  background: var(--border);
  margin: 14px 0;
}

.import-list-title {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

.import-row {
  display: grid;
  grid-template-columns: 100px 100px 1fr;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg);
  margin-bottom: 6px;
  font-size: 13px;
  align-items: center;
}
.import-row > span:first-child {
  color: var(--text-muted);
  font-size: 12.5px;
}
.import-row > span:nth-child(2) {
  color: var(--accent-deep);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.import-desc {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── Actions ─── */
.import-modal-actions {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.import-btn {
  padding: 11px 20px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  flex: 1;
  min-width: 140px;
}
.import-btn-primary {
  background: linear-gradient(135deg, #27ae60, #229954);
  color: #fff;
  box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}
.import-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(39, 174, 96, 0.4);
}
.import-btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1.5px solid var(--border);
}
.import-btn-secondary:hover {
  background: var(--border);
  transform: translateY(-2px);
}

.import-budget-btn {
  display: block;
  width: 100%;
  padding: 14px 18px;
  margin-bottom: 10px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  text-align: right;
  transition: all 0.2s;
}
.import-budget-btn:hover {
  border-color: var(--primary);
  background: var(--surface);
  color: var(--primary);
  transform: translateX(-4px);
}

.import-loading {
  text-align: center;
  padding: 20px;
  color: var(--primary);
  font-weight: 600;
  font-size: 15px;
  flex: 1;
}

.import-success {
  text-align: center;
  padding: 16px;
  background: #e6f7ed;
  color: #145a32;
  border-radius: 10px;
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 14px;
}

.import-error {
  text-align: center;
  padding: 14px;
  background: #fde8e8;
  color: #7a1c1c;
  border-radius: 10px;
  font-weight: 600;
  margin-bottom: 10px;
  flex: 1;
}

html[data-theme="dark"] .import-success {
  background: #1e3a2a;
  color: #a6e3b8;
}
html[data-theme="dark"] .import-error {
  background: #3a1e1e;
  color: #f5b8b8;
}
html[data-theme="dark"] .import-modal-content {
  background: var(--surface);
}
html[data-theme="dark"] .import-row {
  background: rgba(255, 255, 255, 0.04);
}

/* ─── Responsive ─── */
@media (max-width: 600px) {
  .import-modal-content {
    max-height: 92vh;
    border-radius: 12px;
  }
  .import-modal-header,
  .import-modal-body,
  .import-modal-actions {
    padding-left: 16px;
    padding-right: 16px;
  }
  .import-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .import-row > span:first-child {
    font-size: 11.5px;
  }
  .import-btn {
    min-width: 100px;
    padding: 10px 14px;
    font-size: 14px;
  }
  .drop-content {
    padding: 40px 30px;
  }
  .drop-icon {
    font-size: 48px;
  }
  .drop-content h2 {
    font-size: 20px;
  }
}
/* ============================================================
   🆕 v6.7.0 — Attachments (Excel + Charts) داخل الرسائل
   ============================================================ */

.attachments-charts {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
  width: 100%;
  max-width: 90%;
  animation: msgIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.chart-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s, box-shadow 0.2s;
}
.chart-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.chart-item img {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
}

.chart-caption {
  padding: 10px 14px;
  font-size: 12.5px;
  color: var(--text-muted);
  text-align: center;
  border-top: 1px solid var(--border);
  font-weight: 500;
}

/* ─── زر تحميل Excel ─── */
.attachments-file {
  margin-top: 12px;
  width: 100%;
  max-width: 90%;
  display: flex;
  justify-content: center;
  animation: msgIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(39, 174, 96, 0.3);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 100%;
}
.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(39, 174, 96, 0.45);
  background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
}
.download-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(39, 174, 96, 0.4);
}

.download-icon {
  font-size: 18px;
  line-height: 1;
}

/* ─── Dark Mode ─── */
html[data-theme="dark"] .chart-item {
  background: var(--surface);
  border-color: var(--border);
}
html[data-theme="dark"] .chart-item img {
  background: #fff;
}
html[data-theme="dark"] .chart-caption {
  background: rgba(0, 0, 0, 0.15);
}
html[data-theme="dark"] .download-btn {
  background: linear-gradient(135deg, #1e8449 0%, #145a32 100%);
  box-shadow: 0 4px 14px rgba(30, 132, 73, 0.4);
}
html[data-theme="dark"] .download-btn:hover {
  background: linear-gradient(135deg, #27ae60 0%, #1e8449 100%);
  box-shadow: 0 8px 22px rgba(39, 174, 96, 0.5);
}

/* ─── Responsive ─── */
@media (max-width: 600px) {
  .attachments-charts,
  .attachments-file {
    max-width: 100%;
  }
  .chart-caption {
    font-size: 11.5px;
    padding: 8px 10px;
  }
  .download-btn {
    padding: 12px 18px;
    font-size: 14px;
    width: 100%;
    justify-content: center;
  }
  .download-icon {
    font-size: 16px;
  }
}
/* ============================================================
   Scrollbar
   ============================================================ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 5px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
  background-clip: padding-box;
}
