/* ============================================================
   METRO HOMES FIELD OPERATIONS APP — SHARED STYLESHEET
   portal.ctumetrohomes.com
   ============================================================ */

/* ── FONTS ── */
@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600&family=Barlow+Condensed:wght@600;700&display=swap');

/* ── CSS VARIABLES ── */
:root {
  --navy:        #1B2A5E;
  --navy-light:  #243670;
  --blue:        #4A6DB5;
  --blue-light:  #5A80CC;
  --orange:      #E8651A;
  --orange-light:#F07230;
  --surface:     #F4F6FB;
  --surface-2:   #EAEEF8;
  --white:       #FFFFFF;
  --border:      rgba(27,42,94,0.12);
  --border-med:  rgba(27,42,94,0.22);
  --txt-primary: #1B2A5E;
  --txt-secondary:#5A6A8A;
  --txt-muted:   #8A9AB8;
  --green:       #2E7D32;
  --green-bg:    #E8F5E9;
  --red:         #C62828;
  --red-bg:      #FFEBEE;
  --amber:       #E65100;
  --amber-bg:    #FFF3E0;
  --sidebar-w:   224px;
  --topbar-h:    56px;
  --radius-sm:   6px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --shadow-sm:   0 1px 3px rgba(27,42,94,0.08);
  --shadow-md:   0 4px 12px rgba(27,42,94,0.10);
  --transition:  all 0.15s ease;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Barlow', sans-serif;
  background: var(--surface);
  color: var(--txt-primary);
  min-height: 100vh;
  line-height: 1.5;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { font-family: 'Barlow', sans-serif; cursor: pointer; }
input, select, textarea { font-family: 'Barlow', sans-serif; }

/* ── TYPOGRAPHY ── */
.font-condensed { font-family: 'Barlow Condensed', sans-serif; }
h1 { font-family: 'Barlow Condensed', sans-serif; font-size: 28px; font-weight: 700; color: var(--navy); }
h2 { font-family: 'Barlow Condensed', sans-serif; font-size: 22px; font-weight: 700; color: var(--navy); }
h3 { font-family: 'Barlow Condensed', sans-serif; font-size: 18px; font-weight: 700; color: var(--navy); }
h4 { font-size: 14px; font-weight: 600; color: var(--navy); }
.text-sm  { font-size: 13px; }
.text-xs  { font-size: 11px; }
.text-muted { color: var(--txt-muted); }
.text-secondary { color: var(--txt-secondary); }
.text-orange { color: var(--orange); }
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.label-upper {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.6px; color: var(--txt-muted);
}

/* ── APP SHELL ── */
.app-shell { display: flex; min-height: 100vh; }

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  overflow-y: auto;
}
.sidebar-header {
  padding: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.logo-mark {
  width: 30px; height: 30px; flex-shrink: 0;
  background: white;
  clip-path: polygon(0% 100%, 0% 0%, 25% 0%, 50% 50%, 75% 0%, 100% 0%, 100% 100%, 78% 100%, 78% 38%, 50% 88%, 22% 38%, 22% 100%);
}
.sidebar-brand { line-height: 1; }
.sidebar-brand .brand-metro {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 18px; font-weight: 700; color: white; display: block;
}
.sidebar-brand .brand-homes {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 18px; font-weight: 500; color: rgba(255,255,255,0.55); display: block;
}
.sidebar-user {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--orange);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: white; flex-shrink: 0;
}
.user-name  { font-size: 13px; font-weight: 600; color: white; line-height: 1.2; }
.user-role  { font-size: 11px; color: rgba(255,255,255,0.5); line-height: 1.2; }
.sidebar-nav { flex: 1; padding: 0.5rem 0; overflow-y: auto; }
.nav-section {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1px; color: rgba(255,255,255,0.3);
  padding: 0.75rem 1rem 0.25rem;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 1rem;
  color: rgba(255,255,255,0.65);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: var(--transition);
  position: relative;
  text-decoration: none;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: white; text-decoration: none; }
