/* ==============================
   Vaidehi Group Portal — Executive Dark Theme Dashboard
   ============================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@200;300;400;500;600&family=Outfit:wght@200;300;400;500;600;700&display=swap');

:root {
  --p-bg: #000000;         /* Pure Pitch Black Void */
  --p-surface: #0D1117;    /* Frosted Glass Obsidian */
  --p-surface-2: #161B22;  /* Panel Level 2 */
  --p-surface-3: #21262D;  /* Panel Level 3 */
  --p-border: rgba(255, 255, 255, 0.12);
  --p-border-hover: rgba(16, 185, 129, 0.35);
  --p-text: #F8FAFC;       /* Bone White */
  --p-text-muted: #94A3B8; /* Slate Silver */
  --p-text-dim: #64748B;
  --p-accent: #10B981;     /* Emerald */
  --p-blue: #3B82F6;
  --p-purple: #A855F7;
  --p-amber: #F59E0B;
  --p-cyan: #06B6D4;
  --p-green: #10B981;
  --p-red: #EF4444;
  --f-heading: 'Outfit', sans-serif;
  --f-body: 'Inter', sans-serif;
  --radius: 8px;
  --radius-lg: 14px;
  --trans: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--f-body);
  background: var(--p-bg);
  color: var(--p-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
h1,h2,h3,h4,h5 {
  font-family: var(--f-heading);
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--p-text);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ===== Login Page ===== */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000000;
  position: relative;
  overflow: hidden;
}
.login-bg-pattern {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(16, 185, 129, 0.12) 0%, transparent 55%),
              radial-gradient(ellipse at 70% 50%, rgba(59, 130, 246, 0.1) 0%, transparent 55%);
}
.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  padding: 3rem;
  background: rgba(13, 17, 23, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(24px);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(16, 185, 129, 0.1);
}
.login-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
  justify-content: center;
}
.login-logo img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 8px;
}
.login-logo span {
  font-family: var(--f-heading);
  font-size: 1.3rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}
.login-title {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  text-align: center;
}
.login-subtitle {
  color: var(--p-text-muted);
  text-align: center;
  margin-bottom: 2rem;
  font-size: 0.95rem;
}
.login-form .form-field {
  margin-bottom: 1.5rem;
}
.login-form label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--p-text-muted);
  margin-bottom: 0.5rem;
}
.login-form input {
  width: 100%;
  padding: 0.9rem 1rem;
  background: var(--p-surface-2);
  border: 1px solid var(--p-border);
  border-radius: var(--radius);
  color: var(--p-text);
  font-family: var(--f-body);
  font-size: 1rem;
  outline: none;
  transition: border-color var(--trans);
}
.login-form input:focus {
  border-color: var(--p-text);
}
.login-form input::placeholder {
  color: var(--p-text-dim);
}
.login-error {
  display: none;
  color: var(--p-red);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  text-align: center;
  padding: 0.75rem;
  background: rgba(239,68,68,0.08);
  border-radius: var(--radius);
}
.login-error.show { display: block; }
.login-btn {
  width: 100%;
  padding: 1rem;
  background: var(--p-text);
  color: var(--p-bg);
  border: none;
  border-radius: var(--radius);
  font-family: var(--f-body);
  font-size: 0.95rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all var(--trans);
}
.login-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}
.login-footer {
  margin-top: 2rem;
  text-align: center;
}
.login-footer a {
  color: var(--p-text-muted);
  font-size: 0.85rem;
  transition: color var(--trans);
}
.login-footer a:hover { color: var(--p-text); }
.login-lang {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 10;
}
.login-demo-info {
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--p-surface-2);
  border: 1px solid var(--p-border);
  border-radius: var(--radius);
  font-size: 0.78rem;
  color: var(--p-text-muted);
  line-height: 1.7;
}
.login-demo-info strong { color: var(--p-text); font-weight: 500; }

/* ===== Portal Layout ===== */
.portal-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--p-surface);
  border-right: 1px solid var(--p-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}
.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--p-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.sidebar-header img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 6px;
}
.sidebar-header span {
  font-family: var(--f-heading);
  font-size: 1rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}
.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
  overflow-y: auto;
}
.sidebar-nav .nav-section {
  padding: 0.5rem 1.5rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--p-text-dim);
  margin-top: 1rem;
}
.sidebar-nav .nav-section:first-child { margin-top: 0; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
  color: var(--p-text-muted);
  transition: all var(--trans);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--f-body);
}
.nav-item:hover { color: var(--p-text); background: var(--p-surface-2); }
.nav-item.active { color: var(--p-text); background: var(--p-surface-2); border-right: 2px solid var(--p-text); }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--p-border);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--p-surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--p-text);
  border: 1px solid var(--p-border);
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 0.85rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 0.72rem; color: var(--p-text-muted); text-transform: uppercase; letter-spacing: 0.08em; }

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 2rem;
  min-height: 100vh;
}
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--p-border);
}
.page-title {
  font-size: 1.8rem;
  font-weight: 400;
}
.page-actions { display: flex; gap: 0.75rem; align-items: center; }

