:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #d97706;
  --bg: #f4f6fb;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --radius: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.container { max-width: 1200px; margin: 0 auto; padding: 24px; }
.container-sm { max-width: 480px; margin: 60px auto; padding: 24px; }

.topbar {
  background: #0f172a;
  color: #fff;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar .brand { font-weight: 700; font-size: 18px; }
.topbar a { color: #cbd5e1; text-decoration: none; margin-left: 18px; font-size: 14px; }
.topbar a:hover { color: #fff; }

.nav-tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.nav-tabs a {
  padding: 10px 16px;
  text-decoration: none;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  font-size: 14px;
  font-weight: 500;
}
.nav-tabs a.active { color: var(--primary); border-bottom-color: var(--primary); }

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

h1 { font-size: 22px; margin: 0 0 6px; }
h2 { font-size: 18px; margin: 0 0 12px; }
p.subtitle { color: var(--text-muted); margin-top: 0; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: #f8fafc; font-weight: 600; color: var(--text-muted); text-transform: uppercase; font-size: 11px; letter-spacing: 0.03em; }
tr:hover td { background: #fafcff; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-ongoing { background: #dbeafe; color: #1e40af; }
.badge-done { background: #dcfce7; color: #166534; }
.badge-general { background: #e0e7ff; color: #3730a3; }
.badge-confidential { background: #fee2e2; color: #991b1b; }
.badge-active { background: #dcfce7; color: #166534; }
.badge-revoked { background: #f1f5f9; color: #64748b; }

.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  background: var(--primary);
  color: #fff;
}
.btn:hover { background: var(--primary-dark); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b91c1c; }
.btn-secondary { background: #64748b; }
.btn-secondary:hover { background: #475569; }
.btn-outline { background: transparent; color: var(--primary); border: 1px solid var(--primary); }

.form-group { margin-bottom: 16px; }
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
input[type=text], input[type=password], input[type=date], select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}
textarea { resize: vertical; min-height: 70px; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 200px; }

.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 14px; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-info { background: #dbeafe; color: #1e40af; }

.filters { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: end; }
.filters .form-group { margin-bottom: 0; min-width: 160px; }

.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }

.link-box {
  display: flex;
  gap: 8px;
  align-items: center;
  background: #f8fafc;
  border: 1px dashed var(--border);
  padding: 10px 12px;
  border-radius: var(--radius);
  font-family: monospace;
  font-size: 13px;
  word-break: break-all;
}

.error-page {
  text-align: center;
  padding: 80px 20px;
  max-width: 480px;
  margin: 0 auto;
}
.error-page .code { font-size: 64px; font-weight: 800; color: var(--danger); margin: 0; }

footer.site-footer { text-align: center; padding: 24px; color: var(--text-muted); font-size: 13px; }
