/* =============================================
   DEL Property Management — Ops Portfolio Dashboard
   Brand Colors: Blue #1d4ed8, Logo Red #CC0000, White #FFFFFF
   ============================================= */

/* ── DEL Brand Variables ─────────────────────── */
:root {
  --del-blue:       #1d4ed8;
  --del-blue-dark:  #1e3a8a;
  --del-blue-light: #dbeafe;
  --del-red:        #CC0000;
  --del-black:      #1a1a1a;
  --del-gray:       #2d2d2d;
  --del-white:      #ffffff;
}

/* Navigation */
.nav-btn {
  color: rgba(255,255,255,0.75);
  background: transparent;
}
.nav-btn:hover, .nav-btn.active {
  background: rgba(255,255,255,0.18);
  color: white;
}

/* Tab system */
.tab-content { animation: fadeIn 0.2s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* Column group buttons */
.col-group-btn {
  color: #6b7280;
  border-color: transparent;
}
.col-group-btn:hover { color: var(--del-blue); }
.col-group-btn.active {
  color: var(--del-blue);
  border-color: var(--del-blue);
  font-weight: 600;
}

/* Form section buttons */
.form-sec-btn {
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  color: #6b7280;
  white-space: nowrap;
  transition: all 0.15s;
}
.form-sec-btn:hover { color: var(--del-blue); }
.form-sec-btn.active {
  color: var(--del-blue);
  border-color: var(--del-blue);
  font-weight: 600;
}

/* Form inputs */
.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #4b5563;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.form-input {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.875rem;
  color: #1f2937;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: white;
}
.form-input:focus {
  border-color: var(--del-blue);
  box-shadow: 0 0 0 3px rgba(29,78,216,0.1);
}
textarea.form-input { resize: vertical; }

