/* ============================================================
   NormaCheck — Shared Stylesheet  v4.0
   Bootstrap 5 + Custom Design Tokens
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

:root {
  --nc-blue:       #2077B2;
  --nc-blue-dk:    #1A66A0;
  --nc-blue-lt:    #EAF3FA;
  --nc-blue-bd:    #A8D4ED;
  --nc-navy:       #0a3d62;
  --nc-purple:     #7C3AED;
  --nc-purple-lt:  #F5F3FF;
  --nc-green:      #3B6D11;
  --nc-green-lt:   #EAF3DE;
  --nc-amber:      #854F0B;
  --nc-amber-lt:   #FAEEDA;
  --nc-red:        #A32D2D;
  --nc-red-lt:     #FCEBEB;
  --nc-gray-lt:    #F1EFE8;
  --nc-gray-text:  #5F5E5A;
  --nc-font:       'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --nc-radius:     8px;
  --nc-radius-lg:  12px;
  --nc-shadow:     0 1px 3px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.05);
}

* { box-sizing: border-box; }

body {
  font-family: var(--nc-font);
  font-size: 14px;
  color: #1a1a1a;
  background: #f5f5f5;
  -webkit-font-smoothing: antialiased;
}

/* ── App Shell ─────────────────────────── */
.nc-app { min-height: 100vh; background: #fff; display: flex; flex-direction: column; }

/* ── Top Header ────────────────────────── */
.nc-header {
  position: sticky; top: 0; z-index: 1030;
  background: #fff;
  border-bottom: 1px solid #e8e8e8;
  padding: 10px 24px;
  display: flex; align-items: center; justify-content: space-between;
  height: 54px;
}
.nc-logo-wrap { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.nc-logo-text { font-size: 18px; font-weight: 600; color: var(--nc-navy); letter-spacing: -.3px; }
.nc-logo-text span { color: var(--nc-blue); }
.nc-header-right { display: flex; align-items: center; gap: 8px; }

/* Role badge */
.nc-role-badge {
  font-size: 11px; font-weight: 700; padding: 3px 10px;
  border-radius: 20px; letter-spacing: .05em; text-transform: uppercase;
}
.nc-role-admin { background: var(--nc-purple-lt); color: var(--nc-purple); }
.nc-role-ing   { background: var(--nc-blue-lt);   color: var(--nc-blue); }

/* User pill */
.nc-user-pill {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; color: #666; cursor: pointer;
  padding: 4px 10px; border: 1px solid #ddd; border-radius: 20px;
  text-decoration: none; transition: background .12s;
}
.nc-user-pill:hover { background: #f5f5f5; color: #333; }

/* Avatar */
.nc-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  background: var(--nc-blue-lt); color: var(--nc-blue);
  flex-shrink: 0;
}
.nc-avatar.adm { background: var(--nc-purple-lt); color: var(--nc-purple); }

/* Small button */
.nc-btn-sm {
  padding: 5px 12px; font-size: 12px; border-radius: 6px;
  border: 1px solid #ddd; background: #fff; color: #555;
  cursor: pointer; font-family: var(--nc-font); transition: background .12s;
}
.nc-btn-sm:hover { background: #f5f5f5; }

/* ── Sidebar ───────────────────────────── */
.nc-sidebar {
  width: 220px; flex-shrink: 0;
  background: #fafafa;
  border-right: 1px solid #e8e8e8;
  padding: 14px 8px 80px;
  position: sticky; top: 54px;
  height: calc(100vh - 54px);
  overflow-y: auto;
}
.nc-sb-section {
  font-size: 10px; font-weight: 700; color: #bbb;
  letter-spacing: .08em; text-transform: uppercase;
  padding: 0 10px; margin: 16px 0 4px;
}
.nc-sb-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
  font-size: 13px; color: #555; margin-bottom: 2px;
  border-left: 2px solid transparent;
  transition: all .12s; text-decoration: none;
}
.nc-sb-item:hover:not(.active) { background: #f0f0f0; color: #222; }
.nc-sb-item.active {
  background: var(--nc-blue-lt); color: var(--nc-blue);
  font-weight: 600; border-left-color: var(--nc-blue);
}

/* ── Layout Wrapper ────────────────────── */
.nc-layout { display: flex; flex: 1; }
.nc-main { flex: 1; padding: 28px 28px 80px; min-width: 0; overflow-x: hidden; }

/* ── Buttons ───────────────────────────── */
.btn-nc-primary {
  padding: 9px 18px; background: var(--nc-blue); color: #fff;
  border: none; border-radius: var(--nc-radius); font-size: 14px;
  font-weight: 600; cursor: pointer; font-family: var(--nc-font);
  transition: background .12s; display: inline-flex; align-items: center; gap: 6px;
}
.btn-nc-primary:hover { background: var(--nc-blue-dk); color: #fff; }

.btn-nc-secondary {
  padding: 9px 18px; background: #fff; color: #555;
  border: 1px solid #ccc; border-radius: var(--nc-radius); font-size: 14px;
  cursor: pointer; font-family: var(--nc-font); transition: background .12s;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-nc-secondary:hover { background: #f5f5f5; color: #333; }

.btn-nc-danger {
  padding: 9px 18px; background: #fff; color: var(--nc-red);
  border: 1px solid #F09595; border-radius: var(--nc-radius); font-size: 14px;
  cursor: pointer; font-family: var(--nc-font); transition: background .12s;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-nc-danger:hover { background: var(--nc-red-lt); }

/* ── Cards ─────────────────────────────── */
.nc-card {
  background: #fff; border: 1px solid #e8e8e8;
  border-radius: var(--nc-radius-lg); padding: 22px;
  box-shadow: var(--nc-shadow);
}
.nc-card.p-0 { padding: 0; overflow: hidden; }

/* ── Metrics ───────────────────────────── */
.nc-metric-card {
  background: #f5f5f5; border-radius: 10px; padding: 20px;
}
.nc-metric-val {
  font-size: 28px; font-weight: 400; letter-spacing: -1px; line-height: 1;
}
.nc-metric-label {
  font-size: 11px; color: #888; margin-top: 6px;
  text-transform: uppercase; letter-spacing: .05em;
}

/* ── Page Titles ───────────────────────── */
.nc-page-title { font-size: 22px; font-weight: 600; color: var(--nc-navy); margin-bottom: 2px; }
.nc-page-sub   { font-size: 13px; color: #888; margin-bottom: 24px; }

/* ── Data Table ────────────────────────── */
.nc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.nc-table th {
  text-align: left; padding: 9px 14px;
  font-size: 11px; color: #888; font-weight: 700;
  border-bottom: 1px solid #e8e8e8; background: #fafafa;
  text-transform: uppercase; letter-spacing: .05em; white-space: nowrap;
}
.nc-table td {
  padding: 11px 14px; border-bottom: 1px solid #f0f0f0; color: #1a1a1a;
  vertical-align: middle;
}
.nc-table tr:last-child td { border-bottom: none; }
.nc-table tbody tr:hover td { background: #f8f9fc; }

/* ── Badges ────────────────────────────── */
.nc-badge {
  padding: 3px 9px; border-radius: 20px; font-size: 11px;
  font-weight: 700; display: inline-block; white-space: nowrap;
}
.nc-badge-ok     { background: var(--nc-green-lt); color: var(--nc-green); }
.nc-badge-warn   { background: var(--nc-amber-lt); color: var(--nc-amber); }
.nc-badge-err    { background: var(--nc-red-lt);   color: var(--nc-red); }
.nc-badge-info   { background: var(--nc-blue-lt);  color: var(--nc-blue); }
.nc-badge-gray   { background: var(--nc-gray-lt);  color: var(--nc-gray-text); }
.nc-badge-purple { background: var(--nc-purple-lt);color: var(--nc-purple); }
.nc-badge-new    { background: #ECFDF5; color: #065F46; }

/* ── Forms ─────────────────────────────── */
.nc-form-group { margin-bottom: 18px; }
.nc-form-label { font-size: 13px; font-weight: 600; color: #555; margin-bottom: 6px; display: block; }
.nc-form-control {
  width: 100%; padding: 9px 12px; border: 1px solid #ccc;
  border-radius: var(--nc-radius); font-size: 14px; color: #1a1a1a;
  background: #fff; outline: none; font-family: var(--nc-font);
  transition: border .15s, box-shadow .15s;
}
.nc-form-control:focus {
  border-color: var(--nc-blue);
  box-shadow: 0 0 0 3px rgba(32,119,178,.12);
}
.nc-form-control::placeholder { color: #aaa; }

/* ── Filters Bar ───────────────────────── */
.nc-filters { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.nc-filter-input {
  flex: 1; min-width: 180px; padding: 8px 12px;
  border: 1px solid #ccc; border-radius: var(--nc-radius);
  font-size: 13px; color: #333; outline: none;
  background: #fff; font-family: var(--nc-font);
}
.nc-filter-select {
  padding: 8px 12px; border: 1px solid #ccc; border-radius: var(--nc-radius);
  font-size: 13px; color: #333; outline: none;
  background: #fff; font-family: var(--nc-font); cursor: pointer;
}
.nc-filter-input:focus, .nc-filter-select:focus {
  border-color: var(--nc-blue);
}

/* ── Link style ────────────────────────── */
.nc-link {
  color: var(--nc-blue); cursor: pointer; font-weight: 600;
  text-decoration: none;
}
.nc-link:hover { text-decoration: underline; color: var(--nc-blue-dk); }

/* ── Step Bar ──────────────────────────── */
.nc-step-bar { display: flex; margin: 20px 0 28px; }
.nc-step-item { flex: 1; text-align: center; position: relative; }
.nc-step-item:not(:last-child)::after {
  content: ''; position: absolute; top: 14px;
  left: 60%; width: 80%; height: 1px; background: #e0e0e0;
}
.nc-step-dot {
  width: 28px; height: 28px; border-radius: 50%;
  margin: 0 auto 6px; display: flex; align-items: center;
  justify-content: center; font-size: 12px; font-weight: 600;
}
.nc-step-dot.done    { background: var(--nc-blue); color: #fff; }
.nc-step-dot.active  { background: var(--nc-blue-lt); color: var(--nc-blue); border: 2px solid var(--nc-blue); }
.nc-step-dot.pending { background: var(--nc-gray-lt); color: var(--nc-gray-text); border: 1px solid #ddd; }
.nc-step-label       { font-size: 11px; color: #777; }

/* ── Drop Zone ─────────────────────────── */
.nc-drop-zone {
  border: 2px dashed var(--nc-blue-bd); border-radius: var(--nc-radius-lg);
  padding: 48px 24px; text-align: center; background: #f8fbff;
  cursor: pointer; transition: all .15s;
}
.nc-drop-zone:hover { background: var(--nc-blue-lt); border-color: var(--nc-blue); }

/* ── Progress ──────────────────────────── */
.nc-progress { height: 6px; background: var(--nc-blue-lt); border-radius: 3px; overflow: hidden; }
.nc-progress-fill { height: 100%; background: var(--nc-blue); border-radius: 3px; transition: width .4s; }

/* ── Spinner ───────────────────────────── */
.nc-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--nc-blue-lt);
  border-top-color: var(--nc-blue);
  border-radius: 50%; animation: nc-spin .8s linear infinite; margin: 0 auto;
}
@keyframes nc-spin { to { transform: rotate(360deg); } }

/* ── Profile rows ──────────────────────── */
.nc-profile-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 0; border-bottom: 1px solid #f0f0f0; font-size: 13px;
}
.nc-profile-row:last-child { border-bottom: none; }
.nc-profile-key   { color: #888; }
.nc-profile-val   { color: #1a1a1a; font-weight: 600; }

/* ── Log Box ───────────────────────────── */
.nc-log-box {
  background: #111827; border-radius: 8px; padding: 14px;
  font-family: 'Courier New', monospace; font-size: 11.5px;
  max-height: 200px; overflow-y: auto;
}
.nc-log-line { display: flex; gap: 10px; padding: 2px 0; color: #9CA3AF; }
.nc-log-time { color: #6B7280; flex-shrink: 0; }
.nc-log-ok   { color: #4ADE80; flex-shrink: 0; }
.nc-log-warn { color: #FBBF24; flex-shrink: 0; }
.nc-pulse-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #16A34A;
  display: inline-block; animation: nc-pulse 1.5s infinite; vertical-align: middle; margin-right: 4px;
}
@keyframes nc-pulse { 0%,100%{opacity:1}50%{opacity:.3} }

/* ── Alert boxes ───────────────────────── */
.nc-alert-crit {
  padding: 10px 12px; background: var(--nc-red-lt); border-radius: 8px;
  border-left: 3px solid var(--nc-red); margin-bottom: 10px;
}
.nc-alert-warn {
  padding: 10px 12px; background: var(--nc-amber-lt); border-radius: 8px;
  border-left: 3px solid var(--nc-amber); margin-bottom: 10px;
}
.nc-alert-title { font-size: 11px; font-weight: 700; text-transform: uppercase; }
.nc-alert-body  { font-size: 13px; margin-top: 2px; }
.nc-alert-crit .nc-alert-title { color: #791F1F; }
.nc-alert-crit .nc-alert-body  { color: var(--nc-red); }
.nc-alert-warn .nc-alert-title { color: #633806; }
.nc-alert-warn .nc-alert-body  { color: var(--nc-amber); }

/* ── Footer ────────────────────────────── */
.nc-footer {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 1020;
  background: #fafafa; border-top: 1px solid #e8e8e8;
  padding: 8px 28px; display: flex; align-items: center;
  justify-content: space-between; font-size: 11px; color: #999;
}
.nc-footer-center { color: #888; }
.nc-footer-right  { color: #888; }
.nc-footer-left   { font-style: italic; }

/* ── Offcanvas mobile sidebar ──────────── */
#ncSidebar .nc-sb-item { padding: 10px 12px; font-size: 14px; }

/* ── Page head row ─────────────────────── */
.nc-page-hd-row {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-bottom: 24px;
}
.nc-action-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ── UNE search result ─────────────────── */
.nc-une-result {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 16px; border-bottom: 1px solid #f0f0f0; transition: background .12s;
}
.nc-une-result:hover { background: #f8f9fc; }
.nc-une-result:last-child { border-bottom: none; }
.nc-une-sdot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }

/* ── Score bar ─────────────────────────── */
.nc-score-bar { height: 12px; background: #f0f0f0; border-radius: 6px; overflow: hidden; display: flex; }

/* ── Method pills ──────────────────────── */
.nc-method {
  padding: 2px 8px; border-radius: 4px; font-size: 11px;
  font-weight: 700; min-width: 44px; text-align: center;
}
.nc-method-get  { background: var(--nc-green-lt); color: var(--nc-green); }
.nc-method-post { background: var(--nc-blue-lt);  color: var(--nc-blue); }
.nc-method-del  { background: var(--nc-red-lt);   color: var(--nc-red); }

/* ── Responsive ────────────────────────── */
@media (max-width: 768px) {
  .nc-header { padding: 10px 16px; }
  .nc-main   { padding: 20px 16px 80px; }
  .nc-sidebar { display: none; }
  .nc-page-title { font-size: 19px; }
  .nc-table  { font-size: 12px; }
  .nc-table th, .nc-table td { padding: 8px 10px; }
  .nc-metric-val { font-size: 22px; }
  .nc-page-hd-row { flex-direction: column; }
}
@media (max-width: 576px) {
  .nc-filters { flex-direction: column; }
  .nc-filter-input { min-width: unset; width: 100%; }
  .nc-action-row { width: 100%; }
  .nc-action-row .btn-nc-primary,
  .nc-action-row .btn-nc-secondary { flex: 1; justify-content: center; }
}

/* ── Breadcrumb ────────────────────────── */
.nc-breadcrumb { font-size: 12px; color: #aaa; margin-bottom: 6px; }
.nc-breadcrumb a { color: var(--nc-blue); text-decoration: none; }
.nc-breadcrumb a:hover { text-decoration: underline; }
.nc-breadcrumb span { color: #555; font-weight: 600; }

/* ── Toggle switch ─────────────────────── */
.nc-toggle { position: relative; display: inline-block; width: 40px; height: 22px; }
.nc-toggle input { opacity: 0; width: 0; height: 0; }
.nc-toggle .slider {
  position: absolute; inset: 0; background: #ccc; border-radius: 22px; cursor: pointer; transition: .18s;
}
.nc-toggle .slider:before {
  content: ""; position: absolute; height: 16px; width: 16px;
  left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .18s;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.nc-toggle input:checked + .slider { background: var(--nc-blue); }
.nc-toggle input:checked + .slider:before { transform: translateX(18px); }
.nc-toggle.locked .slider { background: var(--nc-purple); cursor: not-allowed; opacity: .85; }
