/* ══════════════════════════════════════════════════════════════
   شركة أبواب اليمامة — Yamamah Brand Identity System v6.0
   Colors extracted from Brand Identity Guide v3 (2025)
   Primary:    #3377BD (Yamamah Blue)  · #CB4C41 (Yamamah Red)
   Secondary:  #1A4A7A (Dark Blue)     · #EBF4FF (Sky Blue)
   Typefaces:  Cairo (Arabic) · Poppins (Latin/data)
   ══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&family=Poppins:wght@400;500;600;700&display=swap');

/* ── Official Brand Tokens ── */
:root {
  /* ── Surfaces (Dark Navy — matches brand PDF cover/cards) ── */
  --bg-primary:   #07111F;
  --bg-secondary: #0C1C30;
  --bg-tertiary:  #112238;
  --bg-input:     #060E1A;
  --bg-card:      #0C1C30;
  --card-bg:      linear-gradient(160deg, #0D1E32 0%, #091628 100%);
  --sidebar-bg:   linear-gradient(180deg, #0C1C30 0%, #07111F 100%);
  --modal-bg:     #0C1C30;

  /* ── Borders ── */
  --border-primary: #1A3358;
  --border-hover:   #3377BD;
  --border-soft:    rgba(51,119,189,.18);

  /* ── Text ── */
  --text-primary:   #EBF4FF;   /* Sky Blue — from brand guide */
  --text-secondary: #A8CDEF;
  --text-muted:     #6A9CBF;
  --text-nav:       #7AAFCE;

  /* ── Brand Colors — EXACT from Brand Guide ── */
  --brand-blue:       #3377BD;   /* Yamamah Blue  RGB 51/119/189 */
  --brand-blue-light: #4A8FCC;
  --brand-blue-pale:  #5DA3D9;
  --brand-blue-dim:   rgba(51,119,189,.12);
  --brand-blue-glow:  rgba(51,119,189,.28);
  --brand-red:        #CB4C41;   /* Yamamah Red   RGB 203/76/65  */
  --brand-red-light:  #DA6058;
  --brand-red-dim:    rgba(203,76,65,.12);
  --brand-dark-blue:  #1A4A7A;   /* Dark Blue secondary */
  --brand-sky:        #EBF4FF;   /* Sky Blue — light bg */

  /* ── Semantic ── */
  --status-green:  #22C55E;
  --status-yellow: #F59E0B;
  --status-red:    #CB4C41;

  /* ── Gradients ── */
  --stat-gradient:      linear-gradient(135deg, #3377BD, #5DA3D9);
  --accent-gradient:    linear-gradient(135deg, #1A4A7A, #3377BD);
  --btn-primary-bg:     linear-gradient(135deg, #1A4A7A, #3377BD);
  --btn-red-bg:         linear-gradient(135deg, #A83830, #CB4C41);
  --nav-active-bg:      linear-gradient(135deg, #1A4A7A, #3377BD);

  /* ── Shadows ── */
  --shadow-sm:   0 1px 4px rgba(0,0,0,.30);
  --shadow-md:   0 4px 16px rgba(0,0,0,.40), 0 1px 4px rgba(0,0,0,.20);
  --shadow-lg:   0 12px 48px rgba(0,0,0,.55), 0 4px 12px rgba(0,0,0,.25);
  --shadow-blue: 0 4px 20px rgba(51,119,189,.30);
  --shadow-red:  0 4px 16px rgba(203,76,65,.30);

  --nav-active-shadow:  0 2px 14px rgba(51,119,189,.35);
  --nav-hover-bg:       rgba(51,119,189,.10);
  --input-focus-shadow: 0 0 0 3px rgba(51,119,189,.20);

  /* ── Gap colours ── */
  --gap-pending-bg:      rgba(203,76,65,.07);
  --gap-pending-border:  #6A2018;
  --gap-answered-bg:     rgba(34,197,94,.05);
  --gap-answered-border: #0A4A28;
  --gap-answer-bg:       #082A18;
  --gap-answer-border:   #0D4224;
  --gap-answer-text:     #5EC89A;

  /* ── Radius ── */
  --r-xs:  4px;
  --r-sm:  8px;
  --r-md:  12px;
  --r-lg:  16px;
  --r-xl:  20px;
  --r-pill: 999px;
}

/* Light Theme — Sky Blue base from Brand Guide */
[data-theme="light"] {
  --bg-primary:   #EBF4FF;   /* Sky Blue */
  --bg-secondary: #FFFFFF;
  --bg-tertiary:  #F5F9FF;
  --bg-input:     #E4EEF8;
  --bg-card:      #FFFFFF;
  --card-bg:      linear-gradient(160deg, #FFFFFF 0%, #F8FBFF 100%);
  --sidebar-bg:   linear-gradient(180deg, #FFFFFF 0%, #EBF4FF 100%);
  --modal-bg:     #FFFFFF;
  --border-primary: #C0D8EE;
  --border-hover:   #3377BD;
  --border-soft:    rgba(51,119,189,.15);
  --text-primary:   #07111F;
  --text-secondary: #1A4A7A;
  --text-muted:     #5A88AA;
  --text-nav:       #3A6080;
  --shadow-sm:   0 1px 3px rgba(7,17,31,.10);
  --shadow-md:   0 4px 16px rgba(7,17,31,.12), 0 1px 4px rgba(7,17,31,.06);
  --shadow-lg:   0 12px 40px rgba(7,17,31,.16), 0 4px 10px rgba(7,17,31,.08);
  --nav-hover-bg: rgba(51,119,189,.08);
  --input-focus-shadow: 0 0 0 3px rgba(51,119,189,.18);
  --brand-blue-dim: rgba(51,119,189,.10);
  --gap-pending-bg:      #FEF0EE;
  --gap-pending-border:  #CB4C41;
  --gap-answered-bg:     #EDFAF4;
  --gap-answered-border: #5EC89A;
  --gap-answer-bg:       #EDFAF4;
  --gap-answer-border:   #5EC89A;
  --gap-answer-text:     #0A4A28;
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
body {
  font-family: 'Cairo', 'Poppins', 'Segoe UI', Tahoma, sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.65;
  background: var(--bg-primary);
  color: var(--text-secondary);
  min-height: 100vh;
  transition: background .3s, color .3s;
  overflow-x: hidden;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
            env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* ══════════════════════════════════════════════════════════════
   LOGIN — Yamamah brand dark blue atmosphere
   ══════════════════════════════════════════════════════════════ */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
}

/* Brand blue radial glow */
#login-screen::before {
  content: '';
  position: absolute;
  top: 35%; left: 50%;
  transform: translate(-50%, -50%);
  width: 700px; height: 700px;
  background: radial-gradient(ellipse at center,
    rgba(51,119,189,.10) 0%,
    rgba(26,74,122,.06) 40%,
    transparent 70%);
  pointer-events: none;
}

/* Red accent bottom strip — echoes brand stationery footer */
#login-screen::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brand-red), #A83830);
}

.login-card {
  position: relative;
  z-index: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-top: 4px solid var(--brand-blue);
  border-radius: var(--r-lg);
  padding: 48px 44px;
  width: 90vw;
  max-width: 400px;
  text-align: center;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(51,119,189,.08);
  animation: login-rise .55s cubic-bezier(.16,1,.3,1) both;
}

@keyframes login-rise {
  from { opacity:0; transform:translateY(28px); }
  to   { opacity:1; transform:translateY(0);    }
}

.login-logo {
  margin-bottom: 14px;
  font-size: 0;
  filter: drop-shadow(0 4px 16px rgba(51,119,189,.30));
  transition: filter .3s;
}
.login-card:hover .login-logo {
  filter: drop-shadow(0 4px 24px rgba(51,119,189,.50));
}

.login-title {
  font-family: 'Cairo', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary) !important;
  margin-bottom: 4px;
  letter-spacing: -.01em;
}

.login-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 32px;
  font-weight: 400;
  letter-spacing: .02em;
}

.login-card input {
  width: 100%;
  padding: 12px 15px;
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: var(--r-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-family: 'Cairo', sans-serif;
  font-weight: 400;
  margin-bottom: 10px;
  text-align: right;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.login-card input:focus {
  border-color: var(--brand-blue);
  box-shadow: var(--input-focus-shadow);
}
.login-card input::placeholder { color: var(--text-muted); }

.btn-login {
  width: 100%;
  padding: 13px;
  background: var(--btn-primary-bg);
  border: none;
  border-radius: var(--r-sm);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Cairo', sans-serif;
  cursor: pointer;
  transition: opacity .2s, box-shadow .2s, transform .15s;
  margin-top: 6px;
  -webkit-appearance: none; appearance: none;
  touch-action: manipulation;
  position: relative; z-index: 10;
  box-shadow: var(--shadow-blue);
}
.btn-login:hover {
  opacity: .92;
  box-shadow: 0 6px 24px rgba(51,119,189,.45);
  transform: translateY(-1px);
}
.btn-login:active { transform: translateY(0); }

.login-error {
  color: var(--brand-red-light);
  font-size: 13px;
  margin-top: 12px;
  min-height: 20px;
  font-weight: 500;
  word-break: break-word;
}

@media(max-width:768px) {
  .login-card { padding: 36px 24px; }
  .btn-login { padding: 16px; font-size: 16px; min-height: 52px; }
  .login-card input { padding: 14px 15px; font-size: 15px; min-height: 48px; }
}

/* ══════════════════════════════════════════════════════════════
   LAYOUT
   ══════════════════════════════════════════════════════════════ */
#main-screen { display: none; }
.sidebar { display: none; }
.content {
  margin-right: 0;
  padding: 26px 30px;
  padding-top: 70px;
  min-height: 100vh;
}

/* ══════════════════════════════════════════════════════════════
   TOP NAVIGATION — Dark navy, Yamamah Blue active, Red accent
   ══════════════════════════════════════════════════════════════ */
.topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9999;
  background: rgba(7,17,31,.96);
  border-bottom: 2px solid var(--brand-red);
  display: flex;
  align-items: center;
  height: 58px;
  padding: 0 22px;
  gap: 0;
  backdrop-filter: blur(16px);
  overflow: visible;
}
[data-theme="light"] .topnav {
  background: rgba(255,255,255,.95);
  border-bottom-color: var(--brand-red);
  box-shadow: 0 1px 0 var(--border-primary), 0 2px 8px rgba(7,17,31,.08);
}

.topnav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 22px;
  flex-shrink: 0;
  cursor: pointer;
  transition: opacity .2s;
}
.topnav-logo:hover { opacity: .82; }
.topnav-logo .name {
  font-family: 'Cairo', sans-serif;
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
}
.topnav-logo .sub { font-size: 10px; color: var(--text-muted); }

.topnav-menu {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  overflow: visible;
  scrollbar-width: none;
}
.topnav-menu::-webkit-scrollbar { display: none; }

.topnav-group { position: relative; z-index: 100; }

.topnav-btn {
  padding: 7px 12px;
  background: none;
  border: none;
  color: var(--text-nav);
  font-size: 13px;
  font-weight: 500;
  font-family: 'Cairo', sans-serif;
  cursor: pointer;
  border-radius: var(--r-xs);
  transition: background .15s, color .15s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
}
.topnav-btn:hover {
  background: var(--nav-hover-bg);
  color: var(--brand-blue-light);
}
.topnav-btn.active {
  background: var(--brand-blue-dim);
  color: var(--brand-blue);
  font-weight: 700;
}
.topnav-btn .arrow { font-size: 7px; opacity: .5; transition: transform .2s; }
.topnav-group:hover .arrow { transform: rotate(180deg); }

.topnav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-top: 2px solid var(--brand-blue);
  border-radius: 0 0 var(--r-md) var(--r-md);
  padding: 6px;
  min-width: 210px;
  box-shadow: var(--shadow-lg);
  z-index: 99999;
  max-height: 70vh;
  overflow-y: auto;
}
.topnav-group:hover .topnav-dropdown { display: block; }

.topnav-dropdown .dd-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--r-xs);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 13px;
  font-family: 'Cairo', sans-serif;
  transition: background .12s, color .12s;
  white-space: nowrap;
}
.topnav-dropdown .dd-item:hover {
  background: var(--nav-hover-bg);
  color: var(--brand-blue-light);
}
.topnav-dropdown .dd-item.active {
  background: var(--brand-blue-dim);
  color: var(--brand-blue);
  font-weight: 600;
}
.topnav-dropdown .dd-section {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 700;
  padding: 10px 12px 4px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.topnav-dropdown .dd-divider {
  height: 1px;
  background: var(--border-primary);
  margin: 4px 0;
}

.topnav-actions {
  display: flex; align-items: center; gap: 6px;
  margin-right: auto; flex-shrink: 0;
}
.topnav-actions button {
  padding: 6px 12px; border: none;
  border-radius: var(--r-xs);
  font-size: 12px; cursor: pointer;
  font-family: 'Cairo', sans-serif;
  transition: all .15s;
}
.topnav-icon-btn {
  background: none; border: none;
  color: var(--text-nav); font-size: 17px;
  cursor: pointer; padding: 7px;
  border-radius: var(--r-xs);
  transition: background .15s, color .15s;
}
.topnav-icon-btn:hover {
  background: var(--nav-hover-bg);
  color: var(--brand-blue);
}

/* Breadcrumb */
.topnav-breadcrumb { display:none; align-items:center; gap:8px; flex:1; }
.topnav-breadcrumb .bc-home {
  background: none; border: none;
  color: var(--text-nav); font-size: 17px;
  cursor: pointer; padding: 4px 8px;
  border-radius: var(--r-xs); transition: all .15s;
}
.topnav-breadcrumb .bc-home:hover {
  background: var(--nav-hover-bg);
  color: var(--brand-blue);
}
.topnav-breadcrumb .bc-sep { color: var(--text-muted); font-size: 12px; }
.topnav-breadcrumb .bc-current { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.topnav.in-module .topnav-menu { display: none; }
.topnav.in-module .topnav-breadcrumb { display: flex; }

/* ══════════════════════════════════════════════════════════════
   APP HOME GRID
   ══════════════════════════════════════════════════════════════ */
.app-grid-page { padding: 32px 40px; padding-top: 84px; min-height: 100vh; }
.app-grid-header { text-align: center; margin-bottom: 36px; }
.app-grid-header h1 {
  font-family: 'Cairo', sans-serif;
  font-size: 28px; font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: -.01em;
}
.app-grid-header p { font-size: 13px; color: var(--text-muted); }

.app-grid-search {
  max-width: 480px;
  margin: 0 auto 34px;
  position: relative;
}
.app-grid-search input {
  width: 100%;
  padding: 12px 20px 12px 48px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-primary);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 14px;
  font-family: 'Cairo', sans-serif;
  outline: none;
  transition: border .2s, box-shadow .2s;
  box-shadow: var(--shadow-sm);
}
[dir="rtl"] .app-grid-search input { padding: 12px 48px 12px 20px; }
.app-grid-search input:focus {
  border-color: var(--brand-blue);
  box-shadow: var(--input-focus-shadow);
}
.app-grid-search .search-icon {
  position: absolute; top: 50%; right: 16px;
  transform: translateY(-50%);
  font-size: 17px; color: var(--text-muted); pointer-events: none;
}
[dir="ltr"] .app-grid-search .search-icon { right: auto; left: 16px; }

.app-section-title {
  font-size: 10px; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .10em;
  margin-bottom: 14px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border-primary);
}
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px; margin-bottom: 36px;
}
.app-tile {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 10px; padding: 20px 12px;
  border-radius: var(--r-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  cursor: pointer;
  transition: border-color .2s, transform .2s, box-shadow .2s;
  position: relative; min-height: 118px;
  box-shadow: var(--shadow-sm);
}
.app-tile:hover {
  border-color: var(--brand-blue);
  transform: translateY(-3px);
  box-shadow: var(--shadow-blue);
}
.app-tile .app-icon {
  width: 52px; height: 52px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: white; flex-shrink: 0;
}
.app-tile .app-name {
  font-size: 12px; font-weight: 700;
  color: var(--text-primary); text-align: center; line-height: 1.3;
}
.app-tile .app-badge {
  position: absolute; top: 8px; left: 8px;
  background: var(--brand-red);
  color: white; font-size: 10px;
  padding: 2px 7px; border-radius: var(--r-pill); font-weight: 700;
}
[dir="rtl"] .app-tile .app-badge { left: auto; right: 8px; }
.app-tile.hidden { display: none; }

@media(max-width:768px) {
  .app-grid { grid-template-columns: repeat(3,1fr); gap: 10px; }
  .app-grid-page { padding: 16px; padding-top: 74px; }
  .app-tile { padding: 14px 8px; min-height: 100px; }
  .app-tile .app-icon { width: 42px; height: 42px; font-size: 22px; }
  .app-tile .app-name { font-size: 11px; }
}

/* ══════════════════════════════════════════════════════════════
   PAGE HEADER
   ══════════════════════════════════════════════════════════════ */
.page-header {
  display: flex; justify-content: space-between;
  align-items: flex-start; margin-bottom: 26px;
}
.page-title {
  font-family: 'Cairo', sans-serif;
  font-size: 22px; font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -.01em;
}
.page-sub { font-size: 13px; color: var(--text-secondary); margin-top: 3px; }

.btn-logout {
  padding: 7px 15px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--r-sm);
  color: var(--text-muted);
  font-size: 13px; font-family: 'Cairo', sans-serif;
  cursor: pointer; transition: all .2s;
}
.btn-logout:hover { border-color: var(--brand-red); color: var(--brand-red-light); }

/* ══════════════════════════════════════════════════════════════
   CARDS
   ══════════════════════════════════════════════════════════════ */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border-primary);
  border-radius: var(--r-md);
  padding: 24px; margin-bottom: 20px;
  transition: background .3s, border .3s;
  box-shadow: var(--shadow-sm);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.card-title {
  font-family: 'Cairo', sans-serif;
  font-size: 15px; font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 8px;
}

/* ══════════════════════════════════════════════════════════════
   STATS — Yamamah Blue gradient numbers
   ══════════════════════════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px; margin-bottom: 22px;
}
.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-top: 3px solid var(--brand-blue);
  border-radius: var(--r-md);
  padding: 20px; text-align: center;
  cursor: default;
  transition: border-color .25s, box-shadow .25s, transform .25s;
  box-shadow: var(--shadow-sm);
}
.stat-card:hover {
  border-color: var(--brand-blue);
  border-top-color: var(--brand-blue-light);
  box-shadow: var(--shadow-blue);
  transform: translateY(-2px);
}
.stat-num {
  font-family: 'Poppins', monospace;
  font-size: 32px; font-weight: 700;
  background: var(--stat-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -.02em; line-height: 1.1;
}
.stat-label { font-size: 13px; color: var(--text-secondary); margin-top: 5px; font-weight: 500; }
.stat-sub   { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ══════════════════════════════════════════════════════════════
   FORMS
   ══════════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 15px; }
.form-label {
  font-size: 13px; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 6px;
  display: block; letter-spacing: .01em;
}
.form-input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: var(--r-sm);
  color: var(--text-primary);
  font-size: 14px; font-family: 'Cairo', sans-serif;
  outline: none;
  transition: border .2s, box-shadow .2s, background .2s;
  text-align: right;
}
.form-input:focus {
  border-color: var(--brand-blue);
  box-shadow: var(--input-focus-shadow);
}
.form-input::placeholder { color: var(--text-muted); }
textarea.form-input { min-height: 120px; resize: vertical; line-height: 1.7; }
select.form-input   { cursor: pointer; }

/* ══════════════════════════════════════════════════════════════
   BUTTONS — Brand Blue primary, Brand Red secondary/danger
   ══════════════════════════════════════════════════════════════ */
.btn-primary {
  padding: 11px 22px;
  background: var(--btn-primary-bg);
  border: none; border-radius: var(--r-sm);
  color: #fff; font-size: 14px; font-weight: 700;
  font-family: 'Cairo', sans-serif;
  cursor: pointer;
  transition: opacity .2s, box-shadow .2s, transform .15s;
  display: inline-flex; align-items: center; gap: 8px;
  box-shadow: var(--shadow-blue);
}
.btn-primary:hover {
  opacity: .90; box-shadow: 0 6px 22px rgba(51,119,189,.45);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.btn-secondary {
  padding: 10px 20px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  font-size: 13px; font-family: 'Cairo', sans-serif;
  cursor: pointer; transition: all .2s;
  display: inline-flex; align-items: center; gap: 7px;
}
.btn-secondary:hover {
  border-color: var(--brand-blue);
  color: var(--brand-blue-light);
  background: var(--brand-blue-dim);
}

.btn-success {
  padding: 10px 20px;
  background: #082A18; border: 1px solid #0D4224;
  border-radius: var(--r-sm); color: #5EC89A;
  font-size: 13px; font-family: 'Cairo', sans-serif;
  cursor: pointer; transition: all .2s;
  display: inline-flex; align-items: center; gap: 7px;
}
.btn-success:hover { background: #0D4224; }

.btn-danger {
  padding: 10px 20px;
  background: rgba(203,76,65,.10);
  border: 1px solid rgba(203,76,65,.25);
  border-radius: var(--r-sm); color: var(--brand-red-light);
  font-size: 13px; font-family: 'Cairo', sans-serif;
  cursor: pointer; transition: all .2s;
  display: inline-flex; align-items: center; gap: 7px;
}
.btn-danger:hover { background: rgba(203,76,65,.20); border-color: var(--brand-red); }

.btn-warning {
  padding: 10px 20px;
  background: rgba(245,158,11,.08);
  border: 1px solid rgba(245,158,11,.25);
  border-radius: var(--r-sm); color: #F59E0B;
  font-size: 13px; font-family: 'Cairo', sans-serif;
  cursor: pointer; transition: all .2s;
  display: inline-flex; align-items: center; gap: 7px;
}
.btn-warning:hover { background: rgba(245,158,11,.16); }

.btn-sm    { padding: 6px 14px; font-size: 12px; border-radius: var(--r-xs); }
.btn-icon  { background: none; border: none; cursor: pointer; font-size: 15px; padding: 5px 8px; border-radius: var(--r-xs); transition: background .15s; }
.btn-icon:hover { background: var(--bg-tertiary); }
.btn-del  { color: var(--brand-red-light); }
.btn-view { color: var(--brand-blue-light); }
.btn-edit { color: #5EC89A; }

.btn-send {
  padding: 10px 20px;
  background: var(--btn-primary-bg);
  border: none; border-radius: var(--r-sm);
  color: #fff; font-size: 13px; font-weight: 700;
  font-family: 'Cairo', sans-serif;
  cursor: pointer; white-space: nowrap;
  transition: opacity .2s, box-shadow .2s;
  display: flex; align-items: center; gap: 6px;
  box-shadow: var(--shadow-blue);
}
.btn-send:hover { opacity: .88; box-shadow: 0 6px 20px rgba(51,119,189,.45); }
.btn-send:disabled { opacity: .45; cursor: not-allowed; }

/* ══════════════════════════════════════════════════════════════
   MESSAGES
   ══════════════════════════════════════════════════════════════ */
.success-msg {
  background: #082A18; border: 1px solid #0D4224;
  border-radius: var(--r-sm); padding: 12px 16px;
  color: #5EC89A; font-size: 13px; margin-top: 12px; display: none;
}
.error-msg {
  background: rgba(203,76,65,.10); border: 1px solid rgba(203,76,65,.25);
  border-radius: var(--r-sm); padding: 12px 16px;
  color: var(--brand-red-light); font-size: 13px; margin-top: 12px; display: none;
}
.info-msg {
  background: var(--brand-blue-dim); border: 1px solid var(--border-soft);
  border-radius: var(--r-sm); padding: 12px 16px;
  color: var(--brand-blue-pale); font-size: 13px;
}
.tip {
  background: rgba(51,119,189,.08); border: 1px solid rgba(51,119,189,.20);
  border-radius: var(--r-sm); padding: 12px 16px;
  font-size: 13px; color: var(--brand-blue-light);
  margin-bottom: 14px; line-height: 1.6;
}

/* ══════════════════════════════════════════════════════════════
   TABLES
   ══════════════════════════════════════════════════════════════ */
.table-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  border-radius: var(--r-sm);
}
table { width: 100%; border-collapse: collapse; table-layout: auto; }

th {
  text-align: right; padding: 10px 14px;
  font-size: 11px; font-weight: 700;
  color: var(--text-muted);
  border-bottom: 2px solid var(--brand-blue);
  background: var(--bg-secondary);
  letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
}
td {
  padding: 11px 14px; font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-primary);
  vertical-align: middle; line-height: 1.5;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(51,119,189,.05); }
tbody tr:nth-child(even) td { background: rgba(255,255,255,.013); }
tbody tr:nth-child(even):hover td { background: rgba(51,119,189,.05); }

.data-table { width: 100%; border-collapse: collapse; table-layout: auto; }
.data-table thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--bg-secondary);
  border-bottom: 2px solid var(--brand-blue);
}
.data-table td { white-space: normal; word-break: break-word; }
.data-table td:has(button) { white-space: nowrap; }