/* KPI Cards */
.kpi-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  padding: 20px;
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(29,78,216,0.15); }
.kpi-number { font-size: 2.25rem; font-weight: 700; line-height: 1.1; }
.kpi-label { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.kpi-sub { font-size: 0.75rem; margin-top: 4px; }

/* Progress bars */
.progress-bar {
  height: 8px;
  border-radius: 99px;
  background: #e5e7eb;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.5s ease;
}

/* Risk badges */
.badge-risk-low    { display:inline-block; padding:2px 10px; border-radius:99px; background:#dcfce7; color:#15803d; font-size:0.75rem; font-weight:600; }
.badge-risk-medium { display:inline-block; padding:2px 10px; border-radius:99px; background:#fef9c3; color:#a16207; font-size:0.75rem; font-weight:600; }
.badge-risk-high   { display:inline-block; padding:2px 10px; border-radius:99px; background:#ffedd5; color:#c2410c; font-size:0.75rem; font-weight:600; }
.badge-risk-critical{ display:inline-block; padding:2px 10px; border-radius:99px; background:#fee2e2; color:#b91c1c; font-size:0.75rem; font-weight:600; }

/* Tier badges */
.badge-tier-aaa { display:inline-block; padding:2px 10px; border-radius:99px; background:#eff6ff; color:#1e3a8a; font-size:0.75rem; font-weight:700; border:1px solid #93c5fd; }
.badge-tier-aa  { display:inline-block; padding:2px 10px; border-radius:99px; background:#dbeafe; color:#1d4ed8; font-size:0.75rem; font-weight:700; border:1px solid #93c5fd; }
.badge-tier-a   { display:inline-block; padding:2px 10px; border-radius:99px; background:#fff7ed; color:#9a3412; font-size:0.75rem; font-weight:700; }
.badge-tier-b   { display:inline-block; padding:2px 10px; border-radius:99px; background:#f9fafb; color:#374151; font-size:0.75rem; font-weight:700; border:1px solid #d1d5db; }
.badge-tier-c   { display:inline-block; padding:2px 10px; border-radius:99px; background:#1a1a1a; color:#fff; font-size:0.75rem; font-weight:700; }

/* AR badges */
.badge-ar-clear { display:inline-block; padding:2px 10px; border-radius:99px; background:#dcfce7; color:#15803d; font-size:0.75rem; font-weight:600; }
.badge-ar-low   { display:inline-block; padding:2px 10px; border-radius:99px; background:#fef9c3; color:#a16207; font-size:0.75rem; font-weight:600; }
.badge-ar-high  { display:inline-block; padding:2px 10px; border-radius:99px; background:#fee2e2; color:#b91c1c; font-size:0.75rem; font-weight:600; }

/* Audit badges */
.badge-audit-completed  { display:inline-block; padding:2px 10px; border-radius:99px; background:#dcfce7; color:#15803d; font-size:0.75rem; font-weight:600; }
.badge-audit-scheduled  { display:inline-block; padding:2px 10px; border-radius:99px; background:#fef3c7; color:#b45309; font-size:0.75rem; font-weight:600; }
.badge-audit-overdue    { display:inline-block; padding:2px 10px; border-radius:99px; background:#fee2e2; color:#b91c1c; font-size:0.75rem; font-weight:600; }

/* Table styles */
#portfolioTable th {
  padding: 10px 12px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
#portfolioTable th:hover { background: rgba(255,255,255,0.1); }
#portfolioTable td {
  padding: 8px 12px;
  font-size: 0.78rem;
  vertical-align: middle;
  white-space: nowrap;
}
#portfolioTable tr:hover td { background: #eff6ff; }

/* Sticky first column */
#portfolioTable th:first-child,
#portfolioTable td:first-child {
  position: sticky;
  left: 0;
  z-index: 5;
  background: inherit;
}
#portfolioTable thead th:first-child { z-index: 11; background: var(--del-blue-dark); }

/* Alert cards */
.alert-card {
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-left: 4px solid;
}
.alert-critical { background: #fff1f2; border-color: #e11d48; }
.alert-warning  { background: #fffbeb; border-color: #d97706; }
.alert-info     { background: #eff6ff; border-color: #3b82f6; }

/* Modal overlay */
.modal-overlay { padding-top: 20px; }

/* DV List cards */
.dv-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  overflow: hidden;
}
.dv-card-header {
  background: var(--del-blue);
  color: white;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dv-item {
  padding: 8px 16px;
  font-size: 0.82rem;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dv-item:last-child { border-bottom: none; }
.dv-item:hover { background: #eff6ff; }

/* Checklist items */
.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #eff6ff;
  border-left: 3px solid var(--del-blue);
}
.checklist-item.checked { background: #f0fdf4; border-left-color: #16a34a; }
.checklist-num {
  background: var(--del-blue);
  color: white;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* Feature cards */
.feature-card {
  background: #eff6ff;
  border-radius: 10px;
  padding: 14px;
  border: 1px solid #bfdbfe;
}

/* Contact cards */
.contact-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
}
.contact-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  background: var(--del-blue);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #93c5fd; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--del-blue); }

/* Flag chips */
.flag-chip {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 99px;
  font-size: 0.68rem;
  font-weight: 700;
  margin: 1px;
}
.flag-renewal { background: #fef9c3; color: #a16207; }
.flag-ar      { background: #fee2e2; color: #b91c1c; }
.flag-insp    { background: #ffedd5; color: #c2410c; }
.flag-report  { background: #fce7f3; color: #9d174d; }

/* Responsive table actions */
.action-btn {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 500;
  transition: all 0.15s;
  border: none;
  cursor: pointer;
}
.btn-view   { background: #f9fafb; color: #374151; border:1px solid #d1d5db; }
.btn-edit   { background: #eff6ff; color: var(--del-blue); border:1px solid #93c5fd; }
.btn-delete { background: #1a1a1a; color: white; }
.action-btn:hover { opacity: 0.8; transform: scale(1.05); }

/* Surplus / deficit coloring */
.surplus  { color: #15803d; font-weight: 600; }
.deficit  { color: #b91c1c; font-weight: 600; }

/* Highlight row if flagged */
tr.row-critical td { background: #fff1f2 !important; }
tr.row-high td { background: #fffbeb !important; }

/* ── Excel Import / Export ─────────────────────────────────── */
.import-drop-zone {
  border: 2px dashed #93c5fd;
  border-radius: 12px;
  padding: 32px;
  text-align: center;
  background: #eff6ff;
  cursor: pointer;
  transition: all 0.2s;
}
.import-drop-zone:hover,
.import-drop-zone.drag-over {
  border-color: var(--del-blue);
  background: #dbeafe;
}
.import-drop-zone input[type=file] { display: none; }

/* Column mapping table */
.col-map-table th { background: var(--del-blue-dark); color: white; padding: 8px 12px; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; }
.col-map-table td { padding: 7px 12px; font-size: 0.8rem; border-bottom: 1px solid #f1f5f9; }
.col-map-table tr:hover td { background: #eff6ff; }
.col-map-select { width: 100%; border: 1px solid #d1d5db; border-radius: 6px; padding: 4px 8px; font-size: 0.78rem; }
.col-map-select:focus { border-color: var(--del-blue); outline: none; }

/* Import preview table */
.preview-table-wrap { max-height: 260px; overflow-y: auto; border: 1px solid #e5e7eb; border-radius: 8px; }
.preview-table th { background: var(--del-blue-dark); color: white; padding: 7px 10px; font-size: 0.7rem; white-space: nowrap; position: sticky; top: 0; }
.preview-table td { padding: 6px 10px; font-size: 0.75rem; border-bottom: 1px solid #f1f5f9; white-space: nowrap; }
.preview-table tr:hover td { background: #eff6ff; }

/* Progress step indicator */
.import-step { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 8px; font-size: 0.82rem; }
.import-step.active   { background: #dbeafe; color: var(--del-blue); font-weight: 600; }
.import-step.done     { background: #dcfce7; color: #15803d; }
.import-step.inactive { background: #f1f5f9; color: #94a3b8; }
.step-circle {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 700; flex-shrink: 0;
}
.import-step.active .step-circle   { background: var(--del-blue); color: white; }
.import-step.done .step-circle     { background: #15803d; color: white; }
.import-step.inactive .step-circle { background: #cbd5e1; color: white; }

/* Staffing type badges */
.badge-staffing-permanent { display:inline-block; padding:2px 8px; border-radius:99px; background:#d1fae5; color:#065f46; font-size:0.7rem; font-weight:600; white-space:nowrap; max-width:250px; overflow:hidden; text-overflow:ellipsis; vertical-align:middle; }
.badge-staffing-relief    { display:inline-block; padding:2px 8px; border-radius:99px; background:#fef3c7; color:#92400e; font-size:0.7rem; font-weight:600; white-space:nowrap; max-width:250px; overflow:hidden; text-overflow:ellipsis; vertical-align:middle; }
.badge-staffing-apm       { display:inline-block; padding:2px 8px; border-radius:99px; background:#dbeafe; color:#1e3a8a; font-size:0.7rem; font-weight:600; white-space:nowrap; max-width:250px; overflow:hidden; text-overflow:ellipsis; vertical-align:middle; }
.badge-staffing-acm       { display:inline-block; padding:2px 8px; border-radius:99px; background:#f3f4f6; color:#374151; font-size:0.7rem; font-weight:600; white-space:nowrap; max-width:250px; overflow:hidden; text-overflow:ellipsis; vertical-align:middle; }
.badge-staffing-none      { display:inline-block; padding:2px 8px; border-radius:99px; background:#fee2e2; color:#b91c1c; font-size:0.7rem; font-weight:600; }
.badge-staffing-cws       { display:inline-block; padding:2px 8px; border-radius:99px; background:#1a1a1a; color:#fff; font-size:0.7rem; font-weight:600; }
.badge-staffing-other     { display:inline-block; padding:2px 8px; border-radius:99px; background:#f1f5f9; color:#475569; font-size:0.7rem; font-weight:600; }

/* ACM/APM badge */
.badge-acm { display:inline-flex; align-items:center; gap:4px; padding:2px 8px; border-radius:99px; background:#dbeafe; color:#1e3a8a; font-size:0.72rem; font-weight:600; }
.badge-apm { display:inline-flex; align-items:center; gap:4px; padding:2px 8px; border-radius:99px; background:#fef3c7; color:#92400e; font-size:0.72rem; font-weight:600; }

/* Personnel grid in view modal */
.personnel-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.personnel-tag  {
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.78rem;
}
.personnel-tag .role-label { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 2px; }
.personnel-tag .name       { font-weight: 600; margin-top: 2px; }

/* ── Inline Edit Cells ─────────────────────────────────── */
.inline-edit-cell {
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.1s;
  position: relative;
  padding: 2px 4px;
  margin: -2px -4px;
}
.inline-edit-cell:hover {
  background: #eff6ff;
  outline: 1px dashed #93c5fd;
}
.inline-edit-icon { pointer-events: none; }
.inline-edit-input {
  min-width: 80px;
  font-size: 0.75rem !important;
  padding: 3px 6px !important;
  border-radius: 4px !important;
}

/* ── Site Name Cell ─────────────────────────────────────── */
.site-name-cell {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Top Scrollbar Mirror ───────────────────────────────── */
#topScrollbar {
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
  overflow-x: auto;
  overflow-y: hidden;
  cursor: ns-resize;
}
#topScrollbar::-webkit-scrollbar { height: 8px; }
#topScrollbar::-webkit-scrollbar-thumb { background: #93c5fd; border-radius: 4px; }

/* ── Notes & Documents ───────────────────────────────────── */
.note-category-general    { background: #f3f4f6; color: #374151; }
.note-category-ar         { background: #fff7ed; color: #c2410c; }
.note-category-compliance { background: #f9fafb; color: #1a1a1a; }
.note-category-inspection { background: #f5f3ff; color: #6d28d9; }
.note-category-contract   { background: #f0fdf4; color: #15803d; }
.note-category-staffing   { background: #eff6ff; color: var(--del-blue); }
.note-category-urgent     { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.note-category-generic    { background: var(--del-blue-dark); color: #fff; }

/* ── Audit log changes diff ─────────────────────────────── */
ins { text-decoration: none; font-style: italic; }
del { text-decoration: line-through; }

/* ── Import mapped row highlight ───────────────────────── */
.col-map-table tr.row-mapped td { background: #f0fff4; }
.col-map-table tr.row-mapped td:first-child { color: #15803d; font-weight: 600; }

/* ── Flag audit chip ────────────────────────────────────── */
.flag-audit { background: #fee2e2; color: #b91c1c; }

/* ── Login gate smooth ──────────────────────────────────── */
#loginGate { animation: fadeIn 0.3s ease-in-out; }

/* ── User role badge ─────────────────────────────────────── */
.role-admin { background: #dbeafe; color: var(--del-blue); }
.role-staff { background: #f1f5f9; color: #475569; }

/* ── Org Chart ───────────────────────────────────────────── */
.org-box {
  transition: transform 0.15s, box-shadow 0.15s;
  user-select: none;
  border-radius: 10px;
}
.org-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(29,78,216,0.25);
}
.org-box-sm {
  min-width: 7rem !important;
  max-width: 10rem !important;
}
.org-connector {
  position: absolute;
  background: #d1d5db;
}

/* ── Division tabs ───────────────────────────────────────── */
.div-tab-btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.15s;
  border: 2px solid transparent;
}
.div-tab-btn.active {
  background: var(--del-blue);
  color: white;
  border-color: var(--del-blue);
}
.div-tab-btn:not(.active) {
  background: #f9fafb;
  color: #374151;
  border-color: #e5e7eb;
}
.div-tab-btn:not(.active):hover {
  border-color: var(--del-blue);
  color: var(--del-blue);
}

/* ── Access level badges ─────────────────────────────────── */
.access-admin      { background: #dbeafe; color: var(--del-blue); }
.access-read-write { background: #fef3c7; color: #92400e; }
.access-read-only  { background: #f1f5f9; color: #475569; }

/* ── Hierarchy filter buttons ────────────────────────────── */
.hier-filter-btn { transition: all 0.15s; }

/* ── Login page tagline ──────────────────────────────────── */
.del-tagline {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--del-red);
  font-weight: 800;
}

/* ── Designation badge in user list ─────────────────────── */
.designation-badge {
  display: inline-block;
  background: #dbeafe;
  color: var(--del-blue);
  border: 1px solid #93c5fd;
  border-radius: 9999px;
  padding: 1px 8px;
  font-size: 0.7rem;
  font-weight: 600;
}

/* ── Contact editable fields ─────────────────────────────── */
.contact-edit-field {
  border: 1px dashed #d1d5db;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.82rem;
  background: transparent;
  min-width: 120px;
  transition: all 0.15s;
}
.contact-edit-field:focus {
  border-color: var(--del-blue);
  background: #eff6ff;
  outline: none;
}

/* ── Generic Note badge ──────────────────────────────────── */
.badge-generic {
  display:inline-block; padding:2px 10px; border-radius:99px;
  background:var(--del-blue-dark); color:#fff; font-size:0.75rem; font-weight:600;
}

/* ── DEL Logo (red SVG color override) ───────────────────── */
.del-logo-red path, .del-logo-red rect, .del-logo-red circle, .del-logo-red polygon {
  fill: var(--del-red) !important;
}
