:root {
  /* Default Theme: Amber/Safety Orange */
  --accent: #F59E0B;
  --accent-dark: #D97706;
  --accent-light: #FBBF24;
  --accent-bg: #FEF3C7;
  
  --red: #E11D48;
  --red-dark: #BE123C;
  --red-light: #FDA4AF;
  --red-bg: #FFF1F2;
  
  --green: #10B981;
  --green-light: #D1FAE5;
  --blue: #3B82F6;
  --blue-light: #DBEAFE;
  
  --orange: #F59E0B;
  --orange-light: #FEF3C7;
  --purple: #8B5CF6;
  --purple-light: #EDE9FE;
  --teal: #0D9488;
  --teal-light: #CCFBF1;
  
  --bg: #09090B;
  --surf1: #18181B;
  --surf2: #27272A;
  --border: #3F3F46;
  --text: #FAF5F5;
  --muted: #A1A1AA;
  --sidebar-w: 240px;
}

/* Theme overrides */
.theme-amber {
  --accent: #F59E0B;
  --accent-dark: #D97706;
  --accent-light: #FBBF24;
  --accent-bg: #FEF3C7;
}
.theme-harbor {
  --accent: #3B82F6;
  --accent-dark: #2563EB;
  --accent-light: #60A5FA;
  --accent-bg: #DBEAFE;
}
.theme-sage {
  --accent: #16A34A;
  --accent-dark: #15803D;
  --accent-light: #4ADE80;
  --accent-bg: #D1FAE5;
}
.theme-graphite {
  --accent: #64748B;
  --accent-dark: #475569;
  --accent-light: #94A3B8;
  --accent-bg: #F1F5F9;
}
.theme-concrete {
  --accent: #A8A29E;
  --accent-dark: #78716C;
  --accent-light: #D6D3D1;
  --accent-bg: #F5F5F4;
}
.theme-copper {
  --accent: #C2703D;
  --accent-dark: #A0522D;
  --accent-light: #E0A987;
  --accent-bg: #FBF1EA;
}

/* Day Mode / Light Mode defaults */
.light-mode {
  --bg: #FAFAFA;
  --surf1: #FFFFFF;
  --surf2: #F4F4F5;
  --border: #E4E4E7;
  --text: #18181B;
  --muted: #71717A;
  --accent-bg: rgba(245, 158, 11, 0.15);
  --red-bg: rgba(225, 29, 72, 0.1);
  --green-light: rgba(16, 185, 129, 0.1);
  --blue-light: rgba(59, 130, 246, 0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-top: 54px;
  transition: background 0.3s, color 0.3s;
}

/* RTL Support */
html[dir="rtl"] body {
  font-family: 'Noto Nastaliq Urdu', 'Noto Naskh Arabic', 'Inter', system-ui, sans-serif;
}
html[dir="rtl"] .sidebar {
  left: auto;
  right: 0;
  border-left: 1px solid var(--border);
  border-right: none;
}
html[dir="rtl"] .main {
  margin-left: 0;
  margin-right: var(--sidebar-w);
}
html[dir="rtl"] .t-logo {
  border-left: 1px solid var(--border);
  border-right: none;
}
html[dir="rtl"] .ledger-bal-box {
  text-align: left;
}

/* TOP switcher BAR */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 54px;
  background: var(--surf1);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1000;
  padding-right: 20px;
}
.top-nav-left {
  display: flex;
  align-items: center;
  height: 100%;
}
.top-nav-right {
  display: flex;
  align-items: center;
  gap: 15px;
}
.t-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  font-weight: 800;
  font-size: 15px;
  color: var(--text);
  border-right: 1px solid var(--border);
  height: 100%;
  white-space: nowrap;
  text-decoration: none;
}
.t-logo span { color: var(--accent); }
.role-tabs { display: flex; height: 100%; }
.r-tab {
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all .2s;
  text-decoration: none;
  white-space: nowrap;
}
.r-tab:hover { color: var(--text); background: rgba(255,255,255,.04); }
.r-tab.active { color: var(--accent-light); border-bottom-color: var(--accent); }
.r-dot { width: 7px; height: 7px; border-radius: 50%; }

