/* ===================================================================
   Steep — Style Reference (serif analytics on warm paper)
   Duma Call Center Sales Platform Design System
   =================================================================== */

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

:root {
  /* Steep Colors */
  --color-ink-black: #17191c;
  --color-paper-white: #ffffff;
  --color-mist-gray: #f2f2f3;
  --color-fog-white: #fafafb;
  --color-slate-gray: #777b86;
  --color-ash-gray: #979799;
  --color-smoke-gray: #a3a6af;
  --color-blush-peach: #fbe1d1;
  --color-sienna-brown: #5d2a1a;

  /* Functional Accents */
  --color-done-green: #1e7f72;
  --color-done-bg: #edf8f6;
  --color-whatsapp: #25d366;
  --color-whatsapp-bg: #eafaf1;
  --color-call-blue: #17191c;
  --color-border: #e8e8ea;
  --color-border-subtle: #f0f0f2;

  /* Steep Elevation / Shadows */
  --shadow-subtle: 0px 0px 0px 1px rgba(0, 0, 0, 0.04), 0px 4px 20px rgba(0, 0, 0, 0.05);
  --shadow-floating: 0 0 0 1px rgba(4, 23, 43, 0.05), 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --shadow-pill: 0 4px 14px rgba(23, 25, 28, 0.15);

  /* Steep Radii */
  --radius-cards: 24px;
  --radius-artifacts: 20px;
  --radius-inputs: 16px;
  --radius-buttons: 9999px;
  --radius-badges: 12px;
}

/* Reset & Base */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--color-fog-white);
  color: var(--color-ink-black);
  font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  direction: rtl;
  text-align: right;
  min-height: 100vh;
}

/* Container */
.app-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 16px 150px;
}

/* ---------- HEADER ---------- */
.steep-header {
  background: var(--color-paper-white);
  border-bottom: 1px solid var(--color-border-subtle);
  padding: 10px 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background-color: rgba(255, 255, 255, 0.95);
}

.header-inner {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  min-width: 0;
  text-decoration: none;
}

.brand-badge {
  background: var(--color-ink-black);
  color: #fff;
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: var(--radius-badges);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  flex-shrink: 0;
}

.brand-titles {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-titles h1 {
  margin: 0;
  font-size: 16.5px;
  font-weight: 800;
  color: var(--color-ink-black);
  letter-spacing: -0.3px;
  white-space: nowrap;
  line-height: 1.25;
}

.brand-titles p {
  margin: 0;
  font-size: 11px;
  color: var(--color-slate-gray);
  font-weight: 500;
  white-space: nowrap;
  line-height: 1.25;
}

.user-controls {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.btn-excel-export {
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #166534;
  border-radius: var(--radius-buttons);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 1px 2px rgba(34, 197, 94, 0.08);
  white-space: nowrap;
  height: 36px;
  box-sizing: border-box;
}

.btn-excel-export:hover {
  background: #dcfce7;
  border-color: #22c55e;
  color: #14532d;
}

.btn-excel-export svg {
  color: #16a34a;
  flex-shrink: 0;
}

.user-tag {
  background: var(--color-mist-gray);
  color: var(--color-ink-black);
  padding: 6px 12px;
  border-radius: var(--radius-buttons);
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  height: 36px;
  box-sizing: border-box;
  border: 1px solid var(--color-border-subtle);
}

.user-tag svg {
  width: 14px;
  height: 14px;
  color: var(--color-slate-gray);
  flex-shrink: 0;
}

.user-tag .user-name-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.btn-ghost-sm {
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-buttons);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-slate-gray);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  height: 36px;
  box-sizing: border-box;
}

.btn-ghost-sm:hover {
  background: var(--color-mist-gray);
  color: var(--color-ink-black);
}

.btn-ghost-sm svg {
  flex-shrink: 0;
}

/* ---------- STATS HERO (Steep Floating Artifact) ---------- */
.stats-hero-card {
  background: var(--color-paper-white);
  border-radius: var(--radius-cards);
  padding: 20px;
  margin-top: 16px;
  box-shadow: var(--shadow-subtle);
  border: 1px solid var(--color-border-subtle);
  position: relative;
  overflow: hidden;
}

