/* ==========================================================================
   DEZIGNZ — CLIENT PROGRESS PORTAL STYLES (css/track.css)
   بوابة متابعة مشاريع العملاء لحظة بلحظة
   ========================================================================== */

:root {
  --portal-bg: #0e0e0d;
  --portal-card: #151513;
  --portal-card-sub: #1c1c19;
  --portal-card-border: rgba(242, 238, 232, 0.1);
  --portal-accent: #c8b28f;
  --portal-accent-hover: #ddcaa8;
  --portal-accent-glow: rgba(200, 178, 143, 0.22);
  --portal-ink: #f2eee8;
  --portal-muted: #9a958c;
  --portal-success: #52b788;
  --portal-success-glow: rgba(82, 183, 136, 0.25);
  --portal-active: #e09f3e;
  --portal-active-glow: rgba(224, 159, 62, 0.25);
  --portal-pending: #6b6964;
  --portal-radius: 12px;
  --portal-transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

[data-theme="light"] {
  --portal-bg: #f8f6f2;
  --portal-card: #ffffff;
  --portal-card-sub: #f3efe8;
  --portal-card-border: rgba(24, 23, 21, 0.08);
  --portal-accent: #a37c4d;
  --portal-accent-hover: #b58d5d;
  --portal-accent-glow: rgba(163, 124, 77, 0.2);
  --portal-ink: #181715;
  --portal-muted: #6e6a63;
  --portal-pending: #a8a59f;
}

[data-theme="light"] .track-header__logo img {
  filter: none;
}
[data-theme="light"] .track-header {
  background: rgba(248, 246, 242, 0.88);
}

body.track-page {
  background-color: var(--portal-bg);
  color: var(--portal-ink);
  font-family: 'Cairo', "Manrope", system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  transition: background-color .35s ease, color .35s ease;
}

body.track-page button,
body.track-page input,
body.track-page select,
body.track-page textarea {
  font-family: 'Cairo', system-ui, -apple-system, sans-serif;
}

/* Background ambient luxury lighting */
body.track-page::before {
  content: "";
  position: fixed;
  top: -150px;
  right: -150px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(200, 178, 143, 0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
body.track-page::after {
  content: "";
  position: fixed;
  bottom: -200px;
  left: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(82, 183, 136, 0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ================= HEADER ================= */
.track-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(14, 14, 13, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--portal-card-border);
  padding: 18px var(--pad, 28px);
  transition: var(--portal-transition);
}

.track-header__inner {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.track-header__logo {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.track-header__logo img {
  height: 32px;
  width: auto;
  filter: invert(1);
}

.track-header__tag {
  font-size: 11px;
  letter-spacing: 0.15em;
  padding: 5px 12px;
  background: rgba(200, 178, 143, 0.1);
  color: var(--portal-accent);
  border: 1px solid rgba(200, 178, 143, 0.25);
  border-radius: 20px;
  font-weight: 500;
}

.track-header__actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.track-back-link {
  font-size: 13px;
  color: var(--portal-muted);
  transition: var(--portal-transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.track-back-link:hover {
  color: var(--portal-accent);
}

.track-admin-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--portal-card-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--portal-ink);
  transition: var(--portal-transition);
  cursor: pointer;
}

.track-admin-trigger:hover {
  border-color: var(--portal-accent);
  background: rgba(200, 178, 143, 0.1);
  color: var(--portal-accent);
}

/* ================= MAIN CONTAINER ================= */
.track-main {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 24px 80px;
  position: relative;
  z-index: 1;
}

/* ================= AUTH VIEW ================= */
.track-auth-card {
  min-height: 65vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 10px;
}

.auth-box {
  background: var(--portal-card);
  border: 1px solid var(--portal-card-border);
  border-radius: 20px;
  padding: clamp(36px, 6vw, 64px);
  max-width: 620px;
  width: 100%;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
}

.auth-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--portal-accent), transparent);
}

.auth-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(200, 178, 143, 0.1);
  border: 1px solid rgba(200, 178, 143, 0.3);
  display: grid;
  place-items: center;
  margin: 0 auto 24px;
  color: var(--portal-accent);
  box-shadow: 0 0 30px var(--portal-accent-glow);
}

.auth-label {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--portal-accent);
  margin-bottom: 14px;
}

.auth-title {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.auth-title em {
  font-family: var(--serif, "Cormorant Garamond", serif);
  font-style: italic;
  font-weight: 400;
  color: var(--portal-accent);
}

.auth-desc {
  color: var(--portal-muted);
  font-size: 14.5px;
  line-height: 1.7;
  max-width: 460px;
  margin: 0 auto 36px;
}

.auth-form {
  margin-bottom: 24px;
}

.auth-input-group {
  display: flex;
  gap: 12px;
  position: relative;
}

.auth-input-group input {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--portal-card-border);
  color: var(--portal-ink);
  padding: 16px 20px;
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  transition: var(--portal-transition);
  direction: ltr;
  text-align: center;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.auth-input-group input:focus {
  outline: none;
  border-color: var(--portal-accent);
  box-shadow: 0 0 20px var(--portal-accent-glow);
  background: rgba(200, 178, 143, 0.05);
}

.auth-input-group input::placeholder {
  direction: rtl;
  letter-spacing: normal;
  color: var(--portal-muted);
  font-weight: 400;
}

.auth-status {
  font-size: 13px;
  margin-top: 12px;
  min-height: 20px;
}

.auth-status.is-error {
  color: #ff6b6b;
}

.auth-status.is-success {
  color: var(--portal-success);
}

/* ================= LIVE DASHBOARD ================= */
.track-dashboard {
  animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Project Hero Card --- */
.project-hero-card {
  background: var(--portal-card);
  border: 1px solid var(--portal-card-border);
  border-radius: 20px;
  padding: clamp(28px, 4vw, 44px);
  margin-bottom: 40px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}

.project-hero-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  flex-wrap: wrap;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--portal-card-border);
}

.project-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  background: rgba(200, 178, 143, 0.1);
  border: 1px solid rgba(200, 178, 143, 0.25);
  color: var(--portal-accent);
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 14px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--portal-success);
  box-shadow: 0 0 10px var(--portal-success);
  display: inline-block;
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 14px var(--portal-success); }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.project-client-name {
  font-size: clamp(26px, 3.5vw, 42px);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 8px;
}