/* SIDEBAR */
.sidebar {
  position: fixed;
  top: 54px;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--surf1);
  border-right: 1px solid var(--border);
  padding-top: 16px;
  overflow-y: auto;
}
.sidebar-header { padding: 0 24px 16px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.sidebar-header h4 { font-size: 14px; font-weight: 800; color: var(--text); }
.sidebar-header span { font-size: 11px; color: var(--muted); }
.nav-lbl { font-size: 10px; font-weight: 800; color: var(--muted); letter-spacing: 1px; padding: 10px 24px; text-transform: uppercase; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 24px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  transition: all .2s;
}
.nav-item:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.nav-item.active {
  color: var(--accent-light);
  background: rgba(245,158,11,0.08);
  border-left: 3px solid var(--accent);
  padding-left: 21px;
}
html[dir="rtl"] .nav-item.active {
  border-left: none;
  border-right: 3px solid var(--accent);
  padding-left: 24px;
  padding-right: 21px;
}

/* MAIN CONTENT */
.main { margin-left: var(--sidebar-w); padding: 32px; }

/* UI COMPONENTS */
.grid4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 24px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; margin-bottom: 24px; }
.stat-card { background: var(--surf1); border: 1px solid var(--border); border-radius: 12px; padding: 18px; position: relative; }
.stat-lbl { font-size: 10.5px; color: var(--muted); font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 6px; }
.stat-val { font-size: 24px; font-weight: 900; }

.card { background: var(--surf1); border: 1px solid var(--border); border-radius: 14px; padding: 24px; margin-bottom: 24px; }
.card-title { font-size: 15px; font-weight: 800; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; }

.dt { width: 100%; border-collapse: collapse; }
.dt th { text-align: left; padding: 10px 14px; font-size: 11.5px; font-weight: 700; color: var(--muted); border-bottom: 1px solid var(--border); text-transform: uppercase; letter-spacing: 0.5px; }
html[dir="rtl"] .dt th { text-align: right; }
.dt td { padding: 14px; font-size: 13px; border-bottom: 1px solid var(--border); color: var(--text); }
.dt tr:last-child td { border-bottom: none; }
.dt tr.clickable { cursor: pointer; }
.dt tr.clickable:hover td { background: rgba(255,255,255,0.02); }

.badge { display: inline-block; padding: 3px 7px; border-radius: 6px; font-size: 10.5px; font-weight: 700; text-align: center; }
.badge-active { background: var(--green-light); color: var(--green); }
.badge-pending { background: var(--orange-light); color: var(--orange); }
.badge-suspended { background: var(--red-bg); color: var(--red); }
.badge-alert { background: var(--red-bg); color: var(--red); }
.badge-warning { background: var(--orange-light); color: var(--orange); }