/* Mobile sidebar toggle */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 101;
  width: 40px;
  height: 40px;
  background: var(--p-surface);
  border: 1px solid var(--p-border);
  border-radius: var(--radius);
  color: var(--p-text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.sidebar-toggle svg { width: 20px; height: 20px; }

/* ===== Cards ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--p-surface);
  border: 1px solid var(--p-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: border-color var(--trans);
}
.stat-card:hover { border-color: var(--p-border-hover); }
.stat-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--p-text-muted);
  margin-bottom: 0.5rem;
}
.stat-value {
  font-family: var(--f-heading);
  font-size: 2.2rem;
  font-weight: 300;
  letter-spacing: -0.03em;
}
.stat-change {
  font-size: 0.8rem;
  color: var(--p-green);
  margin-top: 0.25rem;
}

/* ===== Data Table ===== */
.data-section {
  background: var(--p-surface);
  border: 1px solid var(--p-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.data-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--p-border);
}
.data-section-title {
  font-size: 1.1rem;
  font-weight: 400;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th {
  padding: 0.75rem 1.5rem;
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--p-text-muted);
  font-weight: 500;
  background: var(--p-surface-2);
  border-bottom: 1px solid var(--p-border);
}
.data-table td {
  padding: 1rem 1.5rem;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--p-border);
  color: var(--p-text);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--p-surface-2); }

/* Status Badge */
.status-badge {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-enquiry { background: rgba(107,107,107,0.15); color: #999; }
.badge-confirmed { background: rgba(74,158,255,0.12); color: var(--p-blue); }
.badge-design { background: rgba(168,85,247,0.12); color: var(--p-purple); }
.badge-construction { background: rgba(245,158,11,0.12); color: var(--p-amber); }
.badge-inspection { background: rgba(34,211,238,0.12); color: var(--p-cyan); }
.badge-handover, .badge-completed { background: rgba(16,185,129,0.12); color: var(--p-green); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border: 1px solid var(--p-border);
  background: transparent;
  color: var(--p-text);
  font-family: var(--f-body);
  font-size: 0.82rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--trans);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 400;
  white-space: nowrap;
}
.btn:hover { background: var(--p-surface-2); border-color: var(--p-border-hover); }
.btn svg { width: 16px; height: 16px; }
.btn-primary {
  background: var(--p-text);
  color: var(--p-bg);
  border-color: var(--p-text);
}
.btn-primary:hover { opacity: 0.9; background: var(--p-text); }
.btn-danger { border-color: var(--p-red); color: var(--p-red); }
.btn-danger:hover { background: rgba(239,68,68,0.1); }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.75rem; }

/* ===== Progress Bar ===== */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--p-surface-3);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--p-blue), var(--p-purple));
  transition: width 0.6s ease;
}
.progress-text {
  font-size: 0.8rem;
  color: var(--p-text-muted);
  margin-top: 0.3rem;
}

