:root {
  --brand-navy: #14213d;
  --brand-blue: #1668e3;
  --brand-blue-dark: #0d4fb8;
  --brand-light: #f4f7fb;
  --brand-gray: #8a94a6;
  --sidebar-width: 260px;
}

* { box-sizing: border-box; }

body {
  background: var(--brand-light);
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  color: #2b2f38;
}

.app-wrapper { display: flex; min-height: 100vh; }

/* Sidebar */
.app-sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--brand-navy) 0%, #0b1730 100%);
  color: #fff;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 1030;
  transition: transform .25s ease;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand img { width: 42px; height: 42px; border-radius: 8px; background: #fff; object-fit: contain; padding: 2px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 700; font-size: .85rem; color: #fff; }
.brand-slogan { font-size: .68rem; color: #9fb3d9; }

.sidebar-menu { padding: 10px 0 30px; }
.nav-section {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .06em;
  color: #6d80a8; padding: 14px 18px 6px;
}
.app-sidebar .nav-link {
  color: #c4d1ec; padding: 9px 18px; font-size: .875rem; border-radius: 0;
  display: flex; align-items: center; gap: 10px;
}
.app-sidebar .nav-link i { width: 18px; text-align: center; }
.app-sidebar .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.app-sidebar .nav-link.active { background: var(--brand-blue); color: #fff; font-weight: 600; }

/* Main */
.app-main { margin-left: var(--sidebar-width); flex: 1; display: flex; flex-direction: column; min-height: 100vh; width: calc(100% - var(--sidebar-width)); }
.app-topbar {
  background: #fff; border-bottom: 1px solid #e6e9f0;
  padding: 12px 22px; display: flex; align-items: center; gap: 14px;
  position: sticky; top: 0; z-index: 1020;
}
.topbar-title { font-weight: 600; color: var(--brand-navy); }
.avatar-circle {
  width: 34px; height: 34px; border-radius: 50%; background: var(--brand-blue); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem;
}
.app-content { padding: 22px; flex: 1; }
.app-footer { padding: 14px 22px; font-size: .8rem; color: var(--brand-gray); display: flex; justify-content: space-between; border-top: 1px solid #e6e9f0; background: #fff; }

/* Cards */
.card { border: 1px solid #eaedf3; border-radius: 12px; box-shadow: 0 1px 3px rgba(20,33,61,.04); }
.kpi-card { border-radius: 14px; padding: 18px 20px; color: #fff; position: relative; overflow: hidden; }
.kpi-card .kpi-icon { font-size: 1.9rem; opacity: .85; }
.kpi-card .kpi-value { font-size: 1.6rem; font-weight: 700; }
.kpi-card .kpi-label { font-size: .78rem; opacity: .9; }
.kpi-blue { background: linear-gradient(135deg,#1668e3,#0d4fb8); }
.kpi-navy { background: linear-gradient(135deg,#14213d,#28345c); }
.kpi-green { background: linear-gradient(135deg,#0fa968,#0c7f4f); }
.kpi-orange { background: linear-gradient(135deg,#f0932b,#c9691a); }
.kpi-red { background: linear-gradient(135deg,#e34848,#b52f2f); }
.kpi-teal { background: linear-gradient(135deg,#12a3a3,#0c7676); }
.kpi-purple { background: linear-gradient(135deg,#7a5cf0,#5636c9); }

.section-title { font-weight: 700; color: var(--brand-navy); margin-bottom: 4px; }
.table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--brand-gray); border-bottom-width: 1px; }
.btn-primary { background: var(--brand-blue); border-color: var(--brand-blue); }
.btn-primary:hover { background: var(--brand-blue-dark); border-color: var(--brand-blue-dark); }
.text-brand { color: var(--brand-blue); }
.bg-brand-navy { background: var(--brand-navy); }

.workflow-track { display: flex; overflow-x: auto; gap: 4px; padding-bottom: 8px; }
.workflow-step { flex: 0 0 auto; min-width: 130px; text-align: center; padding: 10px 8px; border-radius: 8px; background: #eef1f7; font-size: .72rem; color: #667; position: relative; }
.workflow-step.done { background: #d9f2e4; color: #0c7f4f; font-weight: 600; }
.workflow-step.current { background: var(--brand-blue); color: #fff; font-weight: 700; }

.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--brand-navy), #0b1730); }
.login-card { background: #fff; border-radius: 16px; padding: 40px; width: 100%; max-width: 420px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-card img { width: 90px; display: block; margin: 0 auto 12px; }

@media (max-width: 991px) {
  .app-sidebar { transform: translateX(-100%); }
  .app-sidebar.show { transform: translateX(0); }
  .app-main { margin-left: 0; width: 100%; }
}

/* Print / PDF documents */
.doc-header { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 3px solid #14213d; padding-bottom: 14px; margin-bottom: 20px; }
.doc-header img { height: 60px; }
.doc-title { font-size: 1.4rem; font-weight: 700; color: #14213d; text-transform: uppercase; }
