/* ==========================================================================
   FMFlow — Facility Management System
   Palette: Petrol (#134E4A) sidebar · Paper (#F7F8F6) canvas · Amber (#F59F00)
   Type: IBM Plex Sans (UI) · IBM Plex Mono (codes & numbers)
   ========================================================================== */
:root {
  --petrol: #134E4A;
  --petrol-dark: #0C3835;
  --paper: #F7F8F6;
  --ink: #1E2B2A;
  --line: #E3E7E3;
  --amber: #F59F00;
  --card-radius: 14px;
}

* { font-family: 'IBM Plex Sans', system-ui, sans-serif; }
body { background: var(--paper); color: var(--ink); }
.mono, .wo-code { font-family: 'IBM Plex Mono', monospace; font-weight: 500; letter-spacing: -0.02em; }

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 250px; flex-shrink: 0; background: var(--petrol); color: #DCE8E6;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 8px; padding: 20px 20px 14px; text-decoration: none; }
.brand-mark {
  background: var(--amber); color: var(--petrol-dark); font-weight: 700;
  padding: 3px 8px; border-radius: 7px; font-size: 15px;
}
.brand-name { color: #fff; font-weight: 700; font-size: 19px; letter-spacing: 0.02em; }

.industry-chip {
  margin: 0 16px 14px; padding: 9px 12px; border-radius: 10px;
  background: rgba(255,255,255,0.09); border-left: 4px solid var(--chip, var(--amber));
  display: flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 600; color: #fff;
}
.industry-chip i { font-size: 16px; color: var(--chip, var(--amber)); filter: brightness(1.6); }

.nav-menu { flex: 1; padding: 4px 12px; overflow-y: auto; }
.nav-menu a {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; margin-bottom: 2px;
  border-radius: 9px; color: #B9CFCB; text-decoration: none; font-size: 14px; font-weight: 500;
  transition: background .12s, color .12s;
}
.nav-menu a i { font-size: 16px; width: 18px; }
.nav-menu a:hover { background: rgba(255,255,255,0.07); color: #fff; }
.nav-menu a.active { background: rgba(255,255,255,0.13); color: #fff; box-shadow: inset 3px 0 0 var(--amber); }

.sidebar-footer { padding: 12px 16px 16px; border-top: 1px solid rgba(255,255,255,0.1); }
.sidebar-footer a { display: flex; align-items: center; gap: 9px; color: #9DBBB6; text-decoration: none; font-size: 13.5px; padding: 6px 6px; }
.sidebar-footer a:hover { color: #fff; }

/* ---------- Main area ---------- */
.main-area { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  background: #fff; border-bottom: 1px solid var(--line);
  padding: 14px 28px; display: flex; justify-content: space-between; align-items: center;
}
.topbar-title { font-size: 19px; font-weight: 700; }
.topbar-user { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 500; }
.topbar-user i { font-size: 21px; color: var(--petrol); }
.role-pill { background: #E7F0EE; color: var(--petrol); font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 20px; }

.content { padding: 24px 28px; }
.toast-msg { margin: 16px 28px 0; border-radius: 10px; }

/* ---------- Cards & KPIs ---------- */
.card { border: 1px solid var(--line); border-radius: var(--card-radius); box-shadow: 0 1px 2px rgba(20,40,38,.04); }
.card-header { background: #fff; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 14.5px; border-radius: var(--card-radius) var(--card-radius) 0 0 !important; }

.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--card-radius); padding: 16px 18px; height: 100%; }
.kpi .kpi-label { font-size: 12.5px; font-weight: 600; color: #6C7B78; text-transform: uppercase; letter-spacing: .04em; }
.kpi .kpi-value { font-family: 'IBM Plex Mono', monospace; font-size: 30px; font-weight: 500; line-height: 1.15; margin-top: 2px; }
.kpi .kpi-sub { font-size: 12.5px; color: #8A9895; }
.kpi.warn .kpi-value { color: #C92A2A; }
.kpi.good .kpi-value { color: #087F5B; }

/* ---------- Tables ---------- */
.table { font-size: 14px; }
.table thead th {
  background: #F0F3F1; font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
  color: #5C6B68; font-weight: 700; border-bottom: none; padding: 10px 14px; white-space: nowrap;
}
.table tbody td { padding: 11px 14px; vertical-align: middle; }
.table tbody tr:hover { background: #FAFBFA; }
.row-link { cursor: pointer; }

/* ---------- Badges ---------- */
.status-badge { font-size: 12px; font-weight: 700; padding: 4px 11px; border-radius: 20px; display: inline-block; white-space: nowrap; }
.badge-open      { background:#E7F5FF; color:#1971C2; }
.badge-assigned  { background:#EDF2FF; color:#4263EB; }
.badge-progress  { background:#FFF4E6; color:#E8590C; }
.badge-hold      { background:#FFF9DB; color:#B08800; }
.badge-done      { background:#E6FCF5; color:#087F5B; }
.badge-closed    { background:#F1F3F5; color:#5C6B68; }
.badge-critical  { background:#FFF0F0; color:#C92A2A; }
.badge-high      { background:#FFF4E6; color:#D9480F; }
.badge-medium    { background:#FFF9DB; color:#9A7B00; }
.badge-low       { background:#F1F3F5; color:#5C6B68; }
.overdue-flag { color:#C92A2A; font-size:12px; font-weight:700; }

/* ---------- Buttons ---------- */
.btn-fm { background: var(--petrol); color: #fff; font-weight: 600; border-radius: 9px; border: none; }
.btn-fm:hover { background: var(--petrol-dark); color: #fff; }
.btn-amber { background: var(--amber); color: #3B2F00; font-weight: 700; border-radius: 9px; border: none; }
.btn-amber:hover { background: #E08E00; color: #3B2F00; }
.btn-outline-fm { border: 1.5px solid var(--petrol); color: var(--petrol); font-weight: 600; border-radius: 9px; }
.btn-outline-fm:hover { background: var(--petrol); color: #fff; }

/* ---------- Forms ---------- */
.form-label { font-weight: 600; font-size: 13.5px; }
.form-control, .form-select { border-radius: 9px; border-color: #D5DCD9; font-size: 14px; }
.form-control:focus, .form-select:focus { border-color: var(--petrol); box-shadow: 0 0 0 3px rgba(19,78,74,.12); }
.form-hint { font-size: 12.5px; color: #8A9895; }

/* ---------- Filter bar ---------- */
.filter-bar { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; }
.filter-tabs a {
  display: inline-block; padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 600;
  color: #5C6B68; text-decoration: none; margin-right: 4px;
}
.filter-tabs a:hover { background: #F0F3F1; }
.filter-tabs a.on { background: var(--petrol); color: #fff; }

/* ---------- Industry selection screen ---------- */
.pick-page { min-height: 100vh; background: var(--petrol); background-image: radial-gradient(1000px 500px at 85% -10%, rgba(245,159,0,.14), transparent); display:flex; flex-direction:column; }
.pick-wrap { max-width: 1100px; margin: 0 auto; padding: 56px 24px 64px; width: 100%; }
.pick-brand { display:flex; align-items:center; gap:10px; margin-bottom: 40px; }
.pick-title { color:#fff; font-size: 34px; font-weight: 700; letter-spacing:-.01em; }
.pick-sub { color:#A9C4BF; font-size: 16px; margin-top: 8px; max-width: 560px; }
.industry-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-top: 36px; }
.industry-card {
  background:#fff; border-radius:16px; padding:22px; text-decoration:none; color:var(--ink);
  border-top: 5px solid var(--c); transition: transform .12s, box-shadow .12s; display:block;
}
.industry-card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(0,0,0,.22); color: var(--ink); }
.industry-card .ic { width:46px; height:46px; border-radius:12px; display:flex; align-items:center; justify-content:center;
  background: color-mix(in srgb, var(--c) 14%, white); color: var(--c); font-size:22px; margin-bottom:14px; }
.industry-card h5 { font-weight:700; font-size:17px; margin-bottom:4px; }
.industry-card p { font-size:13.5px; color:#6C7B78; margin-bottom:12px; min-height: 40px; }
.industry-card .go { font-size:13px; font-weight:700; color:var(--c); }

/* ---------- Login ---------- */
.login-page { min-height:100vh; background:var(--petrol); display:flex; align-items:center; justify-content:center;
  background-image: radial-gradient(900px 450px at 15% 110%, rgba(245,159,0,.13), transparent); }
.login-card { background:#fff; border-radius:18px; padding:36px; width:100%; max-width:420px; box-shadow:0 20px 50px rgba(0,0,0,.3); }
.login-card h4 { font-weight:700; }
.demo-creds { background:#F0F6F5; border:1px dashed #B9CFCB; border-radius:10px; padding:12px 14px; font-size:13px; }
.demo-creds code { color: var(--petrol); font-weight:700; }

/* ---------- Detail pages ---------- */
.detail-head { background:#fff; border:1px solid var(--line); border-radius:var(--card-radius); padding:20px 22px; margin-bottom:18px; }
.detail-head h4 { font-weight:700; margin-bottom:2px; }
.meta-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:14px; margin-top:14px; }
.meta-grid .m-label { font-size:11.5px; font-weight:700; text-transform:uppercase; color:#8A9895; letter-spacing:.05em; }
.meta-grid .m-value { font-size:14.5px; font-weight:600; margin-top:2px; }

.stock-pill { font-family:'IBM Plex Mono',monospace; font-weight:500; }
.progress { height: 8px; border-radius: 8px; }

.empty-state { text-align:center; padding: 48px 20px; color:#8A9895; }
.empty-state i { font-size: 42px; display:block; margin-bottom: 10px; color:#C4CFCB; }

@media (max-width: 900px) {
  .sidebar { width: 68px; }
  .brand-name, .industry-chip span, .nav-menu a span { display:none; }
  .nav-menu a { justify-content:center; }
}