.nav-item.active { background: rgba(74,109,181,0.25); color: white; border-left-color: var(--orange); }
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.8; }
.nav-badge {
  margin-left: auto; background: var(--orange); color: white;
  font-size: 10px; font-weight: 700; padding: 2px 6px;
  border-radius: 10px; min-width: 18px; text-align: center;
}
.nav-notif {
  width: 7px; height: 7px; background: var(--orange);
  border-radius: 50%; position: absolute; top: 9px; right: 10px;
}
.sidebar-footer {
  padding: 0.875rem 1rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 12px;
  color: rgba(255,255,255,0.35);
  flex-shrink: 0;
}
.sidebar-footer a { color: rgba(255,255,255,0.35); }
.sidebar-footer a:hover { color: rgba(255,255,255,0.7); }

/* ── MAIN CONTENT ── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── TOPBAR ── */
.topbar {
  height: var(--topbar-h);
  background: white;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 20px; font-weight: 700; color: var(--navy);
  flex: 1;
}
.topbar-subtitle {
  font-size: 12px; color: var(--txt-muted);
}
.back-btn {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--blue);
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: white;
  transition: var(--transition);
  text-decoration: none;
}
.back-btn:hover { background: var(--surface); text-decoration: none; }
.back-btn svg { width: 14px; height: 14px; }

/* ── PAGE CONTENT ── */
.page-content { padding: 1.25rem 1.5rem; flex: 1; }

/* ── CARDS ── */
.card {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 1rem 1.125rem;
}
.card + .card { margin-top: 1rem; }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.875rem;
}
.card-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--txt-muted);
}
.card-action {
  font-size: 12px; font-weight: 600; color: var(--blue); cursor: pointer;
}
.card-action:hover { text-decoration: underline; }

