/* Asl Al Inaya - Design System & Stylesheet */
:root {
  --color-primary-dark: #1e352b;
  --color-primary-forest: #244135;
  --color-primary-olive: #486b3a;
  --color-primary-green: #709c2a;
  --color-primary-light: #9fcc52;
  --color-accent-berry: #9a2853;
  --color-bg-light: #f7f9f4;
  --color-bg-card: #ffffff;
  --color-text-main: #1d2b24;
  --color-text-muted: #5e7267;
  --color-border: #e3ebd9;
  --shadow-sm: 0 2px 8px rgba(30, 53, 43, 0.06);
  --shadow-md: 0 8px 24px rgba(30, 53, 43, 0.08);
  --shadow-lg: 0 16px 40px rgba(30, 53, 43, 0.12);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--color-bg-light);
  color: var(--color-text-main);
  direction: rtl;
  text-align: right;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Container */
.container {
  max-width: 1400px;
  width: 96%;
  margin: 0 auto;
  padding: 0 16px;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--color-primary-dark);
}

.brand-crest {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brand-logo-img {
  height: 48px;
  width: auto;
  object-fit: contain;
  display: block;
  transition: var(--transition);
}

.brand-logo:hover .brand-logo-img {
  transform: scale(1.04);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--color-primary-dark);
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.brand-subtitle {
  font-family: 'Outfit', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--color-primary-olive);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-link {
  text-decoration: none;
  color: var(--color-primary-forest);
  font-weight: 600;
  font-size: 1rem;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  position: relative;
}

.nav-link:hover, .nav-link.active {
  color: var(--color-primary-green);
  background: rgba(112, 156, 42, 0.08);
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--color-primary-forest);
  color: #ffffff;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  transition: var(--transition);
  box-shadow: 0 4px 14px rgba(36, 65, 53, 0.25);
}

.nav-cta:hover {
  background: var(--color-primary-green);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(112, 156, 42, 0.35);
  color: #ffffff;
}

/* Hero Section */
.hero {
  position: relative;
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, #15271f 100%);
  color: #ffffff;
  padding: 80px 0 100px;
  overflow: hidden;
}

.hero-pattern {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0.06;
  background-image: radial-gradient(#9fcc52 2px, transparent 2px);
  background-size: 32px 32px;
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(159, 204, 82, 0.15);
  color: var(--color-primary-light);
  border: 1px solid rgba(159, 204, 82, 0.3);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.hero-title {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 18px;
  color: #ffffff;
}

.hero-title span {
  color: var(--color-primary-light);
}

.hero-description {
  font-size: 1.15rem;
  color: #d1ded8;
  max-width: 650px;
  margin-bottom: 40px;
}

/* Quick Contact Card (contactUs) */
.quick-contact-box {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-lg);
  padding: 36px;
  max-width: 650px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.quick-contact-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.quick-contact-header h3 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #ffffff;
}

.quick-contact-desc {
  font-size: 0.95rem;
  color: #c4d6ce;
  margin-bottom: 20px;
}

.inline-form {
  display: flex;
  gap: 12px;
}

.input-wrapper {
  position: relative;
  flex: 1;
}

.inline-input {
  width: 100%;
  height: 52px;
  padding: 0 20px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.95);
  color: var(--color-text-main);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: var(--transition);
}

.inline-input:focus {
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 3px rgba(159, 204, 82, 0.35);
  background: #ffffff;
}

.btn-primary {
  height: 52px;
  padding: 0 28px;
  border-radius: var(--radius-full);
  background: var(--color-primary-green);
  color: #ffffff;
  border: none;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(112, 156, 42, 0.4);
}

.btn-primary:hover {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(159, 204, 82, 0.45);
}

/* Sections General */
.section {
  padding: 90px 0;
}

.section-header {
  text-align: center;
  max-width: 650px;
  margin: 0 auto 50px;
}

.section-badge {
  display: inline-block;
  color: var(--color-primary-olive);
  background: rgba(72, 107, 58, 0.1);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.section-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--color-primary-dark);
  margin-bottom: 14px;
}

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

/* Send Message Section */
.send-message-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.form-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-md);
}

.form-group {
  margin-bottom: 22px;
}

.form-label {
  display: block;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--color-primary-forest);
  margin-bottom: 8px;
}