.stats-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.stats-hero-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stats-hero-metric .num {
  font-size: 28px;
  font-weight: 800;
  color: var(--color-ink-black);
  letter-spacing: -0.5px;
  line-height: 1.1;
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.stats-hero-metric .num-divider {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-slate-gray);
}

.stats-hero-metric .sub {
  font-size: 13px;
  color: var(--color-slate-gray);
  font-weight: 600;
}

.ring-wrap {
  width: 54px;
  height: 54px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ring-wrap svg {
  width: 54px;
  height: 54px;
  transform: rotate(-90deg);
}

.ring-wrap span {
  position: absolute;
  font-size: 12px;
  font-weight: 800;
  color: var(--color-done-green);
}

.steep-progress-track {
  height: 8px;
  background: var(--color-mist-gray);
  border-radius: var(--radius-buttons);
  overflow: hidden;
}

.steep-progress-fill {
  height: 100%;
  background: var(--color-done-green);
  border-radius: var(--radius-buttons);
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.stats-badges-row {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.mini-badge {
  background: var(--color-mist-gray);
  color: var(--color-slate-gray);
  border-radius: var(--radius-buttons);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.mini-badge strong {
  color: var(--color-ink-black);
}

/* ---------- SEARCH & FILTERS ---------- */
.search-controls {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-field-wrap {
  position: relative;
}

.search-field-wrap input {
  width: 100%;
  background: var(--color-paper-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-inputs);
  padding: 14px 46px 14px 16px;
  font-family: inherit;
  font-size: 16px; /* 16px prevents iOS zoom */
  color: var(--color-ink-black);
  outline: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-field-wrap input:focus {
  border-color: var(--color-ink-black);
  box-shadow: 0 0 0 3px rgba(23, 25, 28, 0.08);
}

.search-field-wrap .icon-search {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--color-slate-gray);
  pointer-events: none;
}

.search-field-wrap .btn-clear {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--color-mist-gray);
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--color-slate-gray);
  cursor: pointer;
}

.search-field-wrap .btn-clear.show {
  display: flex;
}

/* Filter Pills */
.filter-pills-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.filter-pills-row::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  background: var(--color-paper-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-buttons);
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-slate-gray);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  user-select: none;
}

.filter-pill:hover {
  background: var(--color-mist-gray);
  color: var(--color-ink-black);
}

.filter-pill.active {
  background: var(--color-ink-black);
  border-color: var(--color-ink-black);
  color: #fff;
}

/* ---------- CATEGORY GRID (HOME VIEW) ---------- */
.section-header-title {
  margin: 24px 4px 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-slate-gray);
  letter-spacing: -0.2px;
}

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

.category-card {
  background: var(--color-paper-white);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-cards);
  padding: 16px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-subtle);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.category-card:active {
  transform: scale(0.98);
}

.category-card:hover {
  border-color: var(--color-border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.category-icon-box {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.category-icon-box svg {
  width: 22px;
  height: 22px;
}

.category-card-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--color-ink-black);
  line-height: 1.3;
}

.category-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: var(--color-slate-gray);
  font-weight: 600;
}

.category-card.completed .category-card-meta {
  color: var(--color-done-green);
}

.category-progress-track {
  height: 5px;
  background: var(--color-mist-gray);
  border-radius: 9999px;
  overflow: hidden;
}

.category-progress-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.3s ease;
}

/* ---------- CATEGORY DETAIL VIEW ---------- */
.detail-top-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  margin-bottom: 12px;
}

.btn-back {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--color-paper-white);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-ink-black);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  transition: background 0.15s ease;
}

.btn-back:hover {
  background: var(--color-mist-gray);
}

.btn-back svg {
  width: 18px;
  height: 18px;
}

.detail-cat-badge {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.detail-cat-badge svg {
  width: 22px;
  height: 22px;
}

.detail-info {
  flex: 1;
}

.detail-info h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--color-ink-black);
}

.detail-info span {
  font-size: 13px;
  color: var(--color-slate-gray);
  font-weight: 600;
}