/* ── STAT CARDS ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 1.25rem;
}
.stat-card {
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 0.875rem 1rem;
}
.stat-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--txt-muted); margin-bottom: 4px; }
.stat-value { font-family: 'Barlow Condensed', sans-serif; font-size: 28px; font-weight: 700; color: var(--navy); line-height: 1; }
.stat-sub   { font-size: 11px; color: var(--txt-muted); margin-top: 4px; }
.stat-value.orange { color: var(--orange); }
.stat-value.green  { color: var(--green); }
.stat-value.red    { color: var(--red); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px; font-weight: 600;
  border: 1px solid var(--border);
  background: white; color: var(--txt-secondary);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { border-color: var(--blue); color: var(--blue); text-decoration: none; }
.btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.btn-primary   { background: var(--navy);   color: white; border-color: var(--navy); }
.btn-primary:hover { background: var(--blue); border-color: var(--blue); color: white; }
.btn-orange    { background: var(--orange); color: white; border-color: var(--orange); }
.btn-orange:hover { background: var(--orange-light); border-color: var(--orange-light); color: white; }
.btn-success   { background: var(--green-bg); color: var(--green); border-color: #A5D6A7; }
.btn-danger    { background: var(--red-bg);   color: var(--red);   border-color: #FFCDD2; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 11px 22px; font-size: 14px; }
.btn-block { width: 100%; justify-content: center; }

/* ── BADGES ── */
.badge {
  display: inline-flex; align-items: center;
  font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 20px;
  white-space: nowrap;
}
.badge-blue    { background: #E6F1FB; color: #0C447C; }
.badge-navy    { background: #E8ECF5; color: var(--navy); }
.badge-green   { background: var(--green-bg); color: #27500A; }
.badge-orange  { background: var(--amber-bg); color: #633806; }
.badge-red     { background: var(--red-bg);   color: #791F1F; }
.badge-gray    { background: var(--surface);  color: var(--txt-muted); }
.badge-purple  { background: #EDE7F6; color: #4527A0; }
.badge-amber   { background: #FAEEDA; color: #633806; border: 1px solid #EF9F27; }

/* ── FORM ELEMENTS ── */
.form-group { margin-bottom: 12px; }
.form-group label {
  display: block; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--txt-muted); margin-bottom: 5px;
}
.form-control {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: 'Barlow', sans-serif; font-size: 13px;
  color: var(--txt-primary);
  background: white;
  outline: none;
  transition: border-color 0.15s;
}
.form-control:focus { border-color: var(--blue); }
.form-control:disabled { background: var(--surface); color: var(--txt-muted); }
textarea.form-control { resize: vertical; min-height: 80px; line-height: 1.5; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.form-grid-4 { display: grid; grid-template-columns: 2fr 80px 80px 110px; gap: 8px; }
.form-hint { font-size: 11px; color: var(--txt-muted); margin-top: 4px; }
.form-error { font-size: 11px; color: var(--red); margin-top: 4px; }

/* ── SECTION HEADER ── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.875rem;
}
.section-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 15px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--navy);
}

/* ── FILTER BAR ── */
.filter-bar {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 1rem; flex-wrap: wrap;
}
.filter-chip {
  font-size: 12px; font-weight: 600;
  padding: 5px 12px; border-radius: 20px;
  border: 1px solid var(--border);
  background: white; color: var(--txt-secondary);
  cursor: pointer; transition: var(--transition);
}
.filter-chip:hover { border-color: var(--blue); color: var(--blue); }
.filter-chip.active { background: var(--navy); color: white; border-color: var(--navy); }
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 6px 12px;
  flex: 1; max-width: 280px;
}
.search-box input {
  border: none; background: transparent;
  font-family: 'Barlow', sans-serif; font-size: 13px;
  color: var(--txt-primary); outline: none; width: 100%;
}
.search-box input::placeholder { color: var(--txt-muted); }
.search-box svg { width: 14px; height: 14px; color: var(--txt-muted); flex-shrink: 0; }

/* ── TABLE ── */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: white; background: var(--blue);
  padding: 8px 12px; text-align: left;
}
.data-table td {
  padding: 8px 12px; border-bottom: 1px solid var(--border);
  color: var(--txt-secondary); vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface); }
.data-table td.bold { font-weight: 600; color: var(--txt-primary); }
.data-table td.right { text-align: right; }
.data-table td.navy  { font-weight: 700; color: var(--navy); }

/* ── TEAM MEMBER ROW ── */
.team-member {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.team-member:last-child { border-bottom: none; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: white; flex-shrink: 0;
}
.avatar-navy   { background: var(--navy); }
.avatar-blue   { background: var(--blue); }
.avatar-orange { background: var(--orange); }
.avatar-green  { background: var(--green); }
.member-name   { font-size: 13px; font-weight: 600; color: var(--txt-primary); }
.member-role   { font-size: 11px; color: var(--txt-muted); }
.member-contact { margin-left: auto; font-size: 12px; color: var(--blue); }

/* ── PROGRESS BAR ── */
.progress-track {
  height: 6px; background: var(--surface-2);
  border-radius: 10px; overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 10px;
  background: var(--blue);
  transition: width 0.4s ease;
}
.progress-fill.orange { background: var(--orange); }
.progress-fill.green  { background: var(--green); }

/* ── MILESTONE DOTS ── */
.ms-dots { display: flex; gap: 3px; }
.ms-dot-item {
  height: 5px; flex: 1; border-radius: 3px;
  background: var(--surface-2);
}
.ms-dot-item.done   { background: var(--blue); }
.ms-dot-item.active { background: var(--orange); }
.ms-dot-item.gate-pass { background: var(--green); }
.ms-dot-item.gate-pend { background: #EF9F27; }

/* ── NOTIFICATION / ALERT BANNERS ── */
.alert {
  display: flex; align-items: flex-start; gap: 12px;
  border-radius: var(--radius-md); padding: 0.875rem 1rem;
  margin-bottom: 1rem;
}
.alert-icon {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.alert-icon svg { width: 14px; height: 14px; }
.alert-title { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.alert-body  { font-size: 12px; line-height: 1.5; }
.alert-success { background: var(--green-bg); border: 1px solid #A5D6A7; }
.alert-success .alert-icon { background: var(--green); }
.alert-success .alert-title { color: #1B5E20; }
.alert-success .alert-body  { color: #2E7D32; }
.alert-warning { background: var(--amber-bg); border: 1px solid #EF9F27; }
.alert-warning .alert-icon { background: #EF9F27; }
.alert-warning .alert-title { color: #E65100; }
.alert-warning .alert-body  { color: #BF360C; }
.alert-error   { background: var(--red-bg); border: 1px solid #FFCDD2; }
.alert-error .alert-icon { background: var(--red); }
.alert-error .alert-title { color: #B71C1C; }
.alert-error .alert-body  { color: #C62828; }
.alert-info    { background: #E6F1FB; border: 1px solid #B5D4F4; }
.alert-info .alert-icon { background: var(--blue); }
.alert-info .alert-title { color: #0C447C; }
.alert-info .alert-body  { color: #185FA5; }

/* ── DASHED CARD (info/notice) ── */
.card-dashed {
  background: var(--surface);
  border: 1px dashed var(--border-med);
  border-radius: var(--radius-lg);
  padding: 1rem 1.125rem;
}
.card-dashed-title {
  font-size: 12px; font-weight: 600; color: var(--blue);
  display: flex; align-items: center; gap: 6px; margin-bottom: 6px;
}
.card-dashed p { font-size: 12px; color: var(--txt-secondary); line-height: 1.5; }

/* ── LANGUAGE TOGGLE ── */
.lang-toggle {
  display: flex; align-items: center; gap: 4px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 3px 4px;
}
.lang-btn {
  font-size: 11px; font-weight: 700; padding: 3px 10px;
  border-radius: 16px; border: none; background: transparent;
  color: var(--txt-muted); cursor: pointer; transition: var(--transition);
}
.lang-btn.active { background: var(--navy); color: white; }

/* ── LAYOUT HELPERS ── */
.layout-2col { display: grid; grid-template-columns: 1fr 284px; gap: 1rem; }
.layout-3col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.flex        { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between{ display: flex; align-items: center; justify-content: space-between; }
.gap-6  { gap: 6px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mb-0  { margin-bottom: 0; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 500;
  padding: 1rem;
}
.modal {
  background: white; border-radius: var(--radius-xl);
  padding: 1.5rem; width: 100%; max-width: 520px;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.25rem;
}
.modal-title { font-family: 'Barlow Condensed', sans-serif; font-size: 18px; font-weight: 700; color: var(--navy); }
.modal-close {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface); border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 16px; color: var(--txt-muted);
}
.modal-footer { display: flex; gap: 8px; margin-top: 1.25rem; justify-content: flex-end; }

/* ── DIVIDER ROW ── */
hr.divider { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }

/* ── STATUS SECTION HEADER ── */
.section-band {
  background: var(--navy); color: white;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.6px; padding: 6px 12px;
  border-radius: var(--radius-sm);
  margin: 1rem 0 0.5rem;
  display: inline-block;
}
.section-band.orange { background: var(--orange); }
.section-band.blue   { background: var(--blue); }

/* ── SIGN-OFF ROW ── */
.signoff-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.signoff-row:last-child { border-bottom: none; }
.signoff-name { font-size: 12px; font-weight: 600; color: var(--txt-primary); }
.signoff-role { font-size: 11px; color: var(--txt-muted); }
.signoff-btn {
  margin-left: auto;
  font-size: 11px; font-weight: 600; padding: 4px 12px;
  border-radius: 20px; cursor: pointer;
  border: 1px solid var(--border); background: white; color: var(--txt-secondary);
  transition: var(--transition);
}
.signoff-btn:hover { border-color: var(--orange); color: var(--orange); }
.signoff-btn.signed { background: var(--green-bg); color: #27500A; border-color: #A5D6A7; }

/* ── RESPONSIVE — MOBILE ── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.25s ease; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .topbar { padding: 0 1rem; }
  .page-content { padding: 1rem; }
  .layout-2col { grid-template-columns: 1fr; }
  .layout-3col { grid-template-columns: 1fr; }
  .form-grid-2 { grid-template-columns: 1fr; }
  .form-grid-3 { grid-template-columns: 1fr; }
  .stats-grid  { grid-template-columns: 1fr 1fr; }
  .hamburger-btn { display: flex !important; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .filter-bar { gap: 6px; }
}

/* ── HAMBURGER (mobile only) ── */
.hamburger-btn {
  display: none;
  width: 36px; height: 36px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: white; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
}
.hamburger-btn svg { width: 18px; height: 18px; color: var(--navy); }

/* ── MOBILE OVERLAY ── */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.4); z-index: 199;
}
.sidebar-overlay.show { display: block; }

/* ── PRINT ── */
@media print {
  .sidebar, .topbar, .filter-bar, .btn { display: none !important; }
  .main-content { margin-left: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}
