:root {
  --primary: #059669;
  --teal: #0f766e;
  --blue: #2563eb;
  --purple: #7c3aed;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e5e7eb;
  --surface: #ffffff;
  --canvas: #f6f8fb;
  --sidebar-width: 264px;
  --sidebar-collapsed-width: 76px;
}
* { box-sizing: border-box; }
html { max-width: 100%; overflow-x: hidden; scroll-behavior: smooth; }
body { max-width: 100%; overflow-x: hidden; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--canvas); color: #334155; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a, button { transition: all .18s ease; }
.font-black { font-weight: 700 !important; }
.font-bold { font-weight: 600 !important; }
.font-semibold { font-weight: 500 !important; }
.tracking-wide { letter-spacing: .025em !important; }
.shadow-soft { box-shadow: 0 12px 28px rgba(15, 23, 42, .07) !important; }
.rounded-2xl { border-radius: 14px !important; }
.app-card { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 22px rgba(15, 23, 42, .045); }
.metric-card { min-height: 154px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; box-shadow: 0 8px 22px rgba(15, 23, 42, .04); }
.metric-card:hover, .app-card:hover { border-color: #d4dce7; box-shadow: 0 14px 30px rgba(15, 23, 42, .065); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; border-radius: 9px; padding: .58rem .88rem; font-weight: 600; font-size: .875rem; line-height: 1.25rem; white-space: nowrap; }
.btn-primary { background: var(--primary); color: white; box-shadow: 0 8px 18px rgba(5, 150, 105, .18); }
.btn-primary:hover { background: #047857; }
.btn-secondary { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.btn-ghost { background: white; border: 1px solid #d6dee8; color: #475569; }
.btn-ghost:hover, .btn-secondary:hover { background: #f8fafc; border-color: #b8c4d4; color: #0f172a; }
.btn-danger { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.field { width: 100%; border: 1px solid #d4dce7; border-radius: 9px; padding: .64rem .78rem; background: white; color: #0f172a; outline: none; font-size: .9rem; }
.field:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(5, 150, 105, .14); }
.label { display: block; font-size: .75rem; font-weight: 600; color: #64748b; margin-bottom: .35rem; }
.kepro-logo { display: block; height: 3rem; width: auto; max-width: 100%; object-fit: contain; }
.kepro-logo-sidebar { height: 3rem; max-width: 9.75rem; }
.kepro-logo-hero { height: 3.45rem; }
.kepro-logo-auth { height: 3.25rem; }
.badge { display: inline-flex; align-items: center; gap: .35rem; border-radius: 999px; padding: .25rem .58rem; font-size: .72rem; font-weight: 600; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1d4ed8; }
.badge-purple { background: #ede9fe; color: #6d28d9; }
#sidebar { background: linear-gradient(180deg, #075941 0%, #0f6b5e 100%) !important; }
.sidebar-icon-button { display: inline-flex; height: 2.25rem; width: 2.25rem; shrink: 0; align-items: center; justify-content: center; border-radius: 9px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.08); color: rgba(236,253,245,.9); }
.sidebar-icon-button:hover { background: rgba(255,255,255,.16); color: #fff; }
.sidebar-link { display: flex; align-items: center; gap: .72rem; padding: .64rem .72rem; border-radius: 10px; color: rgba(236, 253, 245, .82); font-weight: 500; font-size: .88rem; line-height: 1.2rem; }
.sidebar-link i { color: rgba(209, 250, 229, .9); font-size: .95rem; }
.sidebar-link span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-link:hover, .sidebar-link.active { background: rgba(255,255,255,.12); color: #fff; }
.sidebar-link.active { box-shadow: inset 3px 0 0 rgba(167, 243, 208, .95); }
#app, #content-shell, #page-content { max-width: 100%; min-width: 0; overflow-x: clip; }
#content-shell .grid, #content-shell .grid > *, #content-shell section, #content-shell form { min-width: 0; }
.table-wrap { width: 100%; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
table { width: 100%; min-width: 680px; border-collapse: separate; border-spacing: 0; }
th { text-align: left; font-size: .7rem; color: #64748b; text-transform: uppercase; letter-spacing: .04em; background: #f8fafc; font-weight: 600; }
th, td { padding: .78rem .9rem; border-bottom: 1px solid #edf1f5; }
td { font-size: .875rem; color: #334155; vertical-align: middle; }
.workflow-step { position: relative; }
.workflow-step:not(:last-child)::after { content: ""; position: absolute; left: 32px; top: 62px; bottom: -18px; width: 2px; background: #cbd5e1; }
.mobile-sidebar-open #sidebar { transform: translateX(0); }
@media (min-width: 1024px) {
  #sidebar { width: var(--sidebar-width) !important; max-width: var(--sidebar-width); overflow-x: hidden; overflow-y: auto; transition: width .2s ease, padding .2s ease; }
  #content-shell { margin-left: var(--sidebar-width) !important; width: auto !important; max-width: calc(100vw - var(--sidebar-width)); transition: margin-left .2s ease, max-width .2s ease; }
  body.sidebar-collapsed #sidebar { width: var(--sidebar-collapsed-width) !important; max-width: var(--sidebar-collapsed-width); padding-left: .75rem; padding-right: .75rem; }
  body.sidebar-collapsed #content-shell { margin-left: var(--sidebar-collapsed-width) !important; max-width: calc(100vw - var(--sidebar-collapsed-width)); }
  body.sidebar-collapsed .sidebar-brand { justify-content: center; padding-left: 0; padding-right: 0; }
  body.sidebar-collapsed .kepro-logo-sidebar { display: none; }
  body.sidebar-collapsed .portal-card { display: none; }
  body.sidebar-collapsed .sidebar-link { justify-content: center; padding-left: .6rem; padding-right: .6rem; }
  body.sidebar-collapsed .sidebar-link span { display: none; }
  body.sidebar-collapsed .sidebar-link i { width: auto; }
  body.sidebar-collapsed .sidebar-icon-button i { transform: rotate(180deg); }
}
@media (max-width: 1023px) {
  #sidebar { width: min(86vw, 264px) !important; transform: translateX(-105%); position: fixed; z-index: 60; height: 100vh; overflow-y: auto; transition: transform .2s ease; }
  #content-shell { margin-left: 0 !important; max-width: 100vw; }
  table { min-width: 640px; }
}
@media (max-width: 720px) {
  table { min-width: 560px; }
  th, td { padding: .7rem .72rem; }
}
@media print {
  #sidebar, #topbar, .no-print { display: none !important; }
  #content-shell { margin-left: 0 !important; }
}