/* ── Badges ── */
.badge {
  padding: 3px 10px; border-radius: var(--r-pill);
  font-size: 11px; font-weight: 700;
  white-space: nowrap; display: inline-block; line-height: 1.5;
}
.badge-green  { background: #082A18; color: #5EC89A; }
.badge-blue   { background: var(--brand-blue-dim); color: var(--brand-blue-pale); }
.badge-purple { background: rgba(120,80,200,.12); color: #C4A8F8; }
.badge-orange { background: rgba(245,158,11,.10); color: #F59E0B; }
.badge-red    { background: var(--brand-red-dim); color: var(--brand-red-light); }
.badge-yellow { background: rgba(245,158,11,.10); color: #FBBF24; }
.badge-gray   { background: var(--bg-tertiary); color: var(--text-muted); border: 1px solid var(--border-primary); }

/* ══════════════════════════════════════════════════════════════
   TABS
   ══════════════════════════════════════════════════════════════ */
.tab { display: none; }
.tab.active { display: block; }

/* ══════════════════════════════════════════════════════════════
   LOADING
   ══════════════════════════════════════════════════════════════ */
.loading { text-align: center; padding: 40px; color: var(--text-muted); font-size: 13px; }
.spinner {
  display: inline-block;
  width: 17px; height: 17px;
  border: 2px solid var(--border-primary);
  border-top-color: var(--brand-blue);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: middle; margin-left: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }
@keyframes pulse-dot { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.5;transform:scale(1.4)} }
@keyframes blue-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(51,119,189,.4); }
  50%      { box-shadow: 0 0 0 5px rgba(51,119,189,.0); }
}

/* ══════════════════════════════════════════════════════════════
   PAGINATION
   ══════════════════════════════════════════════════════════════ */
.pagination {
  display: flex; align-items: center; gap: 6px;
  margin-top: 14px; justify-content: center; flex-wrap: wrap;
}
.page-btn {
  padding: 6px 13px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--r-xs); color: var(--text-secondary);
  font-size: 13px; font-family: 'Cairo', sans-serif;
  cursor: pointer; transition: all .2s;
}
.page-btn:hover { border-color: var(--brand-blue); color: var(--brand-blue); }
.page-btn.active {
  background: var(--brand-blue-dim);
  border-color: var(--brand-blue);
  color: var(--brand-blue); font-weight: 700;
}
.page-btn:disabled { opacity: .35; cursor: not-allowed; }
.page-info { font-size: 12px; color: var(--text-muted); }