/* ---------- CONTACT CARD (Steep Card Style) ---------- */
.contacts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.contact-card {
  background: var(--color-paper-white);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-cards);
  padding: 16px;
  box-shadow: var(--shadow-subtle);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}

.contact-card.done {
  background-color: var(--color-done-bg);
  border-color: rgba(30, 127, 114, 0.2);
}

.contact-card.highlight {
  box-shadow: 0 0 0 3px var(--color-ink-black);
}

.contact-card-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.contact-index {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--color-mist-gray);
  color: var(--color-slate-gray);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.contact-card.done .contact-index {
  background: var(--color-done-green);
  color: #fff;
}

.contact-title-group {
  flex: 1;
  min-width: 0;
}

.contact-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--color-ink-black);
  margin-bottom: 2px;
  line-height: 1.35;
  word-break: break-word;
}

.contact-card.done .contact-name {
  text-decoration: line-through;
  text-decoration-color: var(--color-done-green);
  color: var(--color-slate-gray);
}

.contact-company {
  font-size: 12.5px;
  color: var(--color-slate-gray);
  font-weight: 500;
}

.contact-interactive-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-top: 2px;
}

.contact-phone-display {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--color-ink-black);
  direction: ltr;
  display: inline-block;
  unicode-bidi: isolate;
  background: var(--color-mist-gray);
  padding: 4px 10px;
  border-radius: 8px;
  letter-spacing: 0.2px;
}

/* Actions Row - Minimum 44x44px Touch Targets */
.contact-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-action {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, opacity 0.15s ease, background-color 0.15s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.btn-action:active {
  transform: scale(0.92);
}

/* Call Button - Ink Black Lozenge */
.btn-call {
  background: var(--color-ink-black);
  color: #fff;
}

.btn-call svg {
  width: 19px;
  height: 19px;
}

/* WhatsApp Button - WhatsApp Green Brand */
.btn-whatsapp {
  background: var(--color-whatsapp);
  color: #fff;
}

.btn-whatsapp svg {
  width: 20px;
  height: 20px;
}

/* Done Check Toggle Button */
.btn-done {
  background: var(--color-paper-white);
  border: 1.5px solid var(--color-border);
  color: var(--color-ash-gray);
  transition: all 0.2s ease;
}

.btn-done:hover {
  border-color: var(--color-done-green);
  color: var(--color-done-green);
  background: var(--color-done-bg);
}

.btn-done svg {
  width: 20px;
  height: 20px;
  transition: transform 0.15s ease;
}

.btn-done:active svg {
  transform: scale(0.85);
}

.contact-card.done .btn-done {
  background: var(--color-done-green);
  border-color: var(--color-done-green);
  color: #fff;
  box-shadow: 0 2px 8px rgba(30, 127, 114, 0.3);
}

.contact-card.done .btn-done:hover {
  background: #17685d;
  border-color: #17685d;
  color: #fff;
}

/* Notes / Refusal Textarea (Resizable & Auto-growing) */
.contact-note-wrap {
  position: relative;
  margin-top: 4px;
}

.contact-note-textarea {
  width: 100%;
  min-height: 48px;
  resize: vertical; /* User requested resizable textarea */
  background: var(--color-mist-gray);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-inputs);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--color-ink-black);
  outline: none;
  line-height: 1.5;
  transition: border-color 0.2s, background-color 0.2s;
}

.contact-note-textarea:focus {
  background: var(--color-paper-white);
  border-color: var(--color-ink-black);
  border-style: solid;
}

.note-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--color-slate-gray);
  margin-top: 4px;
  padding: 0 2px;
}

.note-saved-badge {
  color: var(--color-done-green);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.note-saved-badge.show {
  opacity: 1;
}

/* Empty State */
.empty-state {
  background: var(--color-paper-white);
  border-radius: var(--radius-cards);
  border: 1px dashed var(--color-border);
  padding: 48px 24px;
  text-align: center;
  color: var(--color-slate-gray);
}

.empty-state svg {
  width: 40px;
  height: 40px;
  color: var(--color-ash-gray);
  margin-bottom: 12px;
}

/* ---------- STICKY NEXT-CALL BAR ---------- */
.sticky-next-bar {
  position: fixed;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 648px;
  background: rgba(23, 25, 28, 0.96);
  backdrop-filter: blur(16px);
  color: #fff;
  border-radius: var(--radius-buttons);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 40;
}

.snb-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--color-blush-peach);
  color: var(--color-sienna-brown);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.snb-text {
  flex: 1;
  min-width: 0;
}

