/* ConstructionERP design system: dark navy sidebar, orange accent, light content area. */
:root {
  --erp-navy: #14213d;
  --erp-navy-2: #1d2f52;
  --erp-accent: #f77f00;
  --erp-bg: #f4f6fa;
  --erp-card: #ffffff;
  --erp-text: #1f2937;
  --erp-muted: #6b7280;
  --erp-radius: 14px;
  --erp-shadow: 0 1px 2px rgba(20, 33, 61, 0.06), 0 4px 16px rgba(20, 33, 61, 0.05);
  --erp-sidebar-w: 248px;
}

html { font-size: 14px; }
@media (min-width: 768px) { html { font-size: 15px; } }

body.erp-body { background: var(--erp-bg); color: var(--erp-text); min-height: 100vh; }

/* ---- Shell ---- */
.erp-shell { display: flex; min-height: 100vh; }
.erp-sidebar {
  width: var(--erp-sidebar-w); background: linear-gradient(180deg, var(--erp-navy), #0e1830);
  color: #e5e7eb; position: sticky; top: 0; height: 100vh; overflow-y: auto; flex-shrink: 0;
  transition: margin-left .2s ease;
}
.erp-shell.erp-collapsed .erp-sidebar { margin-left: calc(-1 * var(--erp-sidebar-w)); }
.erp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.erp-brand { display: flex; align-items: center; gap: .6rem; padding: 1.1rem 1.2rem; color: #fff; text-decoration: none; font-weight: 700; letter-spacing: .2px; }
.erp-logo { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--erp-accent); color: #fff; font-size: .8rem; font-weight: 800; }

.erp-nav { padding: .25rem .6rem 2rem; }
.erp-link, .erp-group-toggle {
  display: flex; align-items: center; gap: .65rem; width: 100%; padding: .6rem .75rem; margin: 2px 0;
  border: 0; border-radius: 10px; background: transparent; color: #cbd5e1; text-decoration: none; text-align: left;
  transition: background .15s ease, color .15s ease;
}
.erp-link:hover, .erp-group-toggle:hover, .erp-sublink:hover { background: var(--erp-navy-2); color: #fff; }
.erp-link.active, .erp-sublink.active { background: rgba(247, 127, 0, .16); color: #fff; box-shadow: inset 3px 0 0 var(--erp-accent); }
.erp-link-soon { opacity: .55; }
.erp-ico { width: 1.25rem; text-align: center; color: var(--erp-accent); }
.erp-caret { margin-left: auto; transition: transform .2s ease; }
.erp-group-toggle.collapsed .erp-caret { transform: rotate(-90deg); }
.erp-sublink { display: block; padding: .4rem .75rem .4rem 2.6rem; border-radius: 8px; color: #aab4c5; text-decoration: none; font-size: .92rem; }

/* ---- Top bar ---- */
.erp-topbar {
  position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: .75rem;
  padding: .6rem 1.1rem; background: rgba(255, 255, 255, .92); backdrop-filter: blur(6px); border-bottom: 1px solid #e5e7eb;
}
.erp-search { flex: 1; max-width: 460px; }
.erp-icon-btn { border: 1px solid #e5e7eb; background: #fff; width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 10px; }
.erp-bell-count { position: absolute; top: -4px; right: -6px; font-size: .65rem; }
.erp-user-btn { border: 1px solid #e5e7eb; background: #fff; border-radius: 10px; }
.erp-progress { height: 3px; background: transparent; overflow: hidden; }
.erp-progress.active::after { content: ""; display: block; height: 100%; width: 40%; background: var(--erp-accent); animation: erp-slide 1s infinite ease-in-out; }
@keyframes erp-slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }

.erp-content { padding: 1.25rem 1.5rem 2rem; flex: 1; }
.erp-title { font-size: 1.35rem; font-weight: 700; color: var(--erp-navy); }
.erp-footer { padding: .75rem 1.5rem; color: var(--erp-muted); font-size: .8rem; border-top: 1px solid #e5e7eb; background: #fff; }
.erp-breadcrumb { font-size: .85rem; }

/* ---- Cards, KPIs, tables ---- */
.erp-card { background: var(--erp-card); border-radius: var(--erp-radius); box-shadow: var(--erp-shadow); border: 0; }
.erp-card .card-header { background: transparent; border-bottom: 1px solid #eef1f6; font-weight: 600; }
.erp-kpi { padding: 1rem 1.1rem; height: 100%; transition: transform .18s ease, box-shadow .18s ease; }
.erp-kpi:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(20, 33, 61, .12); }
.erp-kpi-value { font-size: 1.7rem; font-weight: 800; color: var(--erp-navy); line-height: 1.1; }
.erp-kpi-label { color: var(--erp-muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
.erp-kpi-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(247, 127, 0, .14); color: var(--erp-accent); font-size: 1.1rem; }
.erp-chart-box { position: relative; height: 260px; }

.table { --bs-table-bg: transparent; }
.table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--erp-muted); border-bottom-width: 1px; white-space: nowrap; }
.table td { vertical-align: middle; }
.erp-empty { text-align: center; padding: 2.5rem 1rem; color: var(--erp-muted); }

.badge-status { font-weight: 600; letter-spacing: .02em; }
.erp-pager .page-link { border-radius: 8px; margin: 0 2px; border: 0; color: var(--erp-navy); }
.erp-pager .page-item.active .page-link { background: var(--erp-navy); }

.btn-accent { background: var(--erp-accent); border-color: var(--erp-accent); color: #fff; }
.btn-accent:hover { background: #e07000; border-color: #e07000; color: #fff; }
.btn-navy { background: var(--erp-navy); border-color: var(--erp-navy); color: #fff; }
.btn-navy:hover { background: #0e1830; color: #fff; }

.form-label { font-weight: 600; font-size: .86rem; color: #374151; }
.form-section { border-left: 3px solid var(--erp-accent); padding-left: .75rem; margin: 1.2rem 0 .8rem; font-weight: 700; color: var(--erp-navy); }

/* ---- Auth pages ---- */
.erp-auth-body { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, var(--erp-navy), #0e1830 60%, #3a2a1a); padding: 1rem; }
.erp-auth-card { width: min(420px, 100%); background: #fff; border-radius: 18px; padding: 2rem; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.erp-auth-brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; color: var(--erp-navy); margin-bottom: 1.2rem; font-size: 1.1rem; }

/* ---- Org chart ---- */
.erp-org details { margin-left: 1.1rem; }
.erp-org summary { list-style: none; cursor: pointer; }
.erp-org summary::-webkit-details-marker { display: none; }
.erp-org-node { display: inline-flex; align-items: center; gap: .6rem; padding: .45rem .7rem; border-radius: 12px; background: #fff; box-shadow: var(--erp-shadow); margin: .3rem 0; }
.erp-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: #e5e7eb; display: inline-grid; place-items: center; color: var(--erp-navy); font-weight: 700; font-size: .8rem; }

/* ---- Toasts ---- */
.erp-toasts .toast { min-width: 280px; border-radius: 12px; }

/* ---- Mobile: the sidebar slides over the content and the page stays usable ---- */
@media (max-width: 991px) {
  .erp-sidebar { position: fixed; z-index: 1040; left: 0; top: 0; box-shadow: 4px 0 24px rgba(0, 0, 0, .25); }
  .erp-shell.erp-collapsed .erp-sidebar { margin-left: calc(-1 * var(--erp-sidebar-w)); }
  .erp-shell:not(.erp-collapsed) .erp-main::before { content: ""; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 1030; }
  .erp-content { padding: 1rem .8rem 1.5rem; }
  .erp-search { display: none; }
  .erp-kpi-value { font-size: 1.4rem; }
  .table-responsive { font-size: .9rem; }
}

/* Field screens: big, thumb-friendly controls for employees on site */
.erp-clock-card { border-top: 4px solid var(--erp-accent); }
.erp-clock-btn { min-height: 76px; font-size: 1.25rem; font-weight: 700; border-radius: 16px; }
.erp-clock-since { font-size: 2rem; }
@media (max-width: 767px) {
  .erp-content { padding-left: .6rem; padding-right: .6rem; }
  .form-control, .form-select { min-height: 46px; }
}

/* Mobile capture-friendly inputs (employees on site) */
input[type="file"][capture] { font-size: 1rem; }