/* ══════════════════════════════════════════════════════════════
   MODAL — Red top accent (Yamamah Red header bar)
   ══════════════════════════════════════════════════════════════ */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.72);
  z-index: 100; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--modal-bg);
  border: 1px solid var(--border-primary);
  border-top: 3px solid var(--brand-red);
  border-radius: var(--r-lg);
  width: 100%; max-width: 700px;
  max-height: 88vh;
  display: flex; flex-direction: column;
  overflow: hidden; transition: background .3s;
  box-shadow: var(--shadow-lg);
}
.modal-lg { max-width: 860px; }

.modal-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-primary); gap: 16px;
}
.modal-title {
  font-family: 'Cairo', sans-serif;
  font-size: 16px; font-weight: 800;
  color: var(--text-primary); line-height: 1.4;
}
.modal-close {
  background: none; border: none; color: var(--text-muted);
  font-size: 20px; cursor: pointer; padding: 3px 7px;
  border-radius: var(--r-xs); flex-shrink: 0; transition: all .15s;
}
.modal-close:hover { background: var(--bg-tertiary); color: var(--brand-red-light); }
.modal-body { padding: 22px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 14px 22px; border-top: 1px solid var(--border-primary);
  display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap;
}
.modal-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.modal-meta-item {
  font-size: 11px; color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 3px 10px; border-radius: var(--r-pill);
}

/* ══════════════════════════════════════════════════════════════
   CHAT
   ══════════════════════════════════════════════════════════════ */
.chat-wrap { display: flex; flex-direction: column; gap: 10px; }
.chat-msg { display: flex; flex-direction: column; max-width: 80%; }
.chat-msg.customer    { align-self: flex-end;   align-items: flex-end;   }
.chat-msg.agent       { align-self: flex-start; align-items: flex-start; }
.chat-msg.admin-reply { align-self: flex-start; align-items: flex-start; }
.chat-msg.system      { align-self: center;     align-items: center; max-width: 90%; }