.form-input, .form-textarea {
  width: 100%;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1.5px solid #dce4d5;
  background: #ffffff;
  color: var(--color-text-main);
  font-family: inherit;
  font-size: 0.98rem;
  outline: none;
  transition: var(--transition);
}

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

.form-input:focus, .form-textarea:focus {
  border-color: var(--color-primary-green);
  box-shadow: 0 0 0 4px rgba(112, 156, 42, 0.12);
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.btn-submit {
  width: 100%;
  height: 52px;
  border-radius: var(--radius-sm);
  background: var(--color-primary-forest);
  color: #ffffff;
  border: none;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}

.btn-submit:hover {
  background: var(--color-primary-green);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Info Column */
.info-card {
  background: var(--color-primary-forest);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 40px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.info-card h3 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 12px;
  color: #ffffff;
}

.info-card p {
  color: #c9ded3;
  margin-bottom: 30px;
  font-size: 0.98rem;
}

.contact-info-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 36px;
}

.contact-info-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.info-icon {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--color-primary-light);
}

.info-label {
  font-size: 0.82rem;
  color: #a7c4b6;
  margin-bottom: 2px;
}

.info-val {
  font-weight: 700;
  font-size: 1.05rem;
  color: #ffffff;
  direction: ltr;
  text-align: right;
}

.branches-preview {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 24px;
}

.branches-preview h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--color-primary-light);
}

.branch-item {
  font-size: 0.92rem;
  color: #dbebe2;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Branch Cards Section */
.branches-section {
  background: #ffffff;
  border-top: 1px solid var(--color-border);
}

.branches-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.branch-box {
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 28px;
  transition: var(--transition);
}

.branch-box:hover {
  transform: translateY(-4px);
  border-color: var(--color-primary-green);
  box-shadow: var(--shadow-md);
}

.branch-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-primary-dark);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.branch-address {
  font-size: 0.92rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

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

.toast {
  background: #ffffff;
  border-right: 5px solid var(--color-primary-green);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-sm);
  padding: 16px 22px;
  min-width: 320px;
  display: flex;
  align-items: center;
  gap: 14px;
  transform: translateX(-120%);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast.error {
  border-right-color: var(--color-accent-berry);
}

.toast-icon {
  font-size: 1.4rem;
}

.toast-content h5 {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--color-primary-dark);
}