.btn { background: var(--surf2); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 8px 16px; font-size: 12.5px; font-weight: 700; cursor: pointer; transition: all .15s; font-family: inherit; }
.btn:hover { background: var(--border); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn-sm { padding: 4px 8px; font-size: 11px; border-radius: 6px; }

/* TIMELINE STEPPER */
.stepper { display: flex; justify-content: space-between; overflow-x: auto; padding: 20px 0; margin-bottom: 24px; border-bottom: 1px solid var(--border); }
.step { text-align: center; position: relative; flex: 1; min-width: 80px; cursor: pointer; }
.step-dot { width: 28px; height: 28px; border-radius: 50%; background: var(--surf2); border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; margin: 0 auto 8px; font-size: 11px; font-weight: 700; color: var(--muted); position: relative; z-index: 2; transition: all .2s; }
.step.active .step-dot { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 0 10px rgba(245,158,11,0.5); }
.step.completed .step-dot { background: var(--green); border-color: var(--green); color: #fff; }
.step-lbl { font-size: 10.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.step.active .step-lbl { color: var(--text); font-weight: 700; }
.step::after { content:''; position: absolute; top: 14px; left: 50%; width: 100%; height: 2px; background: var(--border); z-index: 1; }
.step:last-child::after { display: none; }
.step.completed::after { background: var(--green); }

/* GROUPED PHASE ACCORDION STEPPER */
.phase-accordion { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; border-bottom: 1px solid var(--border); padding-bottom: 16px; }
.phase-group { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surf2); }
.phase-group-hdr { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; cursor: pointer; font-size: 12.5px; font-weight: 800; color: var(--text); user-select: none; }
.phase-group-hdr:hover { background: rgba(255,255,255,0.02); }
.phase-group-toggle { font-size: 10px; color: var(--muted); transition: transform 0.2s; }
.phase-group.open .phase-group-toggle { transform: rotate(180deg); }
.phase-group-body { display: none; padding: 8px 12px 16px; border-top: 1px solid var(--border); }
.phase-group.open .phase-group-body { display: block; }
.phase-group .stepper { border-bottom: none; margin-bottom: 0; padding: 12px 0 4px; }

/* PHASE CHECKLIST */
.phase-checklist { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.checklist-progress { font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 10px; }
.checklist-item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; background: var(--surf1); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 6px; font-size: 12px; }
.checklist-item input[type="checkbox"] { margin-top: 2px; accent-color: var(--green); }
.checklist-item.done { opacity: 0.85; }
.checklist-photo-thumb { width: 28px; height: 28px; border-radius: 4px; background: var(--surf2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 14px; margin-left: auto; }

/* PROJECT TEMPLATE PICKER */
.template-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
.template-card { padding: 16px; border: 2px solid var(--border); border-radius: 10px; cursor: pointer; transition: all 0.2s; background: var(--surf2); }
.template-card:hover { border-color: var(--accent); }
.template-card.selected { border-color: var(--accent); background: rgba(245,158,11,0.06); box-shadow: 0 0 0 1px var(--accent); }
.template-card h4 { font-size: 13px; margin-bottom: 4px; }
.template-card p { font-size: 11px; color: var(--muted); line-height: 1.4; }

/* PERMIT CARDS & SAMPLE GRID */
.permit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.permit-card { padding: 14px; background: var(--surf2); border: 1px solid var(--border); border-radius: 10px; }
.permit-card h4 { font-size: 13px; margin-bottom: 6px; }
.permit-ref { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.sample-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.sample-card { padding: 12px; background: var(--surf2); border: 1px solid var(--border); border-radius: 10px; text-align: center; cursor: pointer; }
.sample-swatch { width: 100%; height: 70px; border-radius: 6px; margin-bottom: 8px; border: 1px solid var(--border); }
.severity-critical { background: var(--red-light); color: var(--red); }
.severity-major { background: var(--orange-light); color: var(--orange); }
.severity-minor { background: var(--surf1); color: var(--muted); }

/* SIDEBAR COLLAPSIBLE SETTINGS */
.nav-group-toggle { cursor: pointer; user-select: none; }
.nav-sub-items { display: none; padding-left: 12px; }
.nav-sub-items.open { display: block; }
.nav-sub-items .nav-item { padding-left: 36px; font-size: 12.5px; }

/* FORM CONTROL */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.form-control { width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 13px; color: var(--text); outline: none; font-family: inherit; }
.form-control:focus { border-color: var(--accent); }

/* CHAT AREA */
.chat-container { display: grid; grid-template-columns: 250px 1fr; height: 450px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.chat-threads { background: var(--surf1); border-right: 1px solid var(--border); overflow-y: auto; }
.chat-thread-item { padding: 12px 16px; border-bottom: 1px solid var(--border); cursor: pointer; font-size: 12.5px; }
.chat-thread-item:hover { background: rgba(255,255,255,0.02); }
.chat-thread-item.active { background: rgba(245,158,11,0.06); border-left: 3px solid var(--accent); padding-left: 13px; }
.chat-window { background: var(--surf2); display: flex; flex-direction: column; }
.chat-header { padding: 12px 20px; border-bottom: 1px solid var(--border); background: var(--surf1); font-size: 13.5px; font-weight: 700; }
.chat-messages { flex: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.chat-bubble { max-width: 70%; padding: 10px 14px; border-radius: 12px; font-size: 13px; line-height: 1.5; }
.chat-bubble.sent { background: var(--accent); align-self: flex-end; color: #fff; }
.chat-bubble.received { background: var(--surf1); align-self: flex-start; }
.chat-meta { font-size: 10px; color: var(--muted); margin-top: 4px; display: block; }
.chat-input-area { padding: 12px; border-top: 1px solid var(--border); background: var(--surf1); display: flex; gap: 10px; }

/* TOGGLE SWITCH */
.toggle-switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--surf2); transition: .2s; border-radius: 22px; border: 1px solid var(--border); }
.toggle-slider:before { position: absolute; content: ""; height: 14px; width: 14px; left: 3px; bottom: 3px; background-color: var(--muted); transition: .2s; border-radius: 50%; }
input:checked + .toggle-slider { background-color: var(--green); border-color: var(--green); }
input:checked + .toggle-slider:before { transform: translateX(18px); background-color: #fff; }

/* DETAIL VIEW TABS */
.detail-tabs { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-bottom: 20px; border-bottom: 1px solid var(--border); overflow-x: visible; }
.dt-tab { padding: 7px 10px; font-size: 11px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; transition: all .2s; user-select: none; white-space: nowrap; }
.dt-tab:hover { color: var(--text); background: rgba(255,255,255,0.02); }
.dt-tab.active { color: var(--accent-light); border-bottom-color: var(--accent); }

/* DAILY SITE LOG TIMELINE */
.log-timeline { display: flex; flex-direction: column; gap: 16px; margin-top: 10px; }
.log-card { background: var(--surf2); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.log-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); padding-bottom: 8px; margin-bottom: 12px; }
.log-date { font-size: 13px; font-weight: 700; color: var(--accent-light); }
.log-meta { font-size: 11px; color: var(--muted); }
.log-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin: 12px 0; }
.log-photo-item { position: relative; height: 90px; background: var(--surf1); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 10px; text-align: center; }
.log-photo-item img { width: 100%; height: 100%; object-fit: cover; }
.log-photo-lbl { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,0.7); color: #fff; padding: 2px; font-size: 9px; text-align: center; }

/* ATTENDANCE CHECKLIST */
.att-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 8px; }
.att-item { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px; background: var(--surf1); border: 1px solid var(--border); border-radius: 6px; font-size: 12px; }
.att-status { font-size: 10px; font-weight: 700; }
.att-present { color: var(--green); }
.att-absent { color: var(--red); }

/* LEDGER AND ACCOUNTING CARDS */
.ledger-header { display: flex; justify-content: space-between; align-items: center; background: var(--surf2); border: 1px solid var(--border); border-radius: 12px; padding: 16px 20px; margin-bottom: 20px; }
.ledger-bal-box { text-align: right; }
.ledger-bal-label { font-size: 11px; color: var(--muted); text-transform: uppercase; font-weight: 700; }
.ledger-bal-val { font-size: 20px; font-weight: 800; }
.ledger-bal-val.company-owes { color: var(--green); }
.ledger-bal-val.contractor-owes { color: var(--orange); }

/* PROJECT BANNER & COVER IMAGE */
.project-banner { position: relative; height: 200px; border-radius: 12px; background-size: cover; background-position: center; margin-bottom: 24px; overflow: hidden; border: 1px solid var(--border); display: flex; align-items: flex-end; padding: 20px; }
.banner-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: linear-gradient(to top, rgba(9,9,11,0.85) 0%, rgba(9,9,11,0.1) 100%); z-index: 1; }
.banner-content { position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: flex-end; width: 100%; }
.banner-info h2 { font-size: 24px; font-weight: 900; color: #fff; margin-bottom: 4px; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }
.banner-info p { font-size: 13px; color: #CBD5E1; text-shadow: 0 1px 2px rgba(0,0,0,0.5); }
.btn-blur { background: rgba(24, 24, 27, 0.7); backdrop-filter: blur(8px); border-color: rgba(255, 255, 255, 0.15); color: #fff; }
.btn-blur:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.3); }

/* GALLERY WORKSPACE */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-top: 12px; margin-bottom: 24px; }
.gallery-card { position: relative; height: 135px; background: var(--surf2); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; transition: transform 0.2s, border-color 0.2s; }
.gallery-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.gallery-emoji { font-size: 42px; margin-bottom: 8px; transition: transform 0.2s; }
.gallery-card:hover .gallery-emoji { transform: scale(1.1); }
.gallery-meta { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(9,9,11,0.85); backdrop-filter: blur(4px); padding: 6px 8px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.gallery-meta span { font-size: 9.5px; font-weight: 700; color: #fff; }

/* NOTIFICATION BELL & DROPDOWN */
.bell-container { position: relative; display: flex; align-items: center; }
.bell-icon { font-size: 20px; cursor: pointer; color: var(--muted); transition: color 0.2s; position: relative; padding: 5px; }
.bell-icon:hover { color: var(--text); }
.unread-badge { position: absolute; top: 0; right: 0; background: var(--red); color: #fff; font-size: 9px; font-weight: 900; width: 15px; height: 15px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 2px solid var(--surf1); }
.notif-dropdown { display: none; position: absolute; top: 40px; right: 0; width: 340px; background: var(--surf1); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.5); overflow: hidden; z-index: 1001; }
html[dir="rtl"] .notif-dropdown { right: auto; left: 0; }
.notif-dropdown.active { display: block; }
.notif-header { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 800; display: flex; justify-content: space-between; align-items: center; background: var(--surf2); }
.notif-body { max-height: 280px; overflow-y: auto; }
.notif-item { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; cursor: pointer; transition: background 0.2s; text-decoration: none; color: inherit; }
.notif-item:hover { background: rgba(255,255,255,0.02); }
.notif-item.unread { background: rgba(245,158,11,0.04); border-left: 3px solid var(--accent); padding-left: 13px; }
html[dir="rtl"] .notif-item.unread { border-left: none; border-right: 3px solid var(--accent); padding-left: 16px; padding-right: 13px; }
.notif-title { font-size: 12.5px; font-weight: 700; color: var(--text); }
.notif-text { font-size: 12px; color: var(--muted); line-height: 1.4; }
.notif-time { font-size: 10px; color: var(--muted); align-self: flex-end; margin-top: 2px; }
.notif-footer { padding: 10px; text-align: center; border-top: 1px solid var(--border); background: var(--surf2); }
.notif-footer a { font-size: 11.5px; font-weight: 700; color: var(--accent-light); text-decoration: none; }
.notif-footer a:hover { text-decoration: underline; }

/* GANTT PHASE TIMELINE */
.gantt-container { display: flex; flex-direction: column; gap: 10px; background: var(--surf1); border: 1px solid var(--border); border-radius: 12px; padding: 20px; overflow-x: auto; margin-bottom: 24px; }
.gantt-header-row { display: grid; grid-template-columns: 200px 1fr; border-bottom: 1px solid var(--border); padding-bottom: 8px; margin-bottom: 10px; min-width: 600px; }
.gantt-header-label { font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; }
.gantt-months { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; font-size: 11px; font-weight: 800; color: var(--muted); text-align: center; text-transform: uppercase; }
.gantt-row { display: grid; grid-template-columns: 200px 1fr; align-items: center; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.03); min-width: 600px; }
.gantt-row:last-child { border-bottom: none; }
.gantt-phase-name { display: flex; flex-direction: column; gap: 3px; }
.gantt-phase-title { font-size: 12.5px; font-weight: 700; color: var(--text); }
.gantt-phase-contractor { font-size: 10.5px; color: var(--muted); }
.gantt-track { position: relative; height: 28px; background: rgba(0,0,0,0.2); border-radius: 6px; overflow: hidden; border: 1px solid var(--border); }
.gantt-bar { position: absolute; top: 2px; height: 22px; background: var(--accent); border-radius: 4px; display: flex; align-items: center; padding: 0 10px; color: #fff; font-size: 10.5px; font-weight: 700; box-shadow: 0 2px 4px rgba(0,0,0,0.3); white-space: nowrap; transition: all 0.3s; }
.gantt-bar.plumbing { background: var(--blue); }
.gantt-bar.electrical { background: var(--purple); }
.gantt-bar.construction { background: var(--accent); }
.gantt-bar.handover { background: var(--green); }

/* MODAL COMPONENT */
.modal { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.8); backdrop-filter: blur(4px); align-items: center; justify-content: center; z-index: 2000; padding: 20px; transition: opacity 0.2s; }
.modal.active { display: flex; }
.modal-content { background: var(--surf1); border: 1px solid var(--border); border-radius: 16px; width: 100%; max-width: 500px; box-shadow: 0 20px 40px rgba(0,0,0,0.6); display: flex; flex-direction: column; overflow: hidden; animation: modalSlide 0.25s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes modalSlide { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header { padding: 18px 24px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; background: var(--surf2); }
.modal-title { font-size: 15px; font-weight: 800; color: var(--text); }
.modal-close { font-size: 20px; cursor: pointer; color: var(--muted); border: none; background: none; outline: none; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 24px; overflow-y: auto; max-height: 70vh; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); background: var(--surf2); display: flex; justify-content: flex-end; gap: 12px; }

/* LANG SELECTOR dropdown style */
.lang-selector { background: transparent; border: 1px solid var(--border); color: var(--text); font-size: 12px; font-weight: 700; padding: 4px 8px; border-radius: 6px; outline: none; cursor: pointer; }
.lang-selector option { background: var(--surf1); color: var(--text); }

/* MISC LAYOUT UPDATES */
.profit-indicator { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; margin-top: 4px; }
.profit-indicator.positive { color: var(--green); }
.profit-indicator.negative { color: var(--red); }

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.2s; z-index: 999; }
  .sidebar.active { transform: translateX(0); }
  .main { margin-left: 0 !important; margin-right: 0 !important; padding: 16px; }
  .top-nav { padding-right: 10px; }
  .grid4, .grid2 { grid-template-columns: 1fr; }
  .top-nav-right { gap: 10px; }
  .r-tab { padding: 0 10px; font-size: 12px; }
}

/* PRINT STYLING */
@media print {
  body { padding-top: 0; background: #fff; color: #000; }
  .sidebar, .top-nav, .btn, .dt-tab, .notif-dropdown { display: none !important; }
  .main { margin-left: 0 !important; margin-right: 0 !important; padding: 0; }
  .card, .stat-card, .ledger-header { background: #fff !important; border: 1px solid #000 !important; box-shadow: none !important; color: #000 !important; }
  .dt td, .dt th { border-bottom: 1px solid #000 !important; color: #000 !important; }
}