.chat-bubble {
  padding: 10px 14px; border-radius: var(--r-md);
  font-size: 13px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
}
.chat-msg.customer   .chat-bubble { background: rgba(26,74,122,.35); color: var(--brand-sky); border-bottom-right-radius: 4px; }
.chat-msg.agent      .chat-bubble { background: var(--bg-tertiary); color: var(--text-secondary); border: 1px solid var(--border-primary); border-bottom-left-radius: 4px; }
.chat-msg.admin-reply.chat-bubble { background: rgba(94,200,154,.10); color: #5EC89A; border: 1px solid rgba(94,200,154,.2); border-bottom-left-radius: 4px; }
.chat-msg.system     .chat-bubble { background: var(--bg-tertiary); color: var(--text-muted); font-size: 11px; border-radius: var(--r-xs); text-align: center; border: 1px solid var(--border-primary); }
.chat-time { font-size: 10px; color: var(--text-muted); margin-top: 3px; }

.reply-box { border-top: 1px solid var(--border-primary); padding: 14px; background: var(--bg-secondary); }
.reply-box-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.reply-box-title { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.reply-takeover-hint { font-size: 11px; color: var(--text-muted); }
.reply-input-row { display: flex; gap: 8px; align-items: flex-end; }
.reply-input-row textarea {
  flex: 1; background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: var(--r-sm); color: var(--text-primary);
  font-size: 13px; padding: 9px 13px; outline: none;
  resize: none; font-family: 'Cairo', sans-serif;
  line-height: 1.6; min-height: 42px; max-height: 120px;
  transition: border .2s; text-align: right; direction: rtl;
}
.reply-input-row textarea:focus { border-color: var(--brand-blue); }
.reply-status { font-size: 11px; margin-top: 5px; min-height: 16px; }
.reply-status.ok  { color: #5EC89A; }
.reply-status.err { color: var(--brand-red-light); }

/* ══════════════════════════════════════════════════════════════
   WORKFLOW
   ══════════════════════════════════════════════════════════════ */
.wf-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--r-md); padding: 18px; margin-bottom: 12px;
  position: relative; transition: border .2s;
  box-shadow: var(--shadow-sm);
}
.wf-card:hover { border-color: var(--brand-blue); }
.wf-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.wf-name { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.wf-steps { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.wf-step {
  background: var(--bg-tertiary); border: 1px solid var(--border-primary);
  border-radius: var(--r-sm); padding: 10px 13px;
  display: flex; align-items: flex-start; gap: 10px;
}
.wf-step-num {
  background: var(--btn-primary-bg); color: #fff;
  width: 22px; height: 22px; border-radius: 4px;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 1px;
}
.wf-step-q { font-size: 13px; color: var(--text-primary); flex: 1; line-height: 1.5; }
.wf-step-field { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.wf-kw { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.wf-kw span { background: var(--brand-blue-dim); color: var(--brand-sky); padding: 2px 9px; border-radius: var(--r-pill); font-size: 11px; }
.add-step-btn {
  background: var(--bg-tertiary); border: 1px dashed var(--border-primary);
  border-radius: var(--r-sm); padding: 9px; text-align: center;
  cursor: pointer; color: var(--text-muted); font-size: 12px;
  transition: all .2s; font-family: 'Cairo', sans-serif;
}
.add-step-btn:hover { border-color: var(--brand-blue); color: var(--brand-blue); }
.steps-editor { display: flex; flex-direction: column; gap: 8px; }
.step-row { display: flex; gap: 8px; align-items: center; }
.step-row .form-input { flex: 1; padding: 8px 12px; }
.remove-step { background: none; border: none; color: var(--brand-red-light); cursor: pointer; font-size: 18px; padding: 0 4px; border-radius: var(--r-xs); }
.remove-step:hover { background: var(--brand-red-dim); }

/* ══════════════════════════════════════════════════════════════
   IMPORT / EXPORT
   ══════════════════════════════════════════════════════════════ */
.export-btns { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.drop-zone {
  border: 2px dashed var(--border-primary);
  border-radius: var(--r-md); padding: 42px; text-align: center;
  cursor: pointer; transition: all .2s; background: var(--bg-secondary);
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--brand-blue);
  background: var(--brand-blue-dim);
}
.drop-zone-icon { font-size: 36px; margin-bottom: 10px; }
.drop-zone-text { font-size: 14px; color: var(--text-secondary); margin-bottom: 5px; }
.drop-zone-sub  { font-size: 12px; color: var(--text-muted); }
#file-input { display: none; }
.format-sample {
  background: var(--bg-secondary); border: 1px solid var(--border-primary);
  border-radius: var(--r-sm); padding: 12px 16px;
  font-family: 'Poppins', monospace; font-size: 11px;
  color: var(--brand-blue-pale); overflow-x: auto; margin-top: 8px;
  white-space: pre; line-height: 1.7;
}
.import-preview { margin-top: 18px; }
.preview-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.preview-table-wrap { max-height: 300px; overflow-y: auto; border: 1px solid var(--border-primary); border-radius: var(--r-sm); }
.import-result { margin-top: 14px; border-radius: var(--r-sm); padding: 14px; }
.import-result.success-bg { background: #082A18; border: 1px solid #0D4224; }
.import-result.error-bg   { background: var(--brand-red-dim); border: 1px solid rgba(203,76,65,.25); }
.result-row { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 3px 0; }
.progress-bar-wrap { background: var(--bg-primary); border-radius: 99px; height: 5px; overflow: hidden; margin-top: 8px; }
.progress-bar { height: 100%; background: var(--btn-primary-bg); border-radius: 99px; transition: width .3s; }
.example-item {
  background: var(--bg-secondary); border: 1px solid var(--border-primary);
  border-radius: var(--r-sm); padding: 11px; cursor: pointer;
  font-size: 13px; color: var(--text-muted);
  transition: all .2s;
}
.example-item:hover { border-color: var(--brand-blue); color: var(--text-primary); }

/* ══════════════════════════════════════════════════════════════
   SETTINGS
   ══════════════════════════════════════════════════════════════ */
.settings-section { margin-bottom: 26px; }
.settings-section .card-title { margin-bottom: 14px; }
.setting-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 14px 0; border-bottom: 1px solid var(--border-primary); gap: 20px;
}
.setting-row:last-child { border-bottom: none; padding-bottom: 0; }
.setting-label { font-size: 15px; color: var(--text-primary); font-weight: 600; }
.setting-desc  { font-size: 13px; color: var(--text-secondary); margin-top: 3px; }
.setting-control { flex-shrink: 0; }

.toggle { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--bg-tertiary); border: 1px solid var(--border-primary);
  border-radius: var(--r-pill); transition: .2s;
}
.toggle-slider:before {
  position: absolute; content: "";
  height: 16px; width: 16px; right: 3px; bottom: 3px;
  background: var(--text-muted); border-radius: 50%; transition: .2s;
}
.toggle input:checked + .toggle-slider {
  background: var(--brand-blue-dim);
  border-color: var(--brand-blue);
}
.toggle input:checked + .toggle-slider:before {
  transform: translateX(-20px);
  background: var(--brand-blue);
}

.theme-toggle {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--r-sm); color: var(--text-nav);
  font-size: 13px; cursor: pointer; transition: all .2s;
  width: 100%; justify-content: center;
  margin-bottom: 8px; font-family: 'Cairo', sans-serif;
}
.theme-toggle:hover { border-color: var(--brand-blue); color: var(--brand-blue); }

/* ══════════════════════════════════════════════════════════════
   KPI DEPARTMENT CARDS
   ══════════════════════════════════════════════════════════════ */
.kpi-dept-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--r-md); padding: 15px;
  cursor: pointer; transition: all .25s;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.kpi-dept-card:hover {
  border-color: var(--brand-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-blue);
}
.kpi-dept-card .kpi-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.kpi-dept-card .kpi-icon   { font-size: 20px; }
.kpi-dept-card .kpi-name   { font-size: 13px; font-weight: 700; color: var(--text-primary); flex: 1; }
.kpi-dept-card .kpi-status { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.kpi-dept-card .kpi-status.online  { background: #22C55E; animation: blue-pulse 2.5s infinite; }
.kpi-dept-card .kpi-status.warning { background: #F59E0B; }
.kpi-dept-card .kpi-status.offline { background: var(--brand-red); }
.kpi-dept-card .kpi-status.unknown { background: var(--text-muted); }
.kpi-dept-card .kpi-metrics { display: flex; gap: 10px; flex-wrap: wrap; }
.kpi-dept-card .kpi-metric  { flex: 1; min-width: 55px; }
.kpi-dept-card .kpi-val {
  font-family: 'Poppins', sans-serif;
  font-size: 20px; font-weight: 700;
  background: var(--stat-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.kpi-dept-card .kpi-lbl { font-size: 10px; color: var(--text-muted); }
.kpi-dept-card .kpi-bar { height: 3px; background: var(--border-primary); border-radius: 99px; margin-top: 10px; overflow: hidden; }
.kpi-dept-card .kpi-bar-fill { height: 100%; border-radius: 99px; transition: width .6s ease; }

/* ══════════════════════════════════════════════════════════════
   AGENT LIVE FEED
   ══════════════════════════════════════════════════════════════ */
.alf-card {
  flex-shrink: 0; width: 166px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--r-md); padding: 11px;
  transition: transform .15s, box-shadow .15s;
}
.alf-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* ══════════════════════════════════════════════════════════════
   FIELD SERVICE
   ══════════════════════════════════════════════════════════════ */
.fs-toolbar { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:14px; }
.fs-view-switcher {
  display:flex; gap:2px; background: var(--bg-secondary);
  border-radius: var(--r-sm); padding:3px;
  border: 1px solid var(--border-primary);
}
.fs-view-btn {
  padding: 7px 13px; border: none; background: none;
  color: var(--text-muted); font-size: 13px; cursor: pointer;
  border-radius: var(--r-xs); transition: all .15s;
  font-family: 'Cairo', sans-serif;
  display: flex; align-items: center; gap: 5px; white-space: nowrap;
}
.fs-view-btn:hover { color: var(--brand-blue-light); background: var(--brand-blue-dim); }
.fs-view-btn.active {
  background: var(--btn-primary-bg); color: #fff;
  box-shadow: var(--shadow-blue);
}
.cfo-subnav {
  padding: 7px 13px; border: none; background: none;
  color: var(--text-muted); font-size: 13px; cursor: pointer;
  border-radius: var(--r-xs); transition: all .15s;
  font-family: 'Cairo', sans-serif; white-space: nowrap;
}
.cfo-subnav:hover { color: var(--brand-blue-light); background: var(--brand-blue-dim); }
.cfo-subnav.active {
  background: var(--btn-primary-bg); color: #fff;
  box-shadow: var(--shadow-blue);
}
.cfo-page { display:none; }
.cfo-page.active { display:block; }
.fs-filters { display:flex; gap:8px; flex-wrap:wrap; align-items:center; flex:1; }
.fs-filters select, .fs-filters input {
  padding: 7px 11px; border: 1px solid var(--border-primary);
  border-radius: var(--r-sm); font-size: 12px;
  background: var(--bg-input); color: var(--text-primary);
  font-family: 'Cairo', sans-serif; min-width: 100px;
  outline: none; transition: border .2s;
}
.fs-filters select:focus, .fs-filters input:focus { border-color: var(--brand-blue); }
.fs-filters input[type="text"] { min-width: 180px; }
.fs-actions { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:14px; }
.fs-view-container { display:none; }
.fs-view-container.active { display:block; }

/* Calendar */
.fs-cal { border: 1px solid var(--border-primary); border-radius: var(--r-md); overflow: hidden; background: var(--bg-secondary); }
.fs-cal-header { display:flex; align-items:center; justify-content:space-between; padding:12px 15px; background: var(--bg-tertiary); border-bottom: 1px solid var(--border-primary); }
.fs-cal-header h3 { font-size:15px; font-weight:700; color: var(--text-primary); margin:0; font-family:'Cairo',sans-serif; }
.fs-cal-header button { background:none; border: 1px solid var(--border-primary); color: var(--text-primary); padding:5px 12px; border-radius: var(--r-xs); cursor:pointer; font-family:'Cairo',sans-serif; font-size:12px; transition:all .15s; }
.fs-cal-header button:hover { border-color: var(--brand-blue); color: var(--brand-blue); }
.fs-cal-grid { display:grid; grid-template-columns:repeat(7,1fr); }
.fs-cal-day-header { padding:8px; text-align:center; font-size:10px; font-weight:700; color: var(--text-muted); background: var(--bg-tertiary); border-bottom: 1px solid var(--border-primary); }
.fs-cal-cell { min-height:110px; padding:5px; border: 1px solid var(--border-primary); border-top:0; position:relative; }
.fs-cal-cell.other-month { opacity:.35; }
.fs-cal-cell.today { background: rgba(51,119,189,.05); }
.fs-cal-date { font-family:'Poppins',sans-serif; font-size:11px; color: var(--text-primary); margin-bottom:4px; }
.fs-cal-task { font-size:10px; padding:2px 6px; border-radius: var(--r-pill); margin-bottom:2px; cursor:pointer; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; transition:opacity .15s; }
.fs-cal-task:hover { opacity:.75; }
.fs-cal-task.inst  { background: var(--brand-blue-dim); color: var(--brand-sky); }
.fs-cal-task.maint { background: var(--brand-red-dim); color: var(--brand-red-light); }
.fs-cal-more { font-size:10px; color: var(--brand-blue); cursor:pointer; padding:2px 0; }
.fs-cal-more:hover { text-decoration:underline; }
.fs-map-wrap { display:flex; gap:0; border: 1px solid var(--border-primary); border-radius: var(--r-md); overflow:hidden; height:600px; }
.fs-map-sidebar { width:270px; overflow-y:auto; background: var(--bg-secondary); border-left: 1px solid var(--border-primary); flex-shrink:0; }
.fs-map-sidebar .sb-item { padding:9px 13px; border-bottom: 1px solid var(--border-primary); cursor:pointer; font-size:12px; transition:background .15s; }
.fs-map-sidebar .sb-item:hover { background: var(--brand-blue-dim); }
.fs-map-sidebar .sb-item.active { background: var(--brand-blue-dim); border-right:3px solid var(--brand-blue); }
.fs-map-sidebar .sb-count { font-size:11px; color: var(--text-muted); padding:9px 13px; background: var(--bg-tertiary); font-weight:700; border-bottom: 1px solid var(--border-primary); }
#fs-map { flex:1; min-height:400px; z-index:1; }
.fs-gantt { border: 1px solid var(--border-primary); border-radius: var(--r-md); overflow-x:auto; background: var(--bg-secondary); }
.fs-gantt-header { display:flex; background: var(--bg-tertiary); border-bottom: 1px solid var(--border-primary); position:sticky; top:0; z-index:2; }
.fs-gantt-label  { width:180px; min-width:180px; padding:9px 13px; font-size:10px; font-weight:700; color: var(--text-muted); border-left: 1px solid var(--border-primary); flex-shrink:0; text-transform:uppercase; letter-spacing:.06em; }
.fs-gantt-hours  { display:flex; flex:1; }
.fs-gantt-hour   { width:80px; min-width:80px; padding:7px 0; text-align:center; font-size:10px; color: var(--text-muted); border-left: 1px solid var(--border-primary); font-family:'Poppins',sans-serif; }
.fs-gantt-row    { display:flex; border-bottom: 1px solid var(--border-primary); min-height:48px; position:relative; }
.fs-gantt-row:hover { background: rgba(51,119,189,.04); }
.fs-gantt-name   { width:180px; min-width:180px; padding:9px 13px; font-size:12px; color: var(--text-primary); border-left: 1px solid var(--border-primary); display:flex; align-items:center; gap:6px; flex-shrink:0; }
.fs-gantt-track  { display:flex; flex:1; position:relative; }
.fs-gantt-slot   { width:80px; min-width:80px; border-left: 1px solid var(--border-primary); }
.fs-gantt-bar    { position:absolute; top:7px; height:32px; border-radius: var(--r-sm); font-size:10px; color:#fff; display:flex; align-items:center; padding:0 8px; cursor:pointer; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; transition:opacity .15s; z-index:1; }
.fs-gantt-bar:hover { opacity:.82; }
.fs-gantt-bar.inst  { background: var(--btn-primary-bg); }
.fs-gantt-bar.maint { background: var(--btn-red-bg); }
.fs-kanban { display:flex; gap:12px; overflow-x:auto; padding-bottom:10px; }
.fs-kanban-col { min-width:270px; max-width:310px; flex-shrink:0; background: var(--bg-secondary); border: 1px solid var(--border-primary); border-radius: var(--r-md); overflow:hidden; }
.fs-kanban-col-header { padding:11px 13px; font-size:13px; font-weight:700; color: var(--text-primary); border-bottom: 1px solid var(--border-primary); display:flex; justify-content:space-between; align-items:center; }
.fs-kanban-col-header .count { background: var(--bg-tertiary); padding:2px 9px; border-radius: var(--r-pill); font-size:10px; color: var(--text-muted); }
.fs-kanban-body { padding:9px; max-height:500px; overflow-y:auto; display:flex; flex-direction:column; gap:7px; }
.fs-kanban-card { background: var(--bg-tertiary); border: 1px solid var(--border-primary); border-radius: var(--r-sm); padding:11px; cursor:grab; transition:all .15s; }
.fs-kanban-card:active { cursor:grabbing; }
.fs-kanban-card:hover { border-color: var(--brand-blue); transform:translateY(-1px); box-shadow: var(--shadow-md); }
.fs-kanban-card.dragging { opacity:.4; border:2px dashed var(--brand-blue); }
.fs-kanban-body.drag-over { background: var(--brand-blue-dim); border:2px dashed var(--brand-blue); border-radius: var(--r-sm); min-height:80px; }
.fs-kanban-drop-indicator { height:3px; background: var(--brand-blue); border-radius: var(--r-pill); margin:4px 0; }
.fs-kanban-card .kc-title  { font-size:12px; font-weight:700; color: var(--text-primary); margin-bottom:5px; }
.fs-kanban-card .kc-client { font-size:11px; color: var(--text-secondary); margin-bottom:4px; }
.fs-kanban-card .kc-meta   { display:flex; gap:7px; flex-wrap:wrap; align-items:center; font-size:10px; color: var(--text-muted); }
.fs-kanban-card .kc-badge  { padding:2px 8px; border-radius: var(--r-pill); font-size:10px; color:#fff; font-weight:700; }
.fs-kanban-card .kc-badge.inst  { background: var(--brand-blue); }
.fs-kanban-card .kc-badge.maint { background: var(--brand-red); }
.fs-detail-modal { display:none; position:fixed; inset:0; background:rgba(0,0,0,.65); z-index:10001; justify-content:center; align-items:center; }
.fs-detail-panel { background: var(--bg-secondary); border-radius: var(--r-lg); padding:26px; max-width:680px; width:92%; max-height:85vh; overflow-y:auto; border: 1px solid var(--border-primary); border-top:3px solid var(--brand-blue); box-shadow: var(--shadow-lg); }
.fs-detail-header { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:18px; }
.fs-detail-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.fs-detail-field { background: var(--bg-tertiary); padding:10px 13px; border-radius: var(--r-sm); }
.fs-detail-field .label { font-size:10px; color: var(--text-muted); margin-bottom:2px; text-transform:uppercase; letter-spacing:.06em; }
.fs-detail-field .value { font-size:13px; color: var(--text-primary); font-weight:500; }

/* RTL fixes */
[dir="rtl"] .fs-map-sidebar { border-left:none; border-right: 1px solid var(--border-primary); }
[dir="rtl"] .fs-map-sidebar .sb-item.active { border-right:none; border-left:3px solid var(--brand-blue); }
[dir="rtl"] .fs-gantt-label, [dir="rtl"] .fs-gantt-hour, [dir="rtl"] .fs-gantt-name, [dir="rtl"] .fs-gantt-slot { border-left:none; border-right: 1px solid var(--border-primary); }

/* ══════════════════════════════════════════════════════════════
   RELAY / GAP / CEO DRAG
   ══════════════════════════════════════════════════════════════ */
.relay-card { background: var(--bg-secondary); border: 1px solid var(--border-primary); border-radius: var(--r-md); padding:14px; display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.relay-card:hover { border-color: var(--brand-blue); }
.relay-info { flex:1; }
.relay-name   { font-size:13px; font-weight:700; color: var(--text-primary); }
.relay-detail { font-size:11px; color: var(--text-muted); margin-top:3px; }
.relay-ticket { font-size:11px; color: var(--brand-blue-light); margin-top:2px; }

.gap-card { border-radius: var(--r-sm); padding:14px; margin-bottom:10px; transition:background .3s,border .3s; }
.gap-pending  { background: var(--gap-pending-bg);  border: 1px solid var(--gap-pending-border); }
.gap-answered { background: var(--gap-answered-bg); border: 1px solid var(--gap-answered-border); }
.gap-answer-box { flex:1; background: var(--gap-answer-bg); border: 1px solid var(--gap-answer-border); border-radius: var(--r-sm); padding:9px 13px; font-size:12px; color: var(--gap-answer-text); }

.ceo-draggable-section { position:relative; transition:transform .2s, box-shadow .2s; border-radius: var(--r-md); margin-bottom:4px; }
.ceo-draggable-section.dragging { opacity:.5; transform:scale(.98); }
.ceo-draggable-section.drag-over { box-shadow:0 -3px 0 var(--brand-red), 0 0 20px var(--brand-red-dim); }
.ceo-drag-handle { position:absolute; top:12px; right:-26px; width:22px; height:30px; display:flex; align-items:center; justify-content:center; cursor:grab; color: var(--text-muted); font-size:15px; opacity:.3; transition:opacity .2s; z-index:5; user-select:none; border-radius: var(--r-xs); }
.ceo-drag-handle:hover { opacity:1; background: var(--nav-hover-bg); color: var(--brand-blue); }
.ceo-draggable-section:hover .ceo-drag-handle { opacity:.7; }
.ceo-drag-handle:active { cursor:grabbing; }
[dir="rtl"] .ceo-drag-handle { right:auto; left:-26px; }
@media(max-width:768px) { .ceo-drag-handle { right:-4px; top:6px; opacity:.6; } [dir="rtl"] .ceo-drag-handle { right:auto; left:-4px; } }

/* ══════════════════════════════════════════════════════════════
   LEGACY / MOBILE
   ══════════════════════════════════════════════════════════════ */
.nav-item { display:none; }
.nav-section { display:none; }
.nav-icon { font-size:14px; }
.sidebar-footer { display:none; }

.mobile-bar {
  display: none; position: fixed; top:0; left:0; right:0;
  z-index: 20;
  background: var(--bg-secondary);
  border-bottom: 2px solid var(--brand-red);
  padding: 12px 16px;
  align-items: center; justify-content: space-between;
}
.mobile-bar-title { font-family:'Cairo',sans-serif; font-size:16px; font-weight:800; color: var(--text-primary); }
.burger-btn { background:none; border:none; color:var(--text-nav); font-size:20px; cursor:pointer; padding:4px 8px; border-radius:var(--r-xs); }
.burger-btn:hover { color: var(--brand-blue); }
.sidebar-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,.60); z-index:15; }
.sidebar-overlay.open { display:block; }

/* ══════════════════════════════════════════════════════════════
   LIGHT THEME OVERRIDES
   ══════════════════════════════════════════════════════════════ */
[data-theme="light"] .btn-secondary      { background:#E4EEF8; color:var(--brand-dark-blue); border:1px solid #C0D8EE; }
[data-theme="light"] .btn-secondary:hover{ background:#D8EAF8; border-color:var(--brand-blue); color:var(--brand-blue); }
[data-theme="light"] .btn-logout         { background:#E4EEF8; color:var(--text-muted); border:1px solid #C0D8EE; }
[data-theme="light"] .btn-logout:hover   { border-color:var(--brand-red); color:var(--brand-red); }
[data-theme="light"] .page-btn           { background:#E4EEF8; color:var(--brand-dark-blue); border:1px solid #C0D8EE; }
[data-theme="light"] .page-btn:hover     { border-color:var(--brand-blue); color:var(--brand-blue); }
[data-theme="light"] tr:hover td         { background:rgba(51,119,189,.05); }
[data-theme="light"] .modal-overlay      { background:rgba(7,17,31,.45); }
[data-theme="light"] .login-title        { color:var(--brand-dark-blue) !important; }
[data-theme="light"] .badge-green        { background:#D4F5E5; color:#0A4A28; }
[data-theme="light"] .badge-blue         { background:#DBEAFE; color:#1E40AF; }
[data-theme="light"] .badge-orange       { background:#FEF3C7; color:#92400E; }
[data-theme="light"] .badge-red          { background:#FEE2E2; color:#991B1B; }
[data-theme="light"] .badge-gray         { background:#E4EEF8; color:var(--text-muted); border:1px solid #C0D8EE; }
[data-theme="light"] .tip                { background:rgba(51,119,189,.07); border:1px solid rgba(51,119,189,.22); color:#1A4A7A; }
[data-theme="light"] .info-msg           { background:#EFF6FF; border:1px solid #BFDBFE; color:#1E40AF; }
[data-theme="light"] .success-msg        { background:#D4F5E5; border:1px solid #5EC89A; color:#0A4A28; }
[data-theme="light"] .error-msg          { background:#FEE2E2; border:1px solid #FCA5A5; color:#991B1B; }
[data-theme="light"] .btn-danger         { background:#FEE2E2; border:1px solid #FCA5A5; color:#991B1B; }
[data-theme="light"] .btn-success        { background:#D4F5E5; border:1px solid #5EC89A; color:#0A4A28; }
[data-theme="light"] .btn-warning        { background:#FEF3C7; border:1px solid #FCD34D; color:#92400E; }
[data-theme="light"] .wf-card            { background:var(--bg-tertiary); border:1px solid var(--border-primary); }
[data-theme="light"] .format-sample      { background:#E4EEF8; border:1px solid #C0D8EE; color:var(--brand-dark-blue); }
[data-theme="light"] .sidebar-logo .name { color:var(--brand-dark-blue) !important; }
[data-theme="light"] .nav-section        { color:var(--text-muted); }
[data-theme="light"] .drop-zone          { background:#F5F9FF; }
[data-theme="light"] .drop-zone:hover    { background:rgba(51,119,189,.06); }

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */
@media(max-width:900px) { .stats-grid{grid-template-columns:repeat(3,1fr)} }
@media(max-width:768px) {
  .topnav { flex-wrap:wrap; height:auto; min-height:58px; }
  .topnav-menu { display:none; flex-direction:column; width:100%; order:3; padding:6px 0; gap:0; overflow-y:auto; max-height:70vh; }
  .topnav-menu.open { display:flex; }
  .topnav-group { width:100%; }
  .topnav-btn { width:100%; justify-content:flex-start; border-radius:0; padding:12px 20px; }
  .topnav-dropdown { position:static; box-shadow:none; border:none; border-radius:0; padding:0 0 0 16px; background:rgba(0,0,0,.10); }
  .topnav-group:hover .topnav-dropdown { display:none; }
  .topnav-group.mobile-open .topnav-dropdown { display:block !important; }
  .topnav-dropdown .dd-item { padding:10px 20px; border-radius:0; }
  .topnav-logo { order:1; }
  .topnav-actions { order:2; margin-right:0; }
  .mobile-burger { display:flex !important; order:2; margin-right:8px; }
  .mobile-bar { display:none; }
  .content { margin-right:0; padding:16px; padding-top:70px; }
  .stats-grid { grid-template-columns:repeat(2,1fr); gap:12px; }
  .page-header { margin-bottom:18px; }
  .page-title { font-size:20px; }
  .card { padding:16px; }
  .modal { max-height:92vh; }
  .modal-footer { flex-wrap:wrap; }
  th,td { padding:9px 10px; font-size:13px; }
  .btn-primary,.btn-secondary,.btn-success,.btn-sm { min-height:44px; min-width:44px; }
  .topnav-btn { min-height:48px; }
  .modal { margin:8px; max-width:calc(100vw - 16px) !important; max-height:calc(100vh - 16px) !important; border-radius:var(--r-lg); }
  .modal-overlay { padding:0; align-items:flex-end; }
  .stats-row { display:flex; overflow-x:auto; -webkit-overflow-scrolling:touch; gap:10px; padding-bottom:8px; }
  .stats-row .stat-card { min-width:130px; flex-shrink:0; }
  .ts-subtab, .fs-view-btn { white-space:nowrap; }
  .page-header { flex-direction:column; gap:10px; }
  #hr-import-modal .modal { max-width:100vw !important; max-height:100vh !important; margin:0; border-radius:0; height:100vh; }
}
@media(max-width:420px) {
  .stats-grid{grid-template-columns:repeat(2,1fr);gap:10px}
  .stat-num{font-size:26px}
  .btn-primary,.btn-secondary,.btn-success{padding:10px 14px;font-size:13px}
  .content{padding:12px;padding-top:66px}
  table{font-size:12px}
  th,td{padding:8px 8px}
  .stats-row .stat-card{min-width:112px}
  .page-title{font-size:18px}
  .page-sub{font-size:11px}
}
@media(min-width:769px) { .mobile-burger{display:none !important;} }

html,body { overflow-x:hidden; max-width:100vw; }
@media(display-mode:standalone) {
  .topnav { padding-top:env(safe-area-inset-top); }
  .btn-logout { display:none; }
}

/* ═══════════════════════════════════════════════════════════════════════
   MARKETING MODULE — Tab Frame + Chat Interface
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Marketing Module Tab Bar ─────────────────────────────────────────── */
#mkt-frame {
  margin: -26px -30px 0;
  padding: 0 30px;
}
.mkt-tab-bar {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  padding: 10px 0 0;
  scrollbar-width: none;
}
.mkt-tab-bar::-webkit-scrollbar { display: none; }

.mkt-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px 10px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-muted);
  font-family: 'Cairo', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  border-radius: 8px 8px 0 0;
  transition: color .18s, border-color .18s, background .18s;
}
.mkt-tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}
.mkt-tab-btn.active {
  color: #3377BD;
  border-bottom-color: #3377BD;
  background: var(--bg-tertiary);
}
.mkt-tab-btn span {
  font-size: 12px;
}

/* Nudge main content slightly when mkt-frame is showing */
#mkt-frame + .tab.active,
#mkt-frame ~ .tab.active {
  padding-top: 18px;
}

/* ── Marketing Chat Shell ─────────────────────────────────────────────── */
.mkt-chat-shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  box-sizing: border-box;
  height: calc(100vh - 180px);
  min-height: 500px;
  background: var(--bg-secondary);
  border-radius: 16px;
  border: 1px solid var(--border-primary);
  overflow: hidden;
}

/* Chat Header */
.mkt-chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #0a1929, #0C2240);
  border-bottom: 1px solid var(--border-primary);
  flex-shrink: 0;
}
.mkt-chat-header-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1565C0, #3377BD);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(51,119,189,.25);
}
.mkt-chat-header-info { flex: 1; }
.mkt-chat-header-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
}
.mkt-chat-header-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.mkt-online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
  animation: pulse 2s infinite;
  flex-shrink: 0;
}
.mkt-header-reset {
  padding: 6px 12px;
  background: rgba(51,119,189,.1);
  border: 1px solid rgba(51,119,189,.25);
  border-radius: 8px;
  color: #60a5fa;
  font-family: 'Cairo', sans-serif;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .18s;
}
.mkt-header-reset:hover { background: rgba(51,119,189,.2); }

/* Messages Area */
.mkt-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: thin;
}

/* Message rows */
.mkt-msg {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  max-width: 88%;
}
.mkt-msg-user {
  align-self: flex-end;
  flex-direction: row;
}
.mkt-msg-agent {
  align-self: flex-start;
  flex-direction: row;
}

/* Avatars */
.mkt-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.mkt-avatar-user {
  background: rgba(51,119,189,.15);
  border: 1px solid rgba(51,119,189,.3);
  order: 2;
}
.mkt-avatar-agent {
  background: rgba(124,58,237,.15);
  border: 1px solid rgba(124,58,237,.3);
}

/* Bubbles */
.mkt-bubble {
  max-width: 100%;
  border-radius: 14px;
  padding: 10px 14px;
  font-size: 13.5px;
  line-height: 1.75;
}
.mkt-bubble-user {
  background: linear-gradient(135deg, #1565C0, #3377BD);
  color: #fff;
  border-radius: 14px 4px 14px 14px;
  text-align: right;
}
.mkt-bubble-agent {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-right: 3px solid #7c3aed;
  border-radius: 4px 14px 14px 14px;
  color: var(--text-primary);
  text-align: right;
}
.mkt-bubble-error {
  border-right-color: #ef4444;
  background: rgba(239,68,68,.06);
}
.mkt-bubble-label {
  font-size: 10px;
  font-weight: 700;
  color: #a78bfa;
  margin-bottom: 5px;
  letter-spacing: .4px;
}
.mkt-bubble-text { direction: rtl; }
.mkt-bubble-meta {
  font-size: 10px;
  color: rgba(255,255,255,.5);
  margin-top: 5px;
  text-align: left;
}
.mkt-bubble-agent .mkt-bubble-meta { color: var(--text-muted); }
.mkt-bubble-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}
.mkt-copy-btn {
  background: none;
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 7px;
  transition: color .15s;
}
.mkt-copy-btn:hover { color: #60a5fa; border-color: #60a5fa; }

/* Typing indicator */
.mkt-typing-bubble {
  padding: 12px 16px;
  display: flex;
  gap: 5px;
  align-items: center;
}
.mkt-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7c3aed;
  animation: mkt-bounce 1.2s infinite;
}
.mkt-dot:nth-child(2) { animation-delay: .2s; }
.mkt-dot:nth-child(3) { animation-delay: .4s; }
@keyframes mkt-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: .5; }
  40%           { transform: translateY(-7px); opacity: 1; }
}

/* Markdown rendering */
.mkt-md-h1 { font-size: 15px; font-weight: 800; color: var(--text-primary); margin: 8px 0 4px; }
.mkt-md-h2 { font-size: 13.5px; font-weight: 700; color: #60a5fa; margin: 6px 0 3px; }
.mkt-md-li {
  padding-right: 14px;
  position: relative;
  margin: 2px 0;
}
.mkt-md-li::before {
  content: '▸';
  position: absolute;
  right: 0;
  color: #7c3aed;
  font-size: 10px;
  top: 3px;
}
.mkt-md-li-num::before { content: ''; }
.mkt-inline-code {
  background: rgba(51,119,189,.12);
  border: 1px solid rgba(51,119,189,.2);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 12px;
  font-family: monospace;
  color: #60a5fa;
}
.mkt-code-block {
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  overflow-x: auto;
  font-family: monospace;
  margin: 6px 0;
  direction: ltr;
  text-align: left;
}

/* Quick prompts chips */
.mkt-chips-wrap {
  flex-shrink: 0;
  border-top: 1px solid var(--border-primary);
  background: var(--bg-primary);
  padding: 10px 14px 8px;
}
.mkt-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.mkt-chips::-webkit-scrollbar { display: none; }
.mkt-chip {
  flex-shrink: 0;
  padding: 6px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: 20px;
  color: var(--text-secondary);
  font-family: 'Cairo', sans-serif;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s, color .15s, background .15s;
}
.mkt-chip:hover {
  border-color: #3377BD;
  color: #60a5fa;
  background: rgba(51,119,189,.08);
}

/* Input bar */
.mkt-chat-inputbar {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  padding: 12px 16px;
  border-top: 1px solid var(--border-primary);
  background: var(--bg-secondary);
  flex-shrink: 0;
}
.mkt-chat-textarea {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: 'Cairo', sans-serif;
  font-size: 13.5px;
  padding: 11px 14px;
  resize: none;
  outline: none;
  line-height: 1.5;
  min-height: 44px;
  max-height: 120px;
  direction: rtl;
  transition: border-color .18s;
}
.mkt-chat-textarea:focus { border-color: #3377BD; box-shadow: 0 0 0 3px rgba(51,119,189,.1); }
.mkt-chat-textarea::placeholder { color: var(--text-muted); }
.mkt-send-btn {
  padding: 10px 20px;
  background: linear-gradient(135deg, #1565C0, #3377BD);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-family: 'Cairo', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .18s, transform .1s;
  min-height: 44px;
}
.mkt-send-btn:hover:not(:disabled) { opacity: .9; transform: translateY(-1px); }
.mkt-send-btn:disabled { opacity: .5; cursor: default; transform: none; }

/* Responsive */
@media(max-width: 768px) {
  #mkt-frame { margin: -16px -16px 0; padding: 0 16px; }
}
@media(max-width: 600px) {
  .mkt-chat-shell { height: calc(100vh - 140px); }
  .mkt-msg { max-width: 96%; }
  #mkt-frame { margin: -12px -12px 0; padding: 0 12px; }
  .mkt-tab-btn { padding: 7px 10px 9px; font-size: 11px; }
  .mkt-tab-btn span { display: none; }
}

/* ═══════════════════════════════════════════════════════════════════════
   SOCIAL MEDIA DESIGNER MODULE — sdes-*
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Layout ─────────────────────────────────────────────────────────── */
.sdes-root {
  display: flex;
  flex-direction: column;
  gap: 0;
  height: calc(100vh - 200px);
  min-height: 560px;
}

/* Platform bar */
.sdes-platform-bar {
  display: flex;
  gap: 4px;
  padding: 10px 0 12px;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}
.sdes-platform-bar::-webkit-scrollbar { display: none; }

.sdes-plat-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .16s, background .16s;
  color: var(--text-secondary);
  font-family: 'Cairo', sans-serif;
}
.sdes-plat-btn:hover  { border-color: rgba(51,119,189,.4); background: rgba(51,119,189,.06); }
.sdes-plat-btn.active { border-color: #3377BD; background: rgba(51,119,189,.12); color: var(--text-primary); }

.sdes-plat-abbr {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid;
  font-size: 11px;
  font-weight: 800;
  font-family: 'Cairo', monospace;
  flex-shrink: 0;
}
.sdes-plat-meta { display: flex; flex-direction: column; align-items: flex-start; }
.sdes-plat-name { font-size: 12px; font-weight: 700; line-height: 1.2; }
.sdes-plat-dim  { font-size: 10px; color: var(--text-muted); font-family: monospace; }

/* ── Main workspace (3-col) ─────────────────────────────────────────── */
.sdes-workspace {
  display: grid;
  grid-template-columns: 180px 1fr 220px;
  flex: 1;
  min-height: 0;
  border: 1px solid var(--border-primary);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-secondary);
}

/* ── Side panels ────────────────────────────────────────────────────── */
.sdes-side-panel {
  display: flex;
  flex-direction: column;
  border-inline-start: 1px solid var(--border-primary);
  background: var(--bg-primary);
  min-height: 0;
  overflow: hidden;
}
.sdes-side-panel:first-child {
  border-inline-start: none;
  border-inline-end: 1px solid var(--border-primary);
}

.sdes-side-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-primary);
  flex-shrink: 0;
}
.sdes-side-tab {
  flex: 1;
  padding: 9px 6px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: 'Cairo', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.sdes-side-tab:hover  { color: var(--text-primary); }
.sdes-side-tab.active { color: #3377BD; border-bottom-color: #3377BD; }

.sdes-side-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}

/* Template list */
.sdes-tpl-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.sdes-tpl-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 8px 4px;
  background: none;
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Cairo', sans-serif;
  font-size: 10.5px;
  color: var(--text-secondary);
  transition: border-color .15s, background .15s, color .15s;
}
.sdes-tpl-btn:hover { border-color: #3377BD; background: rgba(51,119,189,.08); color: var(--text-primary); }
.sdes-tpl-cvs {
  border-radius: 3px;
  display: block;
  width: 100%;
  object-fit: contain;
}

/* Layers panel */
.sdes-layer-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 4px;
  border-radius: 5px;
  cursor: pointer;
  font-family: 'Cairo', sans-serif;
  font-size: 12px;
  color: var(--text-secondary);
  transition: background .12s;
}
.sdes-layer-row:hover  { background: rgba(255,255,255,.04); }
.sdes-layer-row.active { background: rgba(51,119,189,.15); color: var(--text-primary); }
.sdes-layer-ic { width: 18px; text-align: center; font-size: 11px; flex-shrink: 0; }
.sdes-layer-nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sdes-layer-acts { display: flex; gap: 2px; opacity: 0; transition: opacity .12s; }
.sdes-layer-row:hover .sdes-layer-acts { opacity: 1; }
.sdes-layer-acts button {
  width: 20px; height: 20px;
  background: none; border: none;
  color: var(--text-muted); cursor: pointer; font-size: 11px; padding: 0;
  border-radius: 3px; transition: background .1s;
}
.sdes-layer-acts button:hover { background: rgba(255,255,255,.1); color: var(--text-primary); }

/* ── Canvas area ────────────────────────────────────────────────────── */
.sdes-canvas-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #040d17;
  position: relative;
}

.sdes-tools-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 10px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-primary);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.sdes-tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
  flex-shrink: 0;
}
.sdes-tool-btn:hover  { background: rgba(255,255,255,.07); color: var(--text-primary); }
.sdes-tool-btn.active { background: rgba(51,119,189,.2); border-color: rgba(51,119,189,.5); color: #3377BD; }
.sdes-tool-sep { width: 1px; height: 22px; background: var(--border-primary); margin: 0 4px; }
.sdes-tool-label {
  font-family: 'Cairo', sans-serif;
  font-size: 11px;
  color: var(--text-muted);
  padding: 0 6px;
}

.sdes-canvas-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 24px;
  /* Subtle dot-grid background */
  background-image: radial-gradient(circle, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 20px 20px;
  position: relative;
}

.sdes-hint {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(51,119,189,.9);
  color: #fff;
  font-family: 'Cairo', sans-serif;
  font-size: 13px;
  padding: 6px 16px;
  border-radius: 20px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s;
  white-space: nowrap;
}
.sdes-hint.visible { opacity: 1; }

.sdes-status-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 12px;
  background: var(--bg-primary);
  border-top: 1px solid var(--border-primary);
  flex-shrink: 0;
}
.sdes-status-bar span {
  font-size: 11px;
  color: var(--text-muted);
  font-family: monospace;
}

/* ── Properties panel ────────────────────────────────────────────────── */
.sdes-prop-section {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-primary);
}
.sdes-prop-section:last-child { border-bottom: none; }
.sdes-prop-title {
  font-family: 'Cairo', sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 8px;
}

.sdes-color-row, .sdes-font-row, .sdes-slider-row, .sdes-btn-group {
  display: flex;
  align-items: center;
  gap: 6px;
}
.sdes-btn-group { flex-wrap: wrap; }

.sdes-swatch-wrap { cursor: pointer; position: relative; }
.sdes-swatch {
  display: block;
  width: 28px; height: 28px;
  border-radius: 5px;
  border: 1px solid rgba(255,255,255,.15);
  cursor: pointer;
  transition: transform .1s;
}
.sdes-swatch:hover { transform: scale(1.1); }
.sdes-hidden-color {
  position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none;
}
.sdes-swatch-wrap:hover .sdes-swatch { border-color: rgba(255,255,255,.4); }
/* Clicking the label triggers the hidden input */
.sdes-swatch-wrap { display: inline-block; }

.sdes-hex-val {
  font-family: monospace;
  font-size: 11px;
  color: var(--text-muted);
}

.sdes-num-inp {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 5px;
  color: var(--text-primary);
  font-size: 12px;
  padding: 4px 6px;
  text-align: center;
  width: 60px;
  outline: none;
  transition: border-color .15s;
}
.sdes-num-inp:focus { border-color: #3377BD; }

.sdes-prop-mini-btn {
  width: 26px; height: 26px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 5px;
  color: var(--text-primary);
  font-size: 16px;
  cursor: pointer;
  transition: background .12s;
  display: flex; align-items: center; justify-content: center;
}
.sdes-prop-mini-btn:hover { background: rgba(255,255,255,.1); }

.sdes-tog-btn {
  padding: 4px 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 5px;
  color: var(--text-muted);
  font-size: 12px;
  font-family: 'Cairo', sans-serif;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
  white-space: nowrap;
}
.sdes-tog-btn:hover  { border-color: rgba(51,119,189,.4); color: var(--text-primary); }
.sdes-tog-btn.active { background: rgba(51,119,189,.2); border-color: #3377BD; color: #3377BD; }

.sdes-range {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--bg-secondary);
  outline: none;
  cursor: pointer;
}
.sdes-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #3377BD;
  cursor: pointer;
}
.sdes-range-val {
  font-size: 11px;
  color: var(--text-muted);
  font-family: monospace;
  white-space: nowrap;
  min-width: 32px;
}

.sdes-del-btn {
  width: 100%;
  padding: 8px;
  background: rgba(239,68,68,.08);
  border: 1px solid rgba(239,68,68,.2);
  border-radius: 7px;
  color: #f87171;
  font-family: 'Cairo', sans-serif;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.sdes-del-btn:hover { background: rgba(239,68,68,.18); border-color: rgba(239,68,68,.4); }

.sdes-empty-state {
  padding: 20px 12px;
  text-align: center;
  font-family: 'Cairo', sans-serif;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

.sdes-load-error {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-family: 'Cairo', sans-serif;
  color: #f87171;
  font-size: 14px;
  text-align: center;
  padding: 20px;
}

/* ── Top action bar ──────────────────────────────────────────────────── */
.sdes-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sdes-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: #3377BD;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-family: 'Cairo', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
}
.sdes-export-btn:hover { opacity: .88; transform: translateY(-1px); }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .sdes-workspace { grid-template-columns: 160px 1fr 0; }
  .sdes-side-panel:last-child { display: none; }
}
@media (max-width: 640px) {
  .sdes-workspace { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .sdes-side-panel:first-child { display: none; }
  .sdes-root { height: calc(100vh - 160px); }
}

/* ══════════════════════════════════════════════════════════════════════
   AI DESIGN AGENT CHAT — .sdes-ai-*
   ══════════════════════════════════════════════════════════════════════ */
.sdes-ai-pane {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: transparent;
  overflow: hidden;
}
.sdes-ai-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
.sdes-ai-msgs::-webkit-scrollbar { width: 4px; }
.sdes-ai-msgs::-webkit-scrollbar-thumb { background: rgba(51,119,189,.3); border-radius: 2px; }

.sdes-ai-msg {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  opacity: 1;
  transform: none;
}
.sdes-ai-msg-user  { flex-direction: row-reverse; }
.sdes-ai-msg-agent { flex-direction: row; }

.sdes-ai-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  background: rgba(255,255,255,.06);
}
.sdes-ai-avatar-agent { background: rgba(51,119,189,.18); }
.sdes-ai-avatar-user  { background: rgba(203,76,65,.18); }

.sdes-ai-bubble {
  max-width: 86%;
  padding: 8px 11px;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.55;
  word-break: break-word;
}
.sdes-ai-bubble-agent {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  border-bottom-right-radius: 3px;
  color: var(--text-primary);
}
.sdes-ai-bubble-user {
  background: rgba(51,119,189,.18);
  border: 1px solid rgba(51,119,189,.25);
  border-bottom-left-radius: 3px;
  color: var(--text-primary);
  text-align: right;
}
.sdes-ai-bubble-err { border-color: rgba(239,68,68,.3); }
.sdes-ai-agent-label {
  font-size: 10px;
  color: #3377BD;
  font-weight: 600;
  margin-bottom: 4px;
}
.sdes-ai-text code {
  background: rgba(255,255,255,.1);
  border-radius: 3px;
  padding: 1px 4px;
  font-family: monospace;
  font-size: 11px;
}
.sdes-ai-li {
  padding-right: 10px;
  position: relative;
  margin: 2px 0;
}
.sdes-ai-li::before { content: '•'; margin-left: 6px; color: #3377BD; }

.sdes-ai-actions-bar {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.sdes-ai-apply-btn {
  background: linear-gradient(135deg, #3377BD, #1A4A7A);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 5px 11px;
  font-size: 11.5px;
  font-family: inherit;
  cursor: pointer;
  transition: opacity .2s;
}
.sdes-ai-apply-btn:hover { opacity: .85; }
.sdes-ai-act-count {
  font-size: 10px;
  color: var(--text-muted);
}

.sdes-ai-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 5px;
}
.sdes-ai-meta {
  font-size: 10px;
  color: var(--text-muted);
  opacity: .7;
}
.sdes-ai-copy {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 13px;
  opacity: .6; padding: 0 2px;
  transition: opacity .2s;
}
.sdes-ai-copy:hover { opacity: 1; }

/* Typing dots */
.sdes-ai-typing-bubble {
  padding: 10px 14px;
  display: flex; gap: 5px; align-items: center;
}
.sdes-ai-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #3377BD;
  opacity: .4;
  animation: sdesTypePulse 1.2s infinite ease-in-out;
}
.sdes-ai-dot:nth-child(2) { animation-delay: .2s; }
.sdes-ai-dot:nth-child(3) { animation-delay: .4s; }
@keyframes sdesTypePulse {
  0%,80%,100% { opacity:.2; transform:scale(1); }
  40%         { opacity:1;  transform:scale(1.25); }
}

/* Attached image in bubble */
.sdes-ai-attach-user { margin-bottom: 6px; }
.sdes-ai-attach-img  { max-width: 130px; border-radius: 6px; display: block; }

/* Input bar */
.sdes-ai-bar {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  padding: 8px 8px 6px;
  border-top: 1px solid rgba(255,255,255,.07);
  background: rgba(255,255,255,.03);
  flex-shrink: 0;
}
.sdes-ai-textarea {
  flex: 1;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 12.5px;
  padding: 7px 10px;
  resize: none;
  min-height: 34px;
  max-height: 110px;
  line-height: 1.4;
  direction: rtl;
  outline: none;
  transition: border-color .2s;
}
.sdes-ai-textarea:focus { border-color: rgba(51,119,189,.5); }
.sdes-ai-attach-btn {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  color: var(--text-muted);
  border-radius: 8px;
  width: 32px; height: 32px;
  font-size: 15px; cursor: pointer;
  flex-shrink: 0; transition: background .2s;
}
.sdes-ai-attach-btn:hover { background: rgba(255,255,255,.1); }
.sdes-ai-send-btn {
  background: #3377BD;
  color: #fff; border: none;
  border-radius: 8px;
  padding: 0 12px; height: 32px;
  font-size: 12px; font-family: inherit;
  cursor: pointer; flex-shrink: 0;
  transition: background .2s;
}
.sdes-ai-send-btn:hover    { background: #1A4A7A; }
.sdes-ai-send-btn:disabled { opacity: .5; cursor: default; }

/* Footer with reset button */
.sdes-ai-footer {
  display: flex;
  justify-content: center;
  padding: 4px 8px 6px;
  flex-shrink: 0;
}
.sdes-ai-reset-btn {
  background: none; border: none;
  color: var(--text-muted); font-size: 11px;
  cursor: pointer; font-family: inherit;
  opacity: .6; transition: opacity .2s;
}
.sdes-ai-reset-btn:hover { opacity: 1; }

/* Attach chip preview */
.sdes-ai-attach-area {
  padding: 0 8px;
  flex-shrink: 0;
}
.sdes-attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(51,119,189,.12);
  border: 1px solid rgba(51,119,189,.25);
  border-radius: 6px;
  padding: 4px 8px;
  margin: 4px 0;
  font-size: 11.5px;
}
.sdes-attach-thumb { width: 32px; height: 32px; object-fit: cover; border-radius: 4px; }
.sdes-attach-icon  { font-size: 18px; }
.sdes-attach-name  { color: var(--text-primary); max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sdes-attach-rm    { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 13px; padding: 0; }
.sdes-attach-rm:hover { color: #ef4444; }

/* Pro-props alignment grid */
.sdes-align-grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 4px;
  margin-top: 6px;
}
.sdes-align-grid button {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  color: var(--text-primary);
  border-radius: 5px;
  padding: 5px;
  cursor: pointer;
  font-size: 16px;
  transition: background .2s;
}
.sdes-align-grid button:hover { background: rgba(51,119,189,.2); border-color: rgba(51,119,189,.4); }

/* Filter rows */
.sdes-filter-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  font-size: 11px;
  color: var(--text-muted);
}
.sdes-filter-row span:first-child { min-width: 34px; }
.sdes-filter-row .sdes-range { flex: 1; }
.sdes-filter-row span:last-child { min-width: 26px; text-align: left; font-size: 10px; }

/* Color rows in props */
.sdes-color-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
}

/* Right panel tabs (override side-tabs for 2-tab layout) */
.sdes-right-panel .sdes-side-tabs {
  grid-template-columns: 1fr 1fr;
}

/* Save/send actions — additional buttons in header */
.sdes-save-btn {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background .2s;
}
.sdes-save-btn:hover { background: rgba(255,255,255,.14); }
.sdes-send-btn {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  color: #fff;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: opacity .2s;
}
.sdes-send-btn:hover { opacity: .85; }

/* Saved designs gallery */
.sdes-designs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  padding: 12px;
}
.sdes-design-card {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .2s, transform .15s;
}
.sdes-design-card:hover { border-color: #3377BD; transform: translateY(-2px); }
.sdes-design-card img  { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.sdes-design-card-meta { padding: 6px 8px; font-size: 11px; color: var(--text-muted); }