.project-address {
  font-size: 14.5px;
  color: var(--portal-muted);
}

/* --- Circular Progress Ring --- */
.project-progress-circle-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-ring-box {
  position: relative;
  width: 130px;
  height: 130px;
}

.progress-ring {
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}

.progress-ring__circle-bg {
  stroke: rgba(255, 255, 255, 0.06);
}

.progress-ring__circle {
  transition: stroke-dashoffset 1.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  stroke: var(--portal-accent);
}

.progress-ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.progress-number {
  font-family: var(--serif, "Cormorant Garamond", serif);
  font-size: 32px;
  font-weight: 600;
  line-height: 1;
  color: var(--portal-ink);
}

.progress-sub {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--portal-muted);
  margin-top: 4px;
}

/* --- Project Quick Stats Strip --- */
.project-stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  padding: 30px 0;
  border-bottom: 1px solid var(--portal-card-border);
}

.stat-box {
  background: var(--portal-card-sub);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 16px 20px;
}

.stat-box__label {
  display: block;
  font-size: 11.5px;
  color: var(--portal-muted);
  margin-bottom: 6px;
  letter-spacing: 0.05em;
}

.stat-box__val {
  display: block;
  font-size: 16px;
  color: var(--portal-ink);
  font-weight: 600;
}

/* --- WhatsApp Share Banner --- */
.project-share-banner {
  margin-top: 24px;
  background: rgba(200, 178, 143, 0.06);
  border: 1px dashed rgba(200, 178, 143, 0.3);
  border-radius: 12px;
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.share-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.share-icon {
  font-size: 24px;
}

.share-info strong {
  display: block;
  font-size: 14px;
  color: var(--portal-accent);
  margin-bottom: 2px;
}

.share-info p {
  font-size: 12.5px;
  color: var(--portal-muted);
  margin: 0;
}

.btn--sm {
  padding: 10px 18px;
  font-size: 11px;
}

/* ================= TIMELINE & MILESTONES ================= */
.milestones-section {
  background: var(--portal-card);
  border: 1px solid var(--portal-card-border);
  border-radius: 20px;
  padding: clamp(28px, 4vw, 44px);
  margin-bottom: 40px;
}

.milestones-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 36px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--portal-card-border);
}