.snb-label {
  font-size: 11px;
  color: var(--color-smoke-gray);
  font-weight: 600;
}

.snb-name {
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.snb-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.snb-btn-wa {
  background: var(--color-whatsapp);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.snb-btn-call {
  background: #fff;
  color: var(--color-ink-black);
  padding: 7px 14px;
  border-radius: var(--radius-buttons);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ---------- LOGIN PAGE (Steep Style) ---------- */
.login-body {
  background: var(--color-fog-white);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--color-paper-white);
  border-radius: var(--radius-cards);
  padding: 36px 30px;
  box-shadow: var(--shadow-subtle);
  border: 1px solid var(--color-border-subtle);
}

.login-logo-wrap {
  text-align: center;
  margin-bottom: 28px;
}

.login-badge {
  display: inline-flex;
  width: 50px;
  height: 50px;
  background: var(--color-ink-black);
  color: #fff;
  border-radius: 16px;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 12px;
}

.login-card h1 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 800;
  color: var(--color-ink-black);
}

.login-card p {
  margin: 0;
  font-size: 13.5px;
  color: var(--color-slate-gray);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-ink-black);
}

.input-group input {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-inputs);
  border: 1px solid var(--color-border);
  background: var(--color-mist-gray);
  font-family: inherit;
  font-size: 15px;
  outline: none;
  transition: all 0.2s;
}

.input-group input:focus {
  background: var(--color-paper-white);
  border-color: var(--color-ink-black);
}

/* Steep Signature Pill Button */
.btn-pill-filled {
  background: var(--color-ink-black);
  color: #fff;
  border: 1px solid var(--color-ink-black);
  border-radius: var(--radius-buttons);
  padding: 14px 24px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.2s;
}

.btn-pill-filled:hover {
  opacity: 0.92;
}

.login-alert-error {
  background: #fdf2f2;
  border: 1px solid #f8b4b4;
  color: #9b1c1c;
  border-radius: var(--radius-inputs);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
}

.login-demo-hint {
  margin-top: 20px;
  padding: 12px;
  background: var(--color-mist-gray);
  border-radius: var(--radius-inputs);
  font-size: 12px;
  color: var(--color-slate-gray);
  line-height: 1.6;
}

/* Views toggling */
.view-panel {
  display: none;
}
.view-panel.active {
  display: block;
}

/* Comprehensive Mobile Responsive Overhaul */
/* Base: Bottom Navigation is hidden on desktop */
.mobile-bottom-nav {
  display: none !important;
}