.toast-content p {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* Footer */
.footer {
  background: var(--color-primary-dark);
  color: #ffffff;
  padding: 40px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.footer-copy {
  font-size: 0.88rem;
  color: #a2b8ad;
}

/* Responsive */
@media (max-width: 900px) {
  .send-message-grid {
    grid-template-columns: 1fr;
  }
  .branches-grid {
    grid-template-columns: 1fr;
  }
  .hero-title {
    font-size: 2.2rem;
  }
  .nav-links {
    display: none;
  }
  .inline-form {
    flex-direction: column;
  }
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
}

/* ==========================================
   Clean Header & Modern Segmented Nav Dock
   ========================================== */
.dashboard-header-clean {
  background: linear-gradient(135deg, #14251e 0%, #1c352a 50%, #122119 100%);
  color: #ffffff;
  padding: 14px 0;
  margin-bottom: 22px;
  border-bottom: 1px solid rgba(159, 204, 82, 0.25);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

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

.header-title-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dashboard-main-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0;
  color: #ffffff;
  letter-spacing: -0.3px;
}

.header-actions-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.last-sync-time {
  font-size: 0.84rem;
  font-weight: 600;
  color: #cde2d6;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  user-select: none;
  font-family: 'Outfit', 'Tajawal', sans-serif;
}

.btn-clean-refresh {
  height: 38px;
  padding: 0 18px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-clean-refresh:hover {
  background: var(--color-primary-green);
  border-color: var(--color-primary-green);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(112, 156, 42, 0.35);
}

.btn-clean-refresh svg.spinning {
  animation: spinRefresh 0.75s linear infinite;
}

@keyframes spinRefresh {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Modern Segmented Navigation Dock */
.dashboard-segmented-nav {
  margin-bottom: 22px;
  display: flex;
  justify-content: center;
}

.segmented-track {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #eef3ef;
  padding: 5px;
  border-radius: 16px;
  border: 1.5px solid #d4e3d8;
  width: 100%;
  max-width: 580px;
  box-shadow: inset 0 2px 5px rgba(24, 46, 37, 0.05);
}

.segmented-tab-btn {
  flex: 1;
  height: 48px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1.5px solid transparent;
  background: transparent;
  color: #4b6657;
  font-family: inherit;
  font-size: 0.96rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  outline: none;
}

.segmented-tab-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.7);
  color: #1a3027;
}

.segmented-tab-btn.active {
  background: #ffffff;
  color: #1a3027;
  border-color: rgba(112, 156, 42, 0.35);
  box-shadow: 0 4px 16px rgba(24, 46, 37, 0.12), 0 1px 3px rgba(0, 0, 0, 0.04);
}

.segmented-icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #709c2a;
  transition: transform 0.2s ease;
}

.segmented-tab-btn.active .segmented-icon-box {
  transform: scale(1.1);
}

.segmented-title {
  white-space: nowrap;
}

.segmented-counter {
  min-width: 26px;
  height: 24px;
  padding: 0 8px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.84rem;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  transition: all 0.2s ease;
}

.segmented-tab-btn.active .segmented-counter {
  background: #eef7e6;
  color: #38600d;
  border: 1px solid #c8e4ad;
}

.segmented-tab-btn:not(.active) .segmented-counter {
  background: #d8e4dc;
  color: #4b6356;
}

@media (max-width: 640px) {
  .segmented-track {
    max-width: 100%;
    padding: 4px;
    gap: 4px;
  }

  .segmented-tab-btn {
    height: 44px;
    font-size: 0.88rem;
    gap: 6px;
    padding: 0 8px;
  }

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

/* Compact Table Card & Fit Viewport */
.table-card {
  background: #ffffff;
  border: 1px solid #dce8df;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(24, 46, 37, 0.05);
  overflow: hidden;
  margin-bottom: 28px;
}

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

.data-table {
  width: 100%;
  min-width: 960px;
  border-collapse: collapse;
  text-align: right;
}

html[dir="rtl"] .data-table {
  text-align: right;
}

html[dir="ltr"] .data-table {
  text-align: left;
}

.data-table th {
  background: #f2f7f3;
  color: #1a3027;
  font-weight: 800;
  font-size: 0.88rem;
  padding: 13px 16px;
  border-bottom: 2px solid #d8e5dc;
  white-space: nowrap;
  text-align: inherit;
}

.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid #edf3ee;
  font-size: 0.88rem;
  vertical-align: middle;
  text-align: inherit;
}

.data-table tbody tr {
  transition: background-color 0.18s ease;
}

.data-table tbody tr:hover {
  background: #f7faf6;
}

/* Explicit Column Proportions */
.col-seq {
  width: 48px;
  min-width: 48px;
  text-align: center !important;
}

.col-name {
  width: 14%;
  min-width: 120px;
  white-space: nowrap;
}

.col-contact {
  width: 18%;
  min-width: 160px;
}

.col-message {
  width: 32%;
  min-width: 220px;
  max-width: 420px;
}

.col-subject {
  width: 12%;
  min-width: 110px;
  white-space: nowrap;
}

.col-branch {
  width: 10%;
  min-width: 100px;
  white-space: nowrap;
}

.col-date {
  width: 14%;
  min-width: 130px;
  white-space: nowrap;
}

.col-email {
  width: 50%;
  min-width: 240px;
}

.col-regdate {
  width: 45%;
  min-width: 160px;
  white-space: nowrap;
}

/* Clean Message Text Bubble */
.table-msg-text {
  max-width: 380px;
  word-break: break-word;
  overflow-wrap: break-word;
  line-height: 1.5;
  color: #243c30;
  font-size: 0.88rem;
}

/* Sequence badge for row numbering */
.seq-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 28px;
  padding: 0 8px;
  background: #edf3eb;
  color: #1a3027;
  border: 1px solid #d0ded4;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1.4;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  background: currentColor;
}

.status-badge.new {
  background: #eaf8ee;
  color: #15803d;
  border: 1px solid #bbf0cb;
}

.status-badge.inprogress {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

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

.status-badge.closed {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* Status Action Select */
.status-select-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-select {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--color-border);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  background-color: #ffffff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23244135' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 10px;
  color: var(--color-text-main);
  outline: none;
  cursor: pointer;
  transition: var(--transition);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

html[dir="rtl"] .status-select,
[dir="rtl"] .status-select {
  background-position: left 8px center;
  padding: 6px 8px 6px 24px;
}

html[dir="ltr"] .status-select,
[dir="ltr"] .status-select {
  background-position: right 8px center;
  padding: 6px 24px 6px 8px;
}

.status-select:focus {
  border-color: var(--color-primary-green);
}

.btn-update-status {
  padding: 6px 14px;
  background: var(--color-primary-forest);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-update-status:hover {
  background: var(--color-primary-green);
}

/* Empty State & Loader */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.loading-spinner {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-primary-green);
  font-weight: 700;
  font-size: 1.1rem;
}

/* Modal Overlay & Dialog */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(18, 36, 28, 0.7);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  background: #ffffff;
  border-radius: 20px;
  width: 100%;
  max-width: 460px;
  padding: 30px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(112, 156, 42, 0.25);
  animation: modalFadeIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-15px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid #edf2ee;
}

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

.modal-crest {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #edf5eb;
  border: 1px solid #bdd7b6;
  color: #709c2a;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-title {
  margin: 0;
  color: #1a3027;
  font-size: 1.2rem;
  font-weight: 800;
}

.modal-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f4f6f4;
  border: none;
  font-size: 1.3rem;
  line-height: 1;
  color: #666;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background: #fee2e2;
  color: #ef4444;
}

.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrap .form-input {
  padding-right: 44px;
}

html[dir="ltr"] .password-input-wrap .form-input {
  padding-right: 14px;
  padding-left: 44px;
}

.btn-toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #889f92;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

html[dir="ltr"] .btn-toggle-password {
  right: auto;
  left: 10px;
}

.btn-toggle-password:hover {
  color: var(--color-primary-green);
}

.pass-match-hint {
  font-size: 0.8rem;
  font-weight: 700;
  margin-top: 6px;
}

.pass-match-hint.error {
  color: #dc2626;
}

.pass-match-hint.success {
  color: #15803d;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.modal-btn-submit {
  flex: 1;
  padding: 12px 18px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
}

.modal-btn-cancel {
  flex: 1;
  padding: 12px 18px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  background: #f1f5f2;
  color: #3f5549;
  border: 1px solid #d4e2d8;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-btn-cancel:hover {
  background: #e2ede4;
  color: #1a3027;
}

/* ==========================================
   Zero-FOUC Instant Screen Visibility Rules
   ========================================== */
html.auth-authenticated #loginScreen {
  display: none !important;
}