.milestones-header h2 {
  font-size: clamp(24px, 3.5vw, 36px);
  font-weight: 600;
  margin-top: 6px;
}

.milestones-header h2 em {
  font-family: var(--serif, "Cormorant Garamond", serif);
  font-style: italic;
  font-weight: 400;
  color: var(--portal-accent);
}

.milestones-legend {
  display: flex;
  gap: 18px;
  font-size: 12px;
  color: var(--portal-muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-size: 10px;
  font-style: normal;
}

.status-icon.is-done {
  background: var(--portal-success-glow);
  color: var(--portal-success);
  border: 1px solid var(--portal-success);
}

.status-icon.is-active {
  background: var(--portal-active-glow);
  color: var(--portal-active);
  border: 1px solid var(--portal-active);
}

.status-icon.is-pending {
  background: rgba(255, 255, 255, 0.05);
  color: var(--portal-pending);
  border: 1px solid var(--portal-pending);
}

/* --- Milestones List / Timeline --- */
.milestones-list {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Vertical connecting line */
.milestones-list::before {
  content: "";
  position: absolute;
  top: 30px;
  bottom: 30px;
  right: 28px;
  width: 2px;
  background: rgba(255, 255, 255, 0.08);
  z-index: 0;
}

.milestone-card {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 24px;
  background: var(--portal-card-sub);
  border: 1px solid var(--portal-card-border);
  border-radius: 16px;
  padding: 24px 26px;
  transition: var(--portal-transition);
}

.milestone-card:hover {
  border-color: rgba(200, 178, 143, 0.35);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  transform: translateY(-2px);
}

.milestone-card.is-done {
  border-inline-start: 4px solid var(--portal-success);
}

.milestone-card.is-active {
  border-inline-start: 4px solid var(--portal-active);
  background: linear-gradient(135deg, rgba(224, 159, 62, 0.05), var(--portal-card-sub));
}

.milestone-card.is-pending {
  opacity: 0.65;
}

.milestone-node {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--portal-card);
  border: 2px solid var(--portal-card-border);
  display: grid;
  place-items: center;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: var(--portal-transition);
}

.milestone-card.is-done .milestone-node {
  border-color: var(--portal-success);
  background: var(--portal-success-glow);
  color: var(--portal-success);
}

.milestone-card.is-active .milestone-node {
  border-color: var(--portal-active);
  background: var(--portal-active-glow);
  color: var(--portal-active);
  animation: pulseDot 2.4s infinite;
}

.milestone-card.is-pending .milestone-node {
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--portal-pending);
}

.milestone-body {
  flex: 1;
  min-width: 0;
}

.milestone-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.milestone-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.milestone-phase-num {
  font-family: var(--serif, "Cormorant Garamond", serif);
  font-size: 18px;
  color: var(--portal-accent);
  font-weight: 500;
}

.milestone-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--portal-ink);
}

.milestone-status-badge {
  font-size: 11.5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 500;
}

.milestone-status-badge.is-done {
  background: var(--portal-success-glow);
  color: var(--portal-success);
  border: 1px solid rgba(82, 183, 136, 0.3);
}

.milestone-status-badge.is-active {
  background: var(--portal-active-glow);
  color: var(--portal-active);
  border: 1px solid rgba(224, 159, 62, 0.3);
}