/* Comprehensive Mobile Responsive Overhaul (< 640px) */
@media (max-width: 640px) {
  /* HIDE action buttons from the top header on mobile - they live in bottom navbar */
  .steep-header .btn-excel-export,
  .steep-header .btn-admin-link,
  .steep-header .btn-back-calls,
  .steep-header .btn-logout {
    display: none !important;
  }

  /* Spacious, uncrowded, pristine top header on mobile */
  .steep-header {
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
  }

  .header-inner {
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap !important;
  }

  .brand-section {
    gap: 10px;
    flex-shrink: 0;
    min-width: 0;
  }

  .brand-badge {
    width: 38px;
    height: 38px;
    min-width: 38px;
    font-size: 16px;
    border-radius: 11px;
  }

  .brand-titles h1 {
    font-size: 16px;
    font-weight: 800;
    color: var(--color-ink-black);
    white-space: nowrap;
    line-height: 1.25;
    letter-spacing: -0.3px;
  }

  .brand-titles p {
    font-size: 11px;
    color: var(--color-slate-gray);
    white-space: nowrap;
    line-height: 1.25;
  }

  .user-controls {
    flex-shrink: 0;
    gap: 0;
  }

  .user-tag {
    background: var(--color-mist-gray);
    color: var(--color-ink-black);
    padding: 6px 12px;
    height: 36px;
    font-size: 12.5px;
    font-weight: 700;
    border-radius: var(--radius-buttons);
    border: 1px solid var(--color-border-subtle);
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }

  .user-tag svg {
    width: 14px;
    height: 14px;
    color: var(--color-slate-gray);
  }

  .user-tag .user-name-text {
    max-width: 130px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Bottom padding so content is never covered */
  .app-container {
    padding-left: 12px;
    padding-right: 12px;
    padding-bottom: calc(160px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Sticky next call bar floats above bottom navbar */
  .sticky-next-bar {
    bottom: calc(74px + env(safe-area-inset-bottom, 0px)) !important;
    width: calc(100% - 24px);
  }

  /* Mobile Bottom Navigation Bar (Steep Native App Feel) */
  .mobile-bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 90;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--color-border);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
  }

  .mbn-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-decoration: none;
    color: var(--color-slate-gray);
    padding: 6px 8px;
    border-radius: var(--radius-inputs);
    transition: all 0.15s ease;
    flex: 1;
    max-width: 80px;
    min-height: 48px;
    touch-action: manipulation;
  }

  .mbn-item:active {
    transform: scale(0.92);
  }

  .mbn-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    transition: background 0.15s ease;
  }

  .mbn-item.active {
    color: var(--color-ink-black);
  }

  .mbn-item.active .mbn-icon-wrap {
    background: var(--color-ink-black);
    color: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  }

  .mbn-item.active .mbn-label {
    font-weight: 800;
    color: var(--color-ink-black);
  }

  .mbn-label {
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
  }

  .mbn-item-excel {
    color: #166534;
  }

  .mbn-item-excel .mbn-icon-wrap {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
  }

  .mbn-item-excel .mbn-label {
    color: #15803d;
    font-weight: 700;
  }

  .mbn-item-logout:active {
    color: #dc2626;
  }

  .mbn-item-logout:active .mbn-icon-wrap {
    background: #fef2f2;
    color: #dc2626;
  }

  .stats-hero-card {
    padding: 16px 14px;
    border-radius: 20px;
  }

  .stats-hero-metric .num {
    font-size: 24px;
  }

  .stats-badges-row {
    gap: 6px;
  }

  .mini-badge {
    padding: 3px 8px;
    font-size: 11px;
  }

  .category-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .category-card {
    padding: 12px 10px;
    border-radius: 18px;
    gap: 8px;
  }

  .category-icon-box {
    width: 36px;
    height: 36px;
    border-radius: 12px;
  }

  .category-icon-box svg {
    width: 18px;
    height: 18px;
  }

  .category-card-name {
    font-size: 13.5px;
  }

  .category-card-meta {
    font-size: 11px;
  }

  .contact-card {
    padding: 14px 12px;
    border-radius: 18px;
    gap: 10px;
  }

  .contact-name {
    font-size: 15px;
  }

  .contact-phone-display {
    font-size: 12.5px;
    padding: 4px 8px;
  }

  .contact-actions {
    gap: 6px;
  }

  .btn-action {
    width: 42px;
    height: 42px;
  }

  .contact-note-textarea {
    font-size: 13px;
    min-height: 44px;
  }

  .sticky-next-bar {
    padding: 6px 10px;
    gap: 8px;
    width: calc(100% - 16px);
  }

  .snb-icon {
    width: 34px;
    height: 34px;
  }

  .snb-name {
    font-size: 13px;
  }

  .snb-actions {
    gap: 5px;
  }

  .snb-btn-call {
    padding: 6px 10px;
    font-size: 12px;
  }

  .snb-btn-wa {
    width: 34px;
    height: 34px;
  }
}

