/* ===== PerformIQ — base styling (PPT-inspired) ===== */
:root {
  --bg: #f3f5fb;
  --text: #1a1f36;
  --muted: #65718a;
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --accent: #0ea5e9;
  --success: #16a34a;
  --warn: #f59e0b;
  --danger: #dc2626;
  --card: #ffffff;
  --border: #e5e7eb;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 12px 0; }

/* ----- Topbar ----- */
.topbar {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.topbar .brand { font-size: 22px; font-weight: 700; letter-spacing: .3px; }
.topbar .brand small { font-weight: 400; opacity: .85; margin-left: 8px; font-size: 12px; }
.topbar .nav a { color: white; margin-left: 18px; font-weight: 500; opacity: .9; }
.topbar .nav a:hover { opacity: 1; text-decoration: none; }
.topbar .role-badge {
  display: inline-block; padding: 3px 10px; border-radius: 12px;
  background: rgba(255,255,255,.18); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px;
}

/* ----- Layout ----- */
.container { max-width: 1180px; margin: 28px auto; padding: 0 24px; }
.page-title { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; }
.page-title h1 { font-size: 22px; }
.page-title .sub { color: var(--muted); font-size: 13px; }

/* ----- Cards ----- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 22px;
  margin-bottom: 18px;
  box-shadow: 0 1px 2px rgba(20,20,40,.04);
}
.card h2 { font-size: 16px; margin-bottom: 14px; }

/* ----- Stat tiles ----- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px 18px;
}
.stat .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.stat .value { font-size: 28px; font-weight: 700; margin-top: 4px; }
.stat.primary { border-top: 3px solid var(--primary); }
.stat.warn    { border-top: 3px solid var(--warn); }
.stat.success { border-top: 3px solid var(--success); }
.stat.accent  { border-top: 3px solid var(--accent); }

/* ----- Tables ----- */
.table {
  width: 100%; border-collapse: collapse; background: var(--card);
}
.table th, .table td {
  padding: 10px 14px; text-align: left;
  border-bottom: 1px solid var(--border); font-size: 13px;
}
.table th {
  background: #f8f9fc; color: var(--muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: .4px; font-size: 11px;
}
.table tr:hover td { background: #fafbff; }
.table input[type=number], .table input[type=text], .table textarea {
  width: 100%;
}

/* ----- Forms ----- */
input, select, textarea {
  font-family: inherit; font-size: 13px;
  padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 6px; background: white; color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.15);
}
textarea { min-height: 60px; resize: vertical; }
label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 4px; }
.form-row { margin-bottom: 12px; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* ----- Buttons ----- */
.btn {
  display: inline-block; padding: 9px 18px; border-radius: 6px;
  border: 1px solid var(--primary); background: var(--primary); color: white;
  cursor: pointer; font-weight: 600; font-size: 13px;
}
.btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); text-decoration: none; }
.btn.secondary { background: white; color: var(--primary); }
.btn.danger    { background: var(--danger); border-color: var(--danger); }
.btn.success   { background: var(--success); border-color: var(--success); }
.btn.small     { padding: 5px 11px; font-size: 12px; }

/* ----- Badges ----- */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 12px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px;
}
.badge.assigned     { background: #fff7ed; color: #c2410c; }
.badge.submitted    { background: #eef2ff; color: #4338ca; }
.badge.hod_reviewed { background: #ecfdf5; color: #047857; }
.badge.returned     { background: #fee2e2; color: #b91c1c; }
.badge.hr_finalized { background: #e0f2fe; color: #0369a1; }

/* ----- Flash messages ----- */
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; }
.flash.success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.flash.error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* ----- Login ----- */
.login-wrap {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #4f46e5 0%, #0ea5e9 100%);
}
.login-card {
  width: 380px; background: white; border-radius: 14px;
  padding: 32px; box-shadow: 0 10px 30px rgba(0,0,0,.18);
}
.login-card h1 {
  text-align: center; font-size: 26px;
  background: linear-gradient(135deg, #4f46e5, #0ea5e9);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.login-card .sub { text-align: center; color: var(--muted); margin-bottom: 22px; font-size: 12px; }
.login-card .btn { width: 100%; margin-top: 12px; padding: 11px; }
.login-card .demo {
  margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--border);
  font-size: 11px; color: var(--muted);
}
.login-card .demo strong { color: var(--text); }

/* ----- Misc ----- */
.muted { color: var(--muted); }
.right { text-align: right; }
.center { text-align: center; }
.spaced > * + * { margin-top: 10px; }
.row-actions a + a { margin-left: 8px; }
hr.soft { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