.milestone-status-badge.is-pending {
  background: rgba(255, 255, 255, 0.05);
  color: var(--portal-muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.milestone-date {
  font-size: 12px;
  color: var(--portal-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.milestone-notes-preview {
  font-size: 13.5px;
  line-height: 1.6;
  color: rgba(242, 238, 232, 0.8);
  margin-bottom: 16px;
}

/* Milestone Photos Thumbnails Strip */
.milestone-thumbs-strip {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.milestone-thumb {
  width: 74px;
  height: 74px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--portal-card-border);
  position: relative;
  cursor: pointer;
  background: #000;
}

.milestone-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.milestone-thumb:hover img {
  transform: scale(1.1);
}

.milestone-thumb-count {
  width: 74px;
  height: 74px;
  border-radius: 8px;
  background: rgba(200, 178, 143, 0.15);
  border: 1px dashed var(--portal-accent);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--portal-accent);
  cursor: pointer;
  transition: var(--portal-transition);
}

.milestone-thumb-count:hover {
  background: var(--portal-accent);
  color: var(--portal-bg);
}

.milestone-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 8px 16px;
  border-radius: 6px;
  background: rgba(200, 178, 143, 0.1);
  color: var(--portal-accent);
  border: 1px solid rgba(200, 178, 143, 0.25);
  cursor: pointer;
  transition: var(--portal-transition);
}

.milestone-action-btn:hover {
  background: var(--portal-accent);
  color: var(--portal-bg);
}

/* ================= SITE CONTACT STRIP ================= */
.site-contact-strip {
  background: linear-gradient(135deg, rgba(200, 178, 143, 0.08), rgba(14, 14, 13, 0.95));
  border: 1px solid rgba(200, 178, 143, 0.25);
  border-radius: 20px;
  padding: 32px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.site-contact-strip h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 6px;
}

.site-contact-strip p {
  color: var(--portal-muted);
  font-size: 14px;
  margin: 0;
}

.site-contact-buttons {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* ================= PHASE INSPECTION MODAL ================= */
.phase-modal,
.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.phase-modal.is-open,
.admin-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.phase-modal__dialog {
  background: var(--portal-card);
  border: 1px solid rgba(200, 178, 143, 0.25);
  border-radius: 20px;
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  padding: clamp(28px, 4vw, 44px);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.8);
  transform: translateY(20px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.phase-modal.is-open .phase-modal__dialog,
.admin-modal.is-open .admin-modal__dialog {
  transform: translateY(0);
}

.phase-modal__close,
.admin-modal__close {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--portal-card-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--portal-ink);
  font-size: 24px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: var(--portal-transition);
}

.phase-modal__close:hover,
.admin-modal__close:hover {
  background: var(--portal-accent);
  color: var(--portal-bg);
  border-color: var(--portal-accent);
}

.phase-modal__header {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--portal-card-border);
}

.phase-num-badge {
  font-family: var(--serif, "Cormorant Garamond", serif);
  font-size: 38px;
  line-height: 1;
  color: var(--portal-accent);
  padding: 8px 16px;
  background: rgba(200, 178, 143, 0.1);
  border-radius: 12px;
  border: 1px solid rgba(200, 178, 143, 0.25);
}

.phase-status-pill {
  display: inline-block;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 14px;
  margin-bottom: 6px;
  background: var(--portal-success-glow);
  color: var(--portal-success);
}

.phase-modal__title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 4px;
}

.phase-modal__date {
  font-size: 12.5px;
  color: var(--portal-muted);
}

.phase-notes-card {
  background: var(--portal-card-sub);
  border: 1px solid var(--portal-card-border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}

.phase-notes-card h4 {
  font-size: 13.5px;
  color: var(--portal-accent);
  margin-bottom: 8px;
  font-weight: 600;
}

.phase-notes-card p {
  font-size: 14px;
  line-height: 1.7;
  color: rgba(242, 238, 232, 0.9);
  margin: 0;
}

.phase-gallery-wrap h4 {
  font-size: 14px;
  margin-bottom: 14px;
  color: var(--portal-ink);
}

.phase-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 30px;
}

.phase-gallery-item {
  aspect-ratio: 4/3;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--portal-card-border);
  cursor: pointer;
  position: relative;
  background: #000;
}

.phase-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.phase-gallery-item:hover img {
  transform: scale(1.08);
}

.phase-gallery-item-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 6px 10px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.85));
  font-size: 11px;
  color: #fff;
  opacity: 0;
  transition: opacity 0.3s;
}

.phase-gallery-item:hover .phase-gallery-item-caption {
  opacity: 1;
}

.phase-modal__actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 20px;
  border-top: 1px solid var(--portal-card-border);
}