@media (max-width: 380px) {
  .steep-header {
    padding: 8px 10px;
  }

  .brand-badge {
    width: 32px;
    height: 32px;
    min-width: 32px;
    font-size: 14px;
    border-radius: 8px;
  }

  .brand-titles h1 {
    font-size: 14px;
  }

  .brand-titles p {
    display: none;
  }

  .user-tag {
    padding: 0 8px;
    height: 32px;
    font-size: 11.5px;
  }

  .user-tag .user-name-text {
    max-width: 85px;
  }

  .mbn-item {
    padding: 4px 4px;
    max-width: 68px;
  }

  .mbn-label {
    font-size: 10px;
  }
}

/* ==========================================================================
   ADMIN PANEL & RBAC MANAGEMENT STYLES (Steep Editorial Design)
   ========================================================================== */

.btn-admin-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--color-ink-black);
  color: #fff;
  border-radius: var(--radius-buttons);
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  transition: opacity 0.15s ease, transform 0.1s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-admin-link:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.brand-badge-admin {
  background: #7f1d1d !important;
  color: #fef2f2 !important;
}

.admin-body {
  background: var(--color-fog-white);
  min-height: 100vh;
}

.admin-container {
  padding-top: 24px;
  padding-bottom: 80px;
}

/* Admin Tabs */
.admin-tabs {
  display: flex;
  gap: 8px;
  background: var(--color-paper-white);
  padding: 6px;
  border-radius: var(--radius-cards);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-subtle);
  margin-bottom: 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-tab {
  flex: 1;
  min-width: 140px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-radius: var(--radius-inputs);
  color: var(--color-slate-gray);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.admin-tab:hover {
  color: var(--color-ink-black);
  background: var(--color-mist-gray);
}

.admin-tab.active {
  background: var(--color-ink-black);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.admin-tab-content {
  display: none;
}

.admin-tab-content.active {
  display: block;
}

/* Actions Bar */
.admin-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 18px;
}

.search-and-filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  max-width: 580px;
}

.filter-select {
  padding: 10px 14px;
  border-radius: var(--radius-inputs);
  border: 1px solid var(--color-border);
  background: var(--color-paper-white);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--color-ink-black);
  outline: none;
  cursor: pointer;
}

.btn-primary-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  background: var(--color-ink-black);
  color: #fff;
  border: none;
  border-radius: var(--radius-buttons);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.btn-primary-action:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.btn-primary-action:active {
  transform: scale(0.97);
}

/* Admin Data Table Card */
.admin-table-card {
  background: var(--color-paper-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-cards);
  box-shadow: var(--shadow-subtle);
  overflow: hidden;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-size: 13.5px;
}

.admin-data-table th {
  background: var(--color-mist-gray);
  padding: 12px 14px;
  font-weight: 800;
  color: var(--color-ink-black);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.admin-data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border-subtle);
  color: var(--color-ink-black);
  vertical-align: middle;
}

.admin-data-table tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.015);
}

.td-muted {
  color: var(--color-slate-gray);
  font-size: 12px;
}

.td-note {
  max-width: 220px;
}

.note-truncate {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  color: var(--color-slate-gray);
}

.badge-cat-pill {
  display: inline-block;
  padding: 3px 10px;
  background: var(--color-mist-gray);
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-ink-black);
  border: 1px solid var(--color-border-subtle);
}

.badge-role {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}

.badge-role-admin {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.badge-role-sales {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.action-btn-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-table-action {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-paper-white);
  color: var(--color-ink-black);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.btn-table-action:hover {
  background: var(--color-mist-gray);
  border-color: var(--color-ink-black);
}

.btn-danger-action {
  color: #b91c1c;
}

.btn-danger-action:hover {
  background: #fef2f2;
  border-color: #ef4444;
}

.table-footer-info {
  padding: 12px 16px;
  background: var(--color-mist-gray);
  font-size: 12.5px;
  color: var(--color-slate-gray);
  font-weight: 600;
  border-top: 1px solid var(--color-border);
}

.admin-empty-state {
  padding: 36px 16px;
  text-align: center;
  color: var(--color-slate-gray);
  font-size: 14px;
}

/* Category Grid in Admin */
.category-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.category-admin-card {
  background: var(--color-paper-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-cards);
  padding: 18px;
  box-shadow: var(--shadow-subtle);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cat-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.cat-card-header .cat-name {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--color-ink-black);
}

.cat-count-badge {
  padding: 4px 10px;
  background: var(--color-mist-gray);
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-slate-gray);
}

.cat-card-progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cat-progress-bar {
  height: 6px;
  background: var(--color-mist-gray);
  border-radius: 9999px;
  overflow: hidden;
}

.cat-progress-fill {
  height: 100%;
  background: var(--color-done-green);
  border-radius: 9999px;
}

.cat-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--color-slate-gray);
  font-weight: 600;
}

