/* === FleetWrap OS — Phase 1 Styles === */
:root {
  --navy: #1a1a2e;
  --blue: #1a56db;
  --blue-light: #2563eb;
  --blue-bg: #eff6ff;
  --green: #22c55e;
  --green-bg: #f0fdf4;
  --yellow: #f59e0b;
  --yellow-bg: #fffbeb;
  --red: #ef4444;
  --red-bg: #fef2f2;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-900: #111827;
  --sidebar: #1a1a2e;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: var(--gray-900); background: var(--gray-50); }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* === Layout === */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px; background: var(--sidebar); color: #fff; padding: 20px 16px;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.sidebar .logo-mark {
  width: 36px; height: 36px; border-radius: 8px; background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px;
}
.sidebar h1 { font-size: 16px; font-weight: 600; }
.sidebar .brand p { font-size: 11px; color: #94a3b8; margin-top: -2px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a {
  padding: 10px 12px; border-radius: 6px; color: #cbd5e1; font-size: 14px; font-weight: 500;
  transition: all .15s; text-decoration: none;
}
.sidebar nav a:hover, .sidebar nav a.active { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-nav-category { font-size: 11px; text-transform: uppercase; color: #64748b; padding: 16px 12px 4px; letter-spacing: .05em; }

/* === Main Content === */
main { flex: 1; padding: 24px 32px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
.eyebrow { font-size: 12px; color: var(--gray-500); text-transform: uppercase; letter-spacing: .05em; }
.topbar h2 { font-size: 24px; font-weight: 700; margin: 2px 0 4px; }
.subhead { font-size: 14px; color: var(--gray-500); }

/* === Views === */
.view { display: none; }
.view.active { display: block; }

/* === Cards === */
.card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; margin-bottom: 16px;
}
.card h3 { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.stat-card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; text-align: center;
}
.stat-card .stat-value { font-size: 32px; font-weight: 700; color: var(--blue); }
.stat-card .stat-label { font-size: 13px; color: var(--gray-500); margin-top: 4px; }

/* === Tables === */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 10px 12px; font-size: 12px; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: .04em; border-bottom: 2px solid var(--gray-200); }
td { padding: 10px 12px; border-bottom: 1px solid var(--gray-100); font-size: 14px; }
tr:hover td { background: var(--gray-50); }

/* === Status Badges === */
.badge {
  display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 600;
}
.badge-intake, .badge-draft { background: var(--gray-100); color: var(--gray-700); }
.badge-proofing, .badge-active { background: var(--yellow-bg); color: #92400e; }
.badge-approved { background: var(--green-bg); color: #166534; }
.badge-production { background: var(--blue-bg); color: #1e40af; }
.badge-ready { background: var(--blue-bg); color: #1e40af; }
.badge-scheduled { background: var(--blue-bg); color: #1e40af; }
.badge-installed, .badge-complete { background: var(--green-bg); color: #166534; }
.badge-issue, .badge-blocked, .badge-hold { background: var(--red-bg); color: #991b1b; }
.badge-cancelled { background: var(--gray-100); color: var(--gray-500); }

/* === Buttons === */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 6px;
  font-size: 14px; font-weight: 500; cursor: pointer; border: 1px solid var(--gray-200);
  background: #fff; color: var(--gray-700); transition: all .15s;
}
.btn:hover { background: var(--gray-50); border-color: var(--gray-300); }
.btn.primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn.primary:hover { background: var(--blue-light); }
.btn.sm { font-size: 12px; padding: 4px 10px; }
.actions { display: flex; gap: 8px; }

/* === Forms === */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--gray-700); margin-bottom: 4px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 8px 12px; border: 1px solid var(--gray-300); border-radius: 6px; font-size: 14px;
}
.form-group textarea { resize: vertical; min-height: 60px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* === Notifications === */
#globalNotice { margin-bottom: 16px; }
.notice {
  padding: 12px 16px; border-radius: 6px; font-size: 14px; margin-bottom: 8px;
  display: flex; justify-content: space-between; align-items: center;
}
.notice.success { background: var(--green-bg); color: #166534; border: 1px solid #bbf7d0; }
.notice.error { background: var(--red-bg); color: #991b1b; border: 1px solid #fecaca; }
.notice.info { background: var(--blue-bg); color: #1e40af; border: 1px solid #bfdbfe; }
.notice .close { cursor: pointer; font-size: 18px; opacity: .6; }
.notice .close:hover { opacity: 1; }

/* === Fleet Projects === */
.project-card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; display: flex; justify-content: space-between; align-items: flex-start;
  cursor: pointer; transition: all .15s; margin-bottom: 12px;
}
.project-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.project-card h3 { font-size: 16px; font-weight: 600; }
.project-card .meta { font-size: 13px; color: var(--gray-500); margin-top: 4px; }
.project-card .right { text-align: right; }

/* === Modal === */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal {
  background: #fff; border-radius: var(--radius); box-shadow: 0 20px 60px rgba(0,0,0,.2);
  padding: 24px; max-width: 600px; width: 90%; max-height: 80vh; overflow-y: auto;
}
.modal h2 { font-size: 18px; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