/* ================= ADMIN MODAL ================= */
.admin-modal__dialog {
  background: var(--portal-card);
  border: 1px solid rgba(200, 178, 143, 0.3);
  border-radius: 20px;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  padding: clamp(28px, 4vw, 44px);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.85);
  transform: translateY(20px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-head {
  text-align: center;
  margin-bottom: 26px;
}

.admin-head--split {
  text-align: right;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--portal-card-border);
  padding-bottom: 18px;
}

.admin-badge {
  display: inline-block;
  font-size: 10.5px;
  letter-spacing: 0.2em;
  padding: 4px 12px;
  background: rgba(200, 178, 143, 0.1);
  color: var(--portal-accent);
  border-radius: 20px;
  margin-bottom: 10px;
  border: 1px solid rgba(200, 178, 143, 0.2);
}

.admin-head h3 {
  font-size: 22px;
  margin-bottom: 6px;
}

.admin-head p {
  font-size: 13.5px;
  color: var(--portal-muted);
}

#adminPinForm {
  max-width: 360px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#adminPinInput {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--portal-card-border);
  color: var(--portal-ink);
  padding: 14px 20px;
  border-radius: 10px;
  font-size: 20px;
  text-align: center;
  letter-spacing: 0.3em;
  font-weight: 600;
}

#adminPinInput:focus {
  outline: none;
  border-color: var(--portal-accent);
  box-shadow: 0 0 15px var(--portal-accent-glow);
}

.admin-error {
  color: #ff6b6b;
  font-size: 13px;
  text-align: center;
  min-height: 18px;
}

.w-full {
  width: 100%;
}

/* Admin Project Select Bar */
.admin-project-select-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--portal-card-sub);
  border-radius: 10px;
  margin-bottom: 24px;
  font-size: 13px;
}

.admin-project-select-bar select {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--portal-card-border);
  color: var(--portal-ink);
  padding: 8px 12px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
}

.admin-project-select-bar select:focus {
  outline: none;
  border-color: var(--portal-accent);
}

/* Admin Milestones Editor */
.admin-milestones-editor h4 {
  font-size: 14px;
  margin-bottom: 14px;
  color: var(--portal-accent);
}

.admin-milestone-rows {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 28px;
}

.admin-milestone-row {
  background: var(--portal-card-sub);
  border: 1px solid var(--portal-card-border);
  border-radius: 12px;
  padding: 18px 20px;
  transition: var(--portal-transition);
}

.admin-milestone-row:hover {
  border-color: rgba(200, 178, 143, 0.3);
}

.admin-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.admin-row-title {
  font-weight: 600;
  font-size: 15px;
}

.admin-row-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-select-status {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--portal-card-border);
  color: var(--portal-ink);
  padding: 6px 10px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 12px;
}

.admin-input-date {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--portal-card-border);
  color: var(--portal-ink);
  padding: 6px 10px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 12px;
}

.admin-notes-textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--portal-card-border);
  color: var(--portal-ink);
  border-radius: 8px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  min-height: 60px;
  margin-bottom: 12px;
}

.admin-notes-textarea:focus {
  outline: none;
  border-color: var(--portal-accent);
}

/* Photo upload area in admin */
.admin-photos-manager {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-photo-thumbs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-photo-thumb-item {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--portal-card-border);
}

.admin-photo-thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-photo-del-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 0, 0, 0.7);
  color: #fff;
  border: none;
  font-size: 12px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.admin-file-upload-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: rgba(200, 178, 143, 0.1);
  border: 1px dashed rgba(200, 178, 143, 0.4);
  border-radius: 6px;
  color: var(--portal-accent);
  font-size: 12px;
  cursor: pointer;
  align-self: flex-start;
  transition: var(--portal-transition);
}

.admin-file-upload-label:hover {
  background: rgba(200, 178, 143, 0.2);
}

.admin-file-input {
  display: none;
}

/* WhatsApp Dispatch in Admin */
.admin-whatsapp-dispatch {
  background: rgba(82, 183, 136, 0.08);
  border: 1px solid rgba(82, 183, 136, 0.25);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}

.admin-whatsapp-dispatch h4 {
  font-size: 14px;
  color: var(--portal-success);
  margin-bottom: 6px;
}