html.auth-authenticated #dashboardScreen {
  display: block !important;
}

html.auth-unauthenticated #loginScreen {
  display: flex !important;
}

html.auth-unauthenticated #dashboardScreen {
  display: none !important;
}

/* Fullscreen Login Screen */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 20%, #254236 0%, #172a22 60%, #101d17 100%);
  padding: 24px;
}

.login-card {
  background: #ffffff;
  border-radius: 20px;
  width: 100%;
  max-width: 440px;
  padding: 40px 32px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(112, 156, 42, 0.3);
  text-align: center;
}

.login-crest {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.login-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--color-primary-dark);
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 28px;
}

/* Brand Crest */
.brand-crest {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ==========================================
   Creative Header Action Dock & Pill Controls
   ========================================== */
.header-nav-dock {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Compact Language Toggle Button */
.btn-lang-compact {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #edf5ee;
  color: #1a3027;
  border: 1.5px solid #bdd7b6;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-family: 'Outfit', 'Tajawal', sans-serif;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(24, 46, 37, 0.04);
}

.btn-lang-compact:hover {
  background: #ffffff;
  border-color: #709c2a;
  color: #709c2a;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(112, 156, 42, 0.2);
}

.btn-lang-compact svg {
  color: #709c2a;
}

/* Dock Divider */
.dock-divider {
  width: 1px;
  height: 24px;
  background: #d8e6dc;
  margin: 0 2px;
}

/* Minimal Clean Admin User Display */
.admin-user-simple {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #f4f8f5;
  border: 1px solid #d8e6dc;
  color: #1a3027;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.86rem;
  font-weight: 700;
  user-select: none;
  font-family: 'Outfit', 'Tajawal', sans-serif;
}

.admin-user-simple svg {
  color: #709c2a;
}

/* Icon-Only Action Buttons */
.btn-icon-action {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: #244135;
  border: 1.5px solid #c8dbce;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(24, 46, 37, 0.04);
}

.btn-icon-action:hover {
  background: #edf5eb;
  border-color: #709c2a;
  color: #1a3027;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(112, 156, 42, 0.22);
}

.btn-icon-action svg {
  color: #709c2a;
  transition: transform 0.2s ease;
}

.btn-icon-action:hover svg {
  transform: rotate(-15deg);
}

.btn-icon-logout {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fdf2f2;
  color: #b91c1c;
  border: 1.5px solid #fecaca;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-icon-logout:hover {
  background: #b91c1c;
  color: #ffffff;
  border-color: #b91c1c;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(185, 28, 28, 0.28);
}

.btn-icon-logout svg {
  stroke: currentColor;
  transition: transform 0.2s ease;
}

.btn-icon-logout:hover svg {
  transform: translateX(-2px);
}

html[dir="ltr"] .btn-icon-logout:hover svg {
  transform: translateX(2px);
}

/* LTR / English Mode Support */
html[dir="ltr"] body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  direction: ltr;
  text-align: left;
}

html[dir="ltr"] .data-table {
  text-align: left;
}

html[dir="ltr"] .toolbar-search .search-icon {
  right: auto;
  left: 14px;
}

html[dir="ltr"] .toolbar-input {
  padding-left: 40px;
  padding-right: 14px;
}

html[dir="ltr"] .btn-toolbar-clear {
  right: 10px;
  left: auto;
}

html[dir="ltr"] #loginForm {
  text-align: left;
}

