/* ===== Base ===== */
body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  margin: 0;
  background: #f6f7fb;
  color: #111827;
}

a {
  color: #2563eb;
  text-decoration: none;
}

* {
  box-sizing: border-box;
}

/* ===== Cabinet top nav ===== */
.cabinet-topnav-wrap {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #0f172a;
  border-bottom: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  margin-bottom: 24px;
}

.cabinet-topnav {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.cabinet-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.cabinet-brand-title {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.cabinet-userbox {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,.85);
  font-size: 13px;
  flex-wrap: wrap;
}

.cabinet-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.10);
  color: #fff;
  font-size: 12px;
  line-height: 1;
}

.cabinet-badge.admin {
  background: rgba(59,130,246,.22);
}

.cabinet-nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cabinet-nav-link {
  color: rgba(255,255,255,.88);
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 10px;
  transition: background .15s ease, color .15s ease;
  font-size: 14px;
  line-height: 1.2;
}

.cabinet-nav-link:hover {
  background: rgba(255,255,255,.10);
  color: #fff;
}

.cabinet-nav-link.active {
  background: #2563eb;
  color: #fff;
  font-weight: 600;
}

.cabinet-logout-btn {
  border: 0;
  cursor: pointer;
  background: rgba(239,68,68,.14);
  color: #fff;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.2;
}

.cabinet-logout-btn:hover {
  background: rgba(239,68,68,.22);
}

/* ===== Shared layout ===== */
.app-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px;
}

.app-page-title {
  margin: 0 0 18px 0;
  font-size: 28px;
  font-weight: 700;
}

.app-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 20px;
}

.app-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 8px 30px rgba(0,0,0,.04);
}

.app-card h2 {
  margin: 0 0 14px 0;
  font-size: 18px;
}

.app-muted {
  color: #6b7280;
  font-size: 13px;
}

.app-empty {
  padding: 20px;
  border: 1px dashed #d1d5db;
  border-radius: 12px;
  color: #6b7280;
  text-align: center;
}

/* ===== Toolbar / form ===== */
.app-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin-bottom: 16px;
}

.app-field {
  min-width: 180px;
  flex: 1 1 180px;
}

.app-field label {
  display: block;
  font-size: 14px;
  color: #374151;
  margin-bottom: 6px;
}

.app-input,
.app-select,
.app-textarea,
input[type="date"],
input[type="text"],
input[type="file"],
select,
textarea {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
}

.app-form {
  display: grid;
  gap: 12px;
}

.app-form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ===== Buttons ===== */
.app-btn {
  border: 0;
  cursor: pointer;
  border-radius: 10px;
  padding: 10px 14px;
  font: inherit;
  background: #2563eb;
  color: #fff;
}

.app-btn.secondary {
  background: #eef2ff;
  color: #1f2937;
}

.app-btn.danger {
  background: #dc2626;
  color: #fff;
}

.app-btn.small {
  padding: 7px 10px;
  font-size: 13px;
}

/* ===== Badges ===== */
.app-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  line-height: 1;
  font-weight: 600;
}

.app-badge.ok {
  background: #dcfce7;
  color: #166534;
}

.app-badge.warn {
  background: #fef3c7;
  color: #92400e;
}

.app-badge.neutral {
  background: #e5e7eb;
  color: #374151;
}

/* ===== Tables ===== */
.app-table-wrap {
  overflow-x: auto;
}

.app-table {
  width: 100%;
  border-collapse: collapse;
}

.app-table th,
.app-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

.app-table th {
  color: #374151;
  font-weight: 600;
  background: #f9fafb;
}

.app-inline-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.app-selected {
  margin-bottom: 14px;
  padding: 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
}

/* ===== Responsive ===== */
@media (max-width: 980px) {
  .app-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .cabinet-topnav {
    align-items: flex-start;
  }

  .cabinet-brand,
  .cabinet-nav-links {
    width: 100%;
  }
}
/* ===== FBO planning analytics ===== */
.app-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 0 0 20px 0; }
.app-kpi-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 16px; padding: 16px; box-shadow: 0 8px 30px rgba(0,0,0,.04); }
.app-kpi-label { font-size: 13px; color: #6b7280; margin-bottom: 8px; }
.app-kpi-value { font-size: 28px; font-weight: 700; line-height: 1.1; color: #111827; }
.app-checkbox { display: flex; align-items: center; gap: 8px; min-height: 42px; }
.app-checkbox input { width: 16px; height: 16px; margin: 0; }
.app-status { margin: 0 0 14px 0; padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.app-status.info { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.app-status.ok { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.app-status.warn { background: #fff7ed; color: #c2410c; border: 1px solid #fdba74; }
.app-status.error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.app-badge.high { background: #fee2e2; color: #b91c1c; }
.app-badge.medium { background: #fef3c7; color: #92400e; }
.app-badge.low { background: #dcfce7; color: #166534; }
.app-table td strong { color: #111827; }
.app-table td .app-muted { display: block; margin-top: 4px; }
.app-table td.actions-cell { min-width: 150px; }
@media (max-width: 1100px) { .app-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .app-kpi-grid { grid-template-columns: 1fr; } }