.admin-whatsapp-dispatch p {
  font-size: 12.5px;
  color: var(--portal-muted);
  margin-bottom: 14px;
}

.dispatch-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.dispatch-form select {
  flex: 1;
  min-width: 220px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--portal-card-border);
  color: var(--portal-ink);
  padding: 10px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
}

/* Admin Footer actions */
.admin-footer-actions {
  display: flex;
  justify-content: space-between;
  padding-top: 18px;
  border-top: 1px solid var(--portal-card-border);
}

.link-btn {
  font-size: 12px;
  color: var(--portal-muted);
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  transition: var(--portal-transition);
}

.link-btn:hover {
  color: var(--portal-ink);
}

.link-btn.text-danger {
  color: #ff6b6b;
}

/* ================= TOAST NOTIFICATION ================= */
.track-toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 200;
  background: var(--portal-ink);
  color: var(--portal-bg);
  padding: 14px 22px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideToast 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideToast {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ================= RESPONSIVE ================= */
@media (max-width: 768px) {
  .project-hero-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .project-progress-circle-wrap {
    width: 100%;
    margin-top: 10px;
  }

  .milestones-list::before {
    right: 20px;
  }

  .milestone-card {
    padding: 18px;
    gap: 14px;
  }

  .milestone-node {
    width: 38px;
    height: 38px;
    font-size: 13px;
  }

  .milestones-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-contact-strip {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-contact-buttons {
    width: 100%;
  }

  .site-contact-buttons .btn {
    width: 100%;
    justify-content: center;
  }

  .auth-input-group {
    flex-direction: column;
  }
}


/* ==========================================================================
   Match the main site: same header, Jost type, square cards, no glows
   ========================================================================== */
body.track-page,
body.track-page button,
body.track-page input,
body.track-page select,
body.track-page textarea { font-family: "Jost", "Cairo", system-ui, sans-serif; font-weight: 300; }
body.track-page::before, body.track-page::after { display: none; }
body.track-page .track-main { padding-top: 96px; }
.nav__links a.is-current { color: var(--accent) !important; }

body.track-page h1, body.track-page h2, body.track-page h3 { font-weight: 300; letter-spacing: -.01em; }
body.track-page em { font-family: "Cairo", system-ui, sans-serif; font-style: normal; font-weight: 600; color: var(--portal-accent); }
body.track-page .auth-title { font-size: clamp(26px, 3.2vw, 40px); }
body.track-page .project-client-name { font-size: clamp(24px, 3vw, 36px); }
body.track-page .section__label { font-size: 13px; letter-spacing: 0; color: var(--accent); }

.auth-box, .auth-input-group input, .project-hero-card, .stat-box, .project-share-banner,
.milestones-section, .milestone-card, .site-contact-strip, .phase-modal__dialog, .phase-notes-card { border-radius: 0; }

/* Milestone cost */
.milestone-cost { display: inline-flex; align-items: baseline; gap: 10px; margin: 4px 0 12px; padding: 8px 14px; border: 1px solid var(--portal-card-border); background: var(--portal-card-sub); font-size: 13px; color: var(--portal-muted); }
.milestone-cost strong { color: var(--portal-accent); font-size: 16px; font-weight: 500; }
.stat-box__sub { display: block; margin-top: 4px; font-size: 12px; color: var(--portal-muted); }
.adm-input-cost { max-width: 170px; }

/* English (left-to-right) version of the portal */
[dir="ltr"] .milestones-list::before { right: auto; left: 28px; }
[dir="ltr"] .auth-input-group input::placeholder { direction: ltr; }
[dir="ltr"] .admin-head--split { text-align: left; }
[dir="ltr"] body.track-page h1, [dir="ltr"] body.track-page h2, [dir="ltr"] body.track-page h3 { letter-spacing: -.01em; }
@media (max-width: 768px) {
  [dir="ltr"] .milestones-list::before { left: 20px; }
}

/* Footer credit on the client portal */
.footer--portal { position: relative; z-index: 1; justify-content: center; border-top: 0; padding-top: 0; }
.footer--portal .footer__credit { border-top: 1px solid var(--portal-card-border); }
