* { box-sizing: border-box; }
:root {
  --paper: #FAFAF7;
  --ink: #17181B;
  --ink-soft: #75746D;
  --ink-faint: #A8A69C;
  --rule: #DEDCD1;
  --rule-strong: #C8C6B9;
  --accent: #C43E24;
  --accent-tint: #F7E9E5;
  --green: #3F6B3F;
  --green-tint: #E9F0E4;
  --amber: #9C6B15;
  --amber-tint: #F5EDDC;
  --red: #B23A2C;
  --red-tint: #F7E5E2;
}
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.wrap { max-width: 880px; margin: 0 auto; padding: 24px 16px 64px; }
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px; border-bottom: 1px solid var(--rule); background: var(--paper);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-family: "Space Grotesk", sans-serif; font-size: 14px; font-weight: 600; letter-spacing: 0.02em; }
.brand span { color: var(--ink-faint); font-weight: 500; }
.nav-links { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.nav-links a { font-size: 13px; font-weight: 600; color: var(--ink-soft); text-decoration: none; border-bottom: 2px solid transparent; padding: 4px 0; }
.nav-links a:hover, .nav-links a.active { color: var(--ink); border-bottom-color: var(--accent); }
.nav-user { font-size: 12px; color: var(--ink-soft); display: flex; align-items: center; gap: 10px; }
h1 { font-family: "Space Grotesk", sans-serif; font-size: 21px; font-weight: 600; margin: 0 0 6px; letter-spacing: -0.01em; }
h2 { font-family: "Space Grotesk", sans-serif; font-size: 16px; font-weight: 600; margin: 24px 0 10px; }
.sub { font-size: 14px; color: var(--ink-soft); margin: 0 0 20px; line-height: 1.6; }
.page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; gap: 10px; flex-wrap: wrap; }
button, .btn { font-family: inherit; cursor: pointer; }
.btn-primary, a.btn-primary {
  background: var(--ink); color: var(--paper); border: 1px solid var(--ink);
  padding: 10px 20px; border-radius: 3px; font-size: 13px; font-weight: 600; text-decoration: none; display: inline-block;
}
.btn-primary:hover { background: var(--accent); border-color: var(--accent); }
.btn-secondary, a.btn-secondary {
  background: var(--paper); color: var(--ink); border: 1px solid var(--rule-strong);
  padding: 9px 16px; border-radius: 3px; font-size: 13px; font-weight: 600; text-decoration: none; display: inline-block;
}
.btn-secondary:hover { border-color: var(--ink); }
.btn-small, a.btn-small { background: var(--paper); border: 1px solid var(--rule-strong); padding: 5px 10px; border-radius: 3px; font-size: 12px; font-weight: 600; text-decoration: none; color: var(--ink); }
.btn-small:hover { border-color: var(--ink); }
.btn-danger { color: var(--red); border-color: #E7C6BF; }
.btn-danger:hover { background: var(--red-tint); border-color: var(--red); }
.action-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--rule-strong); }
td { padding: 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
tr:hover td { background: #F2F0E9; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 3px; font-size: 11px; font-weight: 600; }
.badge-yangi, .badge-reja { background: var(--amber-tint); color: var(--amber); }
.badge-jarayonda, .badge-tayyor { background: #E6EEF5; color: #2E5C8A; }
.badge-bajarildi, .badge-nashretildi { background: var(--green-tint); color: var(--green); }
.badge-past { background: #F0EFE9; color: var(--ink-soft); }
.badge-orta { background: var(--amber-tint); color: var(--amber); }
.badge-yuqori { background: var(--red-tint); color: var(--red); }
.badge-admin { background: var(--accent-tint); color: var(--accent); }
.badge-xodim { background: #F0EFE9; color: var(--ink-soft); }
form.inline { display: inline; }
label.field-label { font-size: 11px; font-weight: 600; color: var(--ink-soft); display: block; margin: 16px 0 6px; text-transform: uppercase; letter-spacing: 0.04em; }
select, input[type=text], input[type=password], input[type=date], input[type=number], input[type=month], textarea {
  width: 100%; font-family: inherit; font-size: 14px; padding: 9px 12px;
  border: 1px solid var(--rule-strong); border-radius: 3px; background: var(--paper); color: var(--ink);
}
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; min-height: 90px; }
.form-card { max-width: 560px; }
.error-msg { background: var(--red-tint); color: var(--red); padding: 10px 14px; border-radius: 3px; font-size: 13px; margin-bottom: 16px; }
.empty-state { color: var(--ink-soft); font-size: 14px; padding: 24px 0; text-align: center; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); margin-bottom: 24px; }
.stat-box { background: var(--paper); padding: 16px; }
.stat-label { font-size: 11px; color: var(--ink-soft); margin: 0 0 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.stat-value { font-family: "IBM Plex Mono", monospace; font-size: 24px; font-weight: 600; margin: 0; }
.stat-box a { text-decoration: none; }
.section-block { margin-bottom: 32px; }
.list-item { border-top: 1px solid var(--rule); padding: 12px 0; }
.list-item:last-child { border-bottom: 1px solid var(--rule); }
.list-item-title { font-weight: 600; font-size: 14px; margin: 0 0 4px; }
.list-item-meta { font-size: 12px; color: var(--ink-soft); font-family: "IBM Plex Mono", monospace; }
.login-wrap { max-width: 360px; margin: 80px auto; padding: 0 16px; }
.login-card { border: 1px solid var(--rule); border-radius: 4px; padding: 28px; }
.mono { font-family: "IBM Plex Mono", monospace; }
.tag-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tag-link { font-size: 12px; font-weight: 600; padding: 5px 12px; border: 1px solid var(--rule-strong); border-radius: 3px; text-decoration: none; color: var(--ink-soft); }
.tag-link.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.opt-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 13px 4px; border: none; border-top: 1px solid var(--rule); background: none; font-size: 14px; color: var(--ink); cursor: pointer; }
.opt-row:last-of-type { border-bottom: 1px solid var(--rule); }
.opt-row:hover { background: #F2F0E9; }
.opt-row.selected { background: var(--accent-tint); }
.opt-letter { flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--rule-strong); display: flex; align-items: center; justify-content: center; font-family: "IBM Plex Mono", monospace; font-size: 11px; font-weight: 600; color: var(--ink-soft); }
.opt-row.selected .opt-letter { border-color: var(--accent); background: var(--accent); color: var(--paper); }
.visual-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.visual-opt { background: var(--paper); padding: 12px; text-align: center; border: none; cursor: pointer; }
.visual-opt:hover { background: #fff; }
.visual-opt.selected { background: var(--accent-tint); }
.visual-opt svg { width: 100%; height: auto; display: block; margin-bottom: 8px; border: 1px solid var(--rule); }
.visual-letter { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--rule-strong); font-family: "IBM Plex Mono", monospace; font-size: 11px; font-weight: 600; color: var(--ink-soft); }
.visual-opt.selected .visual-letter { border-color: var(--accent); background: var(--accent); color: var(--paper); }
.progress-track { height: 3px; background: repeating-linear-gradient(to right, var(--rule) 0 3px, transparent 3px 7px); margin-bottom: 26px; position: relative; }
.progress-fill { height: 100%; background: var(--accent); position: absolute; top: 0; left: 0; }
.meta-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.meta-label { font-family: "IBM Plex Mono", monospace; font-size: 12px; color: var(--ink-soft); }
.rating-box { border-radius: 3px; padding: 14px 16px; margin-bottom: 22px; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.rating-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.rating-high { background: var(--green-tint); color: var(--green); }
.rating-high .rating-dot { background: var(--green); }
.rating-mid { background: var(--amber-tint); color: var(--amber); }
.rating-mid .rating-dot { background: var(--amber); }
.rating-low { background: var(--red-tint); color: var(--red); }
.rating-low .rating-dot { background: var(--red); }
.review-item { border-top: 1px solid var(--rule); padding: 16px 0; }
.review-q { font-size: 14px; font-weight: 600; margin: 0 0 8px; }
.review-row { font-size: 13px; margin: 0 0 4px; line-height: 1.6; font-family: "IBM Plex Mono", monospace; }
.review-row.wrong { color: var(--red); }
.review-row.right { color: var(--green); }
.role-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.role-btn { text-align: left; display: flex; align-items: center; gap: 12px; padding: 16px; background: var(--paper); font-size: 14px; font-weight: 500; color: var(--ink); border: none; cursor: pointer; width: 100%; }
.role-btn:hover { background: #fff; }
.table-scroll { overflow-x: auto; }
.month-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.month-nav input[type=month] { width: auto; padding: 6px 10px; font-size: 13px; }
.crit-col { text-align: center; }
th.crit-col { cursor: help; }
.rank-cell { font-weight: 600; }
.rank-top { color: var(--accent); }
.max-hint { font-size: 11px; color: var(--ink-faint); }
.criteria-legend { margin-bottom: 24px; }
.avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; }
.avatar-empty { background: #F0EFE9; color: var(--ink-faint); font-family: "Space Grotesk", sans-serif; font-size: 16px; font-weight: 600; border: 1px solid var(--rule); }
.avatar-lg { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; display: block; }
.photo-preview { display: flex; align-items: center; gap: 16px; margin-bottom: 10px; }
.remove-photo-label { font-size: 12px; color: var(--red); display: flex; align-items: center; gap: 6px; cursor: pointer; }
input[type=file] { font-size: 13px; color: var(--ink-soft); }
.legend-row { font-size: 13px; color: var(--ink-soft); margin: 0 0 6px; line-height: 1.6; }
.legend-num { color: var(--ink); font-weight: 600; }
.badge-cat-bayram { background: var(--accent-tint); color: var(--accent); }
.badge-cat-alloma { background: #E6EEF5; color: #2E5C8A; }
.badge-cat-xalqaro { background: var(--green-tint); color: var(--green); }
.badge-cat-boshqa { background: #F0EFE9; color: var(--ink-soft); }
.row-soon td { background: var(--amber-tint); }
.badge-daily { background: #E6EEF5; color: #2E5C8A; }
.role-icon { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--ink); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-family: "IBM Plex Mono", monospace; font-size: 11px; font-weight: 600; }