html[dir="ltr"] #changePasswordForm {
  text-align: left;
}

/* Table Toolbar (Search, Filter, PageSize) */
/* Table Toolbar (Search, Filters, PageSize, Excel) */
.table-toolbar {
  padding: 12px 18px;
  background: #fbfdfb;
  border-bottom: 1px solid #e7eee6;
}

.table-toolbar-unified {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
}

.table-toolbar-unified .toolbar-search {
  position: relative;
  flex: 1 1 200px;
  min-width: 170px;
  max-width: 280px;
}

.toolbar-search .search-icon {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  pointer-events: none;
}

.toolbar-input {
  width: 100%;
  height: 38px;
  padding: 0 36px 0 12px;
  border: 1.5px solid #d5e2d8;
  border-radius: 9px;
  font-family: inherit;
  font-size: 0.86rem;
  background: #ffffff;
  color: var(--color-text-main);
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.toolbar-input:focus {
  border-color: #709c2a;
  box-shadow: 0 0 0 3px rgba(112, 156, 42, 0.15);
}

.btn-toolbar-clear {
  position: absolute;
  top: 50%;
  left: 8px;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 1.1rem;
  color: #999;
  cursor: pointer;
  padding: 0 4px;
}

.btn-toolbar-clear:hover {
  color: #333;
}

.toolbar-filters-unified {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  flex: 2 1 auto;
  justify-content: flex-end;
}

.toolbar-select {
  height: 38px;
  border: 1.5px solid #d5e2d8;
  border-radius: 9px;
  background-color: #ffffff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23244135' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 11px;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--color-text-main);
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-sizing: border-box;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* RTL Arrow & Text Padding */
html[dir="rtl"] .toolbar-select,
[dir="rtl"] .toolbar-select {
  background-position: left 10px center;
  padding: 0 10px 0 26px;
}

/* LTR Arrow & Text Padding */
html[dir="ltr"] .toolbar-select,
[dir="ltr"] .toolbar-select {
  background-position: right 10px center;
  padding: 0 26px 0 10px;
}

.toolbar-select:hover {
  border-color: #a3c485;
  background-color: #fcfdfc;
}

.toolbar-select:focus {
  border-color: #709c2a;
  box-shadow: 0 0 0 3px rgba(112, 156, 42, 0.15);
  background-color: #ffffff;
}

/* Proportional Sizing */
#messagesPageSize, #contactsPageSize {
  max-width: 95px;
}

#messagesSortOrder, #contactsSortOrder {
  max-width: 125px;
}

#messagesDatePreset, #contactsDatePreset {
  max-width: 135px;
}

#messagesBranchFilter, #messagesSubjectFilter {
  max-width: 155px;
}

