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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f4f5f7;
  color: #172b4d;
  min-height: 100vh;
}

/* ---------------------------------------------------------------------------
   Header
--------------------------------------------------------------------------- */
header {
  background: #0052cc;
  color: #fff;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header h1 { font-size: 1.1rem; font-weight: 600; }

.header-actions { display: flex; align-items: center; gap: 12px; }

/* ---------------------------------------------------------------------------
   Main / cards
--------------------------------------------------------------------------- */
main { max-width: 1100px; margin: 24px auto; padding: 0 16px; display: flex; flex-direction: column; gap: 20px; }

.card {
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
  padding: 20px 24px;
}

.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-header h2 { font-size: 1rem; font-weight: 600; }

h2 { font-size: 1rem; font-weight: 600; margin-bottom: 14px; }

/* ---------------------------------------------------------------------------
   Forms
--------------------------------------------------------------------------- */
form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; }

.form-row { display: flex; flex-direction: column; gap: 4px; }

label { font-size: .8rem; font-weight: 500; color: #6b778c; }

input[type="text"],
input[type="url"],
input[type="password"],
input[type="number"],
input[type="datetime-local"] {
  padding: 7px 10px;
  border: 1px solid #dfe1e6;
  border-radius: 4px;
  font-size: .9rem;
  width: 100%;
  transition: border-color .15s;
}
input:focus { outline: none; border-color: #0052cc; }

form button[type="submit"] { grid-column: 1 / -1; }

/* ---------------------------------------------------------------------------
   Buttons
--------------------------------------------------------------------------- */
button {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  background: #0052cc;
  color: #fff;
  transition: background .15s;
}
button:hover { background: #0747a6; }

button.secondary { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.5); }
button.secondary:hover { background: rgba(255,255,255,.1); }

button.danger-sm {
  background: #de350b;
  padding: 4px 10px;
  font-size: .8rem;
}
button.danger-sm:hover { background: #bf2600; }

button.edit-sm {
  background: #0065ff;
  padding: 4px 10px;
  font-size: .8rem;
}
button.edit-sm:hover { background: #0052cc; }

button.btn-neutral {
  background: #f4f5f7;
  color: #172b4d;
  border: 1px solid #dfe1e6;
}
button.btn-neutral:hover { background: #ebecf0; }

/* ---------------------------------------------------------------------------
   Table
--------------------------------------------------------------------------- */
table { width: 100%; border-collapse: collapse; font-size: .875rem; }

thead th {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 2px solid #dfe1e6;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #6b778c;
  letter-spacing: .04em;
}

tbody tr { border-bottom: 1px solid #f0f0f0; }
tbody tr:hover { background: #f8f9fc; }
tbody td { padding: 10px 12px; vertical-align: top; }

.actions { display: flex; gap: 6px; flex-wrap: wrap; }

code { font-family: monospace; font-size: .85em; background: #f4f5f7; padding: 2px 4px; border-radius: 3px; }

small { font-size: .78em; }

/* ---------------------------------------------------------------------------
   Badges
--------------------------------------------------------------------------- */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: .75rem;
  font-weight: 600;
}
.badge-active  { background: #e3fcef; color: #006644; }
.badge-revoked { background: #ffebe6; color: #bf2600; }
.badge-expired { background: #fff0b3; color: #172b4d; }

/* ---------------------------------------------------------------------------
   Utility
--------------------------------------------------------------------------- */
.muted { color: #6b778c; }

.error {
  color: #bf2600;
  background: #ffebe6;
  border: 1px solid #ffbdad;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: .875rem;
  grid-column: 1 / -1;
}

.hidden { display: none !important; }

/* ---------------------------------------------------------------------------
   Config overlay / modal
--------------------------------------------------------------------------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 30, 66, .54);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal {
  background: #fff;
  border-radius: 8px;
  padding: 32px;
  width: 420px;
  max-width: 95vw;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.24);
}

.modal h2 { font-size: 1.1rem; margin-bottom: 4px; }
.modal label { font-size: .8rem; font-weight: 500; color: #6b778c; }
.modal input { width: 100%; }
.modal button { margin-top: 4px; }