/* ===== Timeline ===== */
.timeline {
  position: relative;
  padding-left: 2rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--p-border);
}
.timeline-item {
  position: relative;
  padding-bottom: 2rem;
  padding-left: 1.5rem;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute;
  left: -2rem;
  top: 0.2rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--p-border);
  background: var(--p-bg);
  z-index: 1;
}
.timeline-dot.completed {
  background: var(--p-green);
  border-color: var(--p-green);
}
.timeline-dot.current {
  background: var(--p-amber);
  border-color: var(--p-amber);
  box-shadow: 0 0 12px rgba(245,158,11,0.3);
}
.timeline-phase {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--p-text-muted);
  margin-bottom: 0.25rem;
}
.timeline-title {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}
.timeline-desc {
  font-size: 0.85rem;
  color: var(--p-text-muted);
  font-weight: 300;
}
.timeline-date {
  font-size: 0.78rem;
  color: var(--p-text-dim);
  margin-top: 0.25rem;
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--p-surface);
  border: 1px solid var(--p-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  animation: modalIn 0.3s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid var(--p-border);
}
.modal-title { font-size: 1.2rem; }
.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--p-border);
  border-radius: var(--radius);
  color: var(--p-text);
  cursor: pointer;
  transition: all var(--trans);
}
.modal-close:hover { background: var(--p-surface-2); }
.modal-body { padding: 1.5rem; }
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--p-border);
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* ===== Form Fields (Portal) ===== */
.field { margin-bottom: 1.25rem; }
.field label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--p-text-muted);
  margin-bottom: 0.5rem;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--p-surface-2);
  border: 1px solid var(--p-border);
  border-radius: var(--radius);
  color: var(--p-text);
  font-family: var(--f-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--trans);
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--p-text);
}
.field select {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%236B6B6B' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.field select option { background: var(--p-surface); }
.field textarea { resize: vertical; min-height: 80px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ===== Language Switcher ===== */
.lang-switcher { position: relative; }
.lang-current {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--p-surface-2);
  border: 1px solid var(--p-border);
  border-radius: var(--radius);
  color: var(--p-text);
  font-family: var(--f-body);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all var(--trans);
}
.lang-current:hover { border-color: var(--p-border-hover); }
.lang-flag { font-size: 1rem; }
.lang-arrow { transition: transform 0.2s; }
.lang-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: var(--p-surface);
  border: 1px solid var(--p-border);
  border-radius: var(--radius);
  min-width: 180px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 200;
}
.lang-dropdown.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}
.lang-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  width: 100%;
  border: none;
  background: none;
  color: var(--p-text-muted);
  font-family: var(--f-body);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--trans);
  text-align: left;
}
.lang-option:hover { background: var(--p-surface-2); color: var(--p-text); }
.lang-option.active { color: var(--p-text); background: var(--p-surface-2); }

/* ===== Project Card (for Employee/Customer) ===== */
.project-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1rem;
}
.project-card {
  background: var(--p-surface);
  border: 1px solid var(--p-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all var(--trans);
  cursor: pointer;
}
.project-card:hover { border-color: var(--p-border-hover); transform: translateY(-2px); }
.project-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.project-card-id {
  font-size: 0.75rem;
  color: var(--p-text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.project-card-name {
  font-family: var(--f-heading);
  font-size: 1.3rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
}
.project-card-meta {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1rem;
  font-size: 0.82rem;
  color: var(--p-text-muted);
}
.project-card-meta span { display: flex; align-items: center; gap: 0.3rem; }

/* ===== Updates Feed ===== */
.updates-feed { padding: 1.5rem; }
.update-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--p-border);
}
.update-item:last-child { border-bottom: none; }
.update-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.update-author { font-weight: 500; font-size: 0.9rem; }
.update-date { font-size: 0.78rem; color: var(--p-text-muted); }
.update-message { font-size: 0.9rem; color: var(--p-text-muted); font-weight: 300; line-height: 1.6; }
.update-progress-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  background: rgba(74,158,255,0.12);
  color: var(--p-blue);
  border-radius: 4px;
  font-size: 0.75rem;
  margin-top: 0.5rem;
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--p-text-muted);
}
.empty-state svg { width: 48px; height: 48px; margin: 0 auto 1rem; opacity: 0.3; }
.empty-state h3 { font-size: 1.2rem; font-weight: 400; margin-bottom: 0.5rem; color: var(--p-text); }
.empty-state p { font-size: 0.9rem; max-width: 300px; margin: 0 auto; }

/* ===== Customer Timeline View ===== */
.customer-timeline-visual {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 2rem 0;
  overflow-x: auto;
  padding: 1rem 0;
}
.ct-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 120px;
  position: relative;
}
.ct-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--p-border);
  background: var(--p-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  margin-bottom: 0.5rem;
  transition: all 0.3s ease;
  z-index: 1;
}
.ct-dot.done { background: var(--p-green); border-color: var(--p-green); color: #000; }
.ct-dot.active { background: var(--p-amber); border-color: var(--p-amber); color: #000; box-shadow: 0 0 16px rgba(245,158,11,0.3); }
.ct-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--p-text-muted);
  text-align: center;
}
.ct-label.done { color: var(--p-green); }
.ct-label.active { color: var(--p-amber); }
.ct-connector {
  flex: 1;
  height: 2px;
  background: var(--p-border);
  min-width: 40px;
  margin-bottom: 1.5rem;
}
.ct-connector.done { background: var(--p-green); }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: flex; }
  .main-content { margin-left: 0; padding: 1.5rem; padding-top: 4rem; }
  .field-row { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .main-content { padding: 1rem; padding-top: 4rem; }
  .stats-grid { grid-template-columns: 1fr; }
  .project-cards { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .data-table { font-size: 0.82rem; }
  .data-table th, .data-table td { padding: 0.75rem 1rem; }
  .customer-timeline-visual { flex-wrap: wrap; }
}