.btn-toolbar-reset {
  height: 38px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1.5px solid #d0dfd3;
  border-radius: 9px;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.btn-toolbar-reset:hover {
  background: #edf5e8;
  color: #1a3027;
  border-color: #709c2a;
}

.btn-icon-excel {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 9px;
  background: #107c41;
  color: #ffffff;
  border: 1.5px solid #0e6b37;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(16, 124, 65, 0.25);
  flex-shrink: 0;
}

.btn-icon-excel:hover {
  background: #0e6b37;
  transform: translateY(-1.5px);
  box-shadow: 0 5px 14px rgba(16, 124, 65, 0.35);
}

.toolbar-date-group {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
}

.toolbar-input-date {
  height: 38px;
  padding: 0 8px;
  border: 1.5px solid #d5e2d8;
  border-radius: 9px;
  background: #ffffff;
  font-family: inherit;
  font-size: 0.82rem;
  color: var(--color-text-main);
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-sizing: border-box;
  min-width: 120px;
}

.toolbar-input-date:focus {
  border-color: #709c2a;
  box-shadow: 0 0 0 3px rgba(112, 156, 42, 0.15);
}

.date-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-text-muted);
}



/* Table Pagination Bar */
.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding: 16px 20px;
  background: #f9fbf7;
  border-top: 1px solid var(--color-border);
}

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

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-page {
  padding: 7px 14px;
  background: #ffffff;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  cursor: pointer;
  transition: var(--transition);
}

.btn-page:hover:not(:disabled) {
  background: var(--color-primary-forest);
  color: #ffffff;
  border-color: var(--color-primary-forest);
}

.btn-page:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.page-numbers {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-num {
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--color-border);
  background: #ffffff;
  color: var(--color-primary-dark);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.page-num:hover:not(.active) {
  background: #edf5e8;
  border-color: #709c2a;
}

.page-num.active {
  background: var(--color-primary-forest);
  color: #ffffff;
  border-color: var(--color-primary-forest);
}

/* ==========================================
   Icon-Only Excel Export Button & Table Badges
   ========================================== */
.btn-icon-excel {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 10px;
  background: #107c41;
  color: #ffffff;
  border: 1.5px solid #0e6b37;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(16, 124, 65, 0.25);
  flex-shrink: 0;
}

.btn-icon-excel:hover {
  background: #0e6b37;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 124, 65, 0.4);
}

.btn-icon-excel svg {
  color: #ffffff;
  stroke: #ffffff;
  transition: transform 0.2s ease;
}

.btn-icon-excel:hover svg {
  transform: scale(1.12);
}

/* Refined Table Badges & Cell Actions */
.branch-pill {
  display: inline-flex;
  align-items: center;
  background: #edf5eb;
  color: #244135;
  border: 1px solid #c8dbce;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.subject-pill {
  display: inline-flex;
  align-items: center;
  color: var(--color-primary-dark);
  font-weight: 700;
  font-size: 0.9rem;
}

.copyable-contact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: all;
  border-radius: 4px;
  padding: 1px 4px;
}

.copyable-contact:hover {
  background: rgba(112, 156, 42, 0.12);
}

.copyable-contact svg {
  opacity: 0.45;
  flex-shrink: 0;
  transition: opacity 0.2s ease;
}

.copyable-contact:hover svg {
  opacity: 1;
  color: #709c2a;
}

/* ==========================================
   Unified Single-Row Toolbar & DateTime Styling
   ========================================== */


/* Modern 2-Line DateTime Cell */
.datetime-cell {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  line-height: 1.3;
}

.datetime-date {
  font-weight: 700;
  color: var(--color-primary-dark);
  font-size: 0.88rem;
  white-space: nowrap;
}

.datetime-time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #72847a;
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
}

.datetime-time svg {
  opacity: 0.7;
  color: #709c2a;
}

/* Modern Full-Width Modal Submit CTA */
.modal-btn-submit-modern {
  width: 100%;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, #1f4037 0%, #152d27 100%);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(21, 45, 39, 0.25);
}

.modal-btn-submit-modern:hover {
  background: linear-gradient(135deg, #285549 0%, #1a3830 100%);
  box-shadow: 0 6px 18px rgba(21, 45, 39, 0.35);
  transform: translateY(-1.5px);
}

.modal-btn-submit-modern:active {
  transform: translateY(0);
}

/* ==========================================
   Custom Date Range Modal Styling
   ========================================== */
.modal-card-date {
  max-width: 460px;
}

.modal-date-input {
  cursor: pointer;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-primary-dark);
}

.date-quick-presets {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.btn-date-quick {
  background: #edf5eb;
  border: 1px solid #cce0d2;
  color: #244135;
  padding: 5px 11px;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-date-quick:hover {
  background: var(--color-primary-forest);
  border-color: var(--color-primary-forest);
  color: #ffffff;
  transform: translateY(-1px);
}

