/* =========================================================
   AuditVerse — ISO Auditor Practice Platform
   Design system / shared styles (static HTML prototype)
   Colors follow the product spec:
     dark blue = professionalism, light blue = learning,
     green = conformity, amber = warning, red = nonconformity
   ========================================================= */

:root {
  /* Brand / neutrals */
  --navy-900: #0f2038;
  --navy-800: #16294a;
  --navy-700: #1e3a5f;
  --navy-600: #294a77;
  --blue-500: #2f6fed;
  --blue-400: #4f8bff;
  --sky-100:  #eaf2ff;
  --sky-50:   #f5f9ff;

  /* Status colors */
  --green-600: #1f9d57;
  --green-100: #e4f7ec;
  --amber-500: #f0a020;
  --amber-100: #fdf1db;
  --red-600:   #d64545;
  --red-100:   #fce6e6;

  /* Greys */
  --ink:       #16202e;
  --ink-soft:  #465468;
  --ink-faint: #7c8aa0;
  --line:      #e4e9f0;
  --surface:   #ffffff;
  --canvas:    #f2f5fa;

  --radius:    14px;
  --radius-sm: 9px;
  --shadow:    0 1px 2px rgba(16,32,56,.06), 0 8px 24px rgba(16,32,56,.07);
  --shadow-sm: 0 1px 2px rgba(16,32,56,.08);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--canvas);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border: none; border-radius: 10px;
  font-size: 15px; font-weight: 600; transition: .15s ease;
  background: var(--sky-100); color: var(--navy-700);
}
.btn:hover { filter: brightness(.97); transform: translateY(-1px); }
.btn-primary { background: var(--blue-500); color: #fff; }
.btn-primary:hover { background: var(--blue-400); }
.btn-navy { background: var(--navy-700); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: var(--sky-100); }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-block { width: 100%; justify-content: center; }

/* ---------- Badges / pills ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; background: var(--sky-100); color: var(--navy-600);
}
.pill-green { background: var(--green-100); color: var(--green-600); }
.pill-amber { background: var(--amber-100); color: #a86a0a; }
.pill-red   { background: var(--red-100);   color: var(--red-600); }
.pill-grey  { background: #eef1f6; color: var(--ink-soft); }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-green { background: var(--green-600); }
.dot-amber { background: var(--amber-500); }
.dot-red   { background: var(--red-600); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card-pad { padding: 22px; }

/* ---------- App shell (sidebar layout) ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--navy-800); color: #cdd8ea;
  display: flex; flex-direction: column; padding: 20px 16px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 20px; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: linear-gradient(135deg, var(--blue-400), var(--blue-500));
  display: grid; place-items: center; font-weight: 800; color: #fff; font-size: 18px;
}
.brand b { color: #fff; font-size: 17px; letter-spacing: .2px; }

.nav { display: flex; flex-direction: column; gap: 3px; margin-top: 6px;
  flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 9px; color: #aebbd2;
  font-size: 14.5px; font-weight: 500; transition: .12s;
}
.nav a .ic { width: 20px; text-align: center; font-size: 16px; opacity: .9; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: var(--blue-500); color: #fff; }
.nav-sep { margin: 14px 12px 6px; font-size: 11px; letter-spacing: .8px;
  text-transform: uppercase; color: #6d7d9a; }
.sidebar-foot { margin-top: auto; padding: 12px 8px 0; }

.main { display: flex; flex-direction: column; min-width: 0; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 18px;
  padding: 14px 28px; background: var(--surface);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5;
}
.search {
  flex: 1; max-width: 420px; display: flex; align-items: center; gap: 9px;
  background: var(--canvas); border: 1px solid var(--line);
  padding: 9px 14px; border-radius: 10px; color: var(--ink-faint); font-size: 14px;
}
.search input { border: none; background: none; outline: none; width: 100%; font-size: 14px; color: var(--ink); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.xp {
  display: flex; align-items: center; gap: 7px; font-weight: 700; color: var(--navy-700);
  background: var(--sky-100); padding: 7px 13px; border-radius: 999px; font-size: 13.5px;
}
.icon-btn {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); display: grid; place-items: center; font-size: 17px; position: relative;
}
.icon-btn .badge {
  position: absolute; top: -5px; right: -5px; background: var(--red-600); color: #fff;
  font-size: 10px; font-weight: 700; min-width: 17px; height: 17px; border-radius: 999px;
  display: grid; place-items: center; padding: 0 4px;
}
.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, #f0a020, #d64545);
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 15px;
}
.avatar.sm { width: 32px; height: 32px; font-size: 13px; }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }

/* ---------- Content area ---------- */
.content { padding: 28px; max-width: 1240px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 25px; letter-spacing: -.3px; }
.page-head p { color: var(--ink-soft); font-size: 14.5px; margin-top: 3px; }
.section-title { font-size: 16px; font-weight: 700; margin: 26px 0 14px; }

/* ---------- Grids ---------- */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ---------- Stat tiles ---------- */
.stat { padding: 18px 20px; }
.stat .label { font-size: 13px; color: var(--ink-soft); display: flex; align-items: center; gap: 8px; }
.stat .value { font-size: 28px; font-weight: 800; letter-spacing: -.5px; margin-top: 6px; }
.stat .sub { font-size: 12.5px; color: var(--ink-faint); margin-top: 2px; }
.stat .ic-round { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-size: 15px; }

/* ---------- Progress ---------- */
.bar { height: 9px; border-radius: 999px; background: #e9eef6; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 999px; background: var(--blue-500); }
.bar.green > span { background: var(--green-600); }
.bar.amber > span { background: var(--amber-500); }

/* ---------- Ring (svg) ---------- */
.ring { --p: 0; width: 130px; height: 130px; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--ink-faint); font-weight: 600; font-size: 12.5px;
  text-transform: uppercase; letter-spacing: .4px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
td { padding: 13px 14px; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--sky-50); }

/* ---------- Utilities ---------- */
.row { display: flex; align-items: center; gap: 12px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.small { font-size: 13px; }
.mt-0{margin-top:0}.mt-1{margin-top:8px}.mt-2{margin-top:16px}.mt-3{margin-top:24px}
.mb-1{margin-bottom:8px}.mb-2{margin-bottom:16px}
.gap-lg{gap:24px}
.center { text-align: center; }
.hide { display: none; }

@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center;
    overflow-x: auto; padding: 12px; }
  .sidebar .nav { flex-direction: row; }
  .nav-sep, .sidebar-foot, .brand b { display: none; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .content { padding: 18px; }
}