.cat-card-actions {
  display: flex;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--color-border-subtle);
}

.btn-card-action {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-inputs);
  border: 1px solid var(--color-border);
  background: var(--color-paper-white);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--color-ink-black);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-card-action:hover {
  background: var(--color-mist-gray);
}

.btn-card-danger {
  color: #b91c1c;
}

.btn-card-danger:hover {
  background: #fef2f2;
  border-color: #ef4444;
}

/* ==========================================================================
   MODAL DIALOGS
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(17, 19, 21, 0.65);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-dialog {
  background: var(--color-paper-white);
  border-radius: var(--radius-cards);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  0% { transform: scale(0.95); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

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

.modal-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: var(--color-ink-black);
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--color-slate-gray);
  cursor: pointer;
  padding: 0;
}

.modal-close:hover {
  color: var(--color-ink-black);
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--color-border);
  background: var(--color-mist-gray);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-ink-black);
}

.form-label .req {
  color: #dc2626;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-inputs);
  border: 1px solid var(--color-border);
  background: var(--color-paper-white);
  font-family: inherit;
  font-size: 14px;
  color: var(--color-ink-black);
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus {
  border-color: var(--color-ink-black);
}

.form-textarea {
  resize: vertical;
  min-height: 70px;
}

.form-hint {
  font-size: 11.5px;
  color: var(--color-slate-gray);
}

.input-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
}

.btn-primary-modal {
  padding: 10px 20px;
  background: var(--color-ink-black);
  color: #fff;
  border: none;
  border-radius: var(--radius-buttons);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn-primary-modal:hover {
  opacity: 0.9;
}

.btn-ghost-modal {
  padding: 10px 16px;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-buttons);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--color-slate-gray);
  cursor: pointer;
}

.btn-ghost-modal:hover {
  background: var(--color-border-subtle);
  color: var(--color-ink-black);
}

/* Danger Password Confirm Modal */
.modal-dialog-danger {
  border-top: 4px solid #dc2626;
}

.modal-dialog-danger .modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.danger-header-badge {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fee2e2;
  color: #dc2626;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-subtitle {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--color-slate-gray);
}

.danger-warning-box {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  padding: 14px;
  border-radius: var(--radius-inputs);
  font-size: 13px;
  line-height: 1.5;
  color: #9f1239;
}

.btn-danger-confirm {
  padding: 10px 20px;
  background: #dc2626;
  color: #fff;
  border: none;
  border-radius: var(--radius-buttons);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-danger-confirm:hover {
  background: #b91c1c;
}

.btn-danger-confirm:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--color-ink-black);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-inputs);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastSlide 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast-fade {
  opacity: 0;
  transform: translateY(10px);
}

.toast-success .toast-icon {
  color: var(--color-done-green);
  font-weight: 900;
}

.toast-error {
  background: #991b1b;
}

@keyframes toastSlide {
  0% { transform: translateY(20px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* Admin Mobile Responsiveness */
@media (max-width: 600px) {
  .admin-tabs {
    flex-direction: row;
    padding: 4px;
  }
  .admin-tab {
    min-width: 0;
    padding: 10px 8px;
    font-size: 12px;
  }
  .admin-actions-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .search-and-filter-group {
    flex-direction: column;
    max-width: 100%;
  }
  .filter-select {
    width: 100%;
  }
  .btn-primary-action {
    width: 100%;
    justify-content: center;
  }
  .category-cards-grid {
    grid-template-columns: 1fr;
  }
  .modal-dialog {
    max-width: calc(100vw - 24px);
    margin: 12px;
  }
}
