/* licenser/static/licenser.css */

:root {
  --accent:  #2563eb;
  --accent-h:#1d4ed8;
  --red:     #dc2626;
  --red-h:   #b91c1c;
  --green:   #16a34a;
  --amber:   #d97706;
  --border:  #e2e8f0;
  --surface: #f8fafc;
  --ink:     #0f172a;
  --ink2:    #64748b;
  --ink3:    #94a3b8;
  --radius:  6px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--surface);
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Nav */
.nav {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  height: 52px;
  background: #1e293b;
  border-bottom: 1px solid #334155;
}
.nav-brand { color: #f1f5f9; font-weight: 600; font-size: 15px; margin-right: auto; }
.nav-link  { color: #94a3b8; font-size: 14px; }
.nav-link:hover { color: #f1f5f9; text-decoration: none; }
.nav-link-accent { color: #93c5fd; font-weight: 500; }
.nav-btn   { background: none; border: none; cursor: pointer; font-size: 14px; color: #94a3b8; padding: 0; }
.nav-btn:hover { color: #f1f5f9; }

/* Main */
.main { padding: 28px 32px 60px; max-width: 1100px; margin: 0 auto; }

/* Flash */
.flash {
  background: #fef9c3;
  border: 1px solid #fde047;
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 16px;
  color: #713f12;
}

/* Page header */
.page-hdr {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}
.page-title { font-size: 20px; font-weight: 600; color: var(--ink); }
.back-link  { font-size: 13px; color: var(--ink2); display: block; margin-bottom: 4px; }
.back-link:hover { color: var(--ink); text-decoration: none; }
.count-pill {
  background: #e2e8f0;
  color: var(--ink2);
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
  align-self: center;
}

/* Toolbar */
.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.toolbar-search { flex: 1; min-width: 200px; }

/* Fields */
.field-input, .field-select, .field-textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 10px;
  font-size: 14px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color .15s;
}
.field-input:focus, .field-select:focus, .field-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.field-input-sm  { width: auto; min-width: 80px; }
.field-textarea  { resize: vertical; min-height: 70px; }
.field-label     { display: block; font-weight: 500; font-size: 13px; margin-bottom: 4px; color: var(--ink); }
.field-row       { margin-bottom: 16px; }
.required        { color: var(--red); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s;
  white-space: nowrap;
  text-decoration: none;
}
.btn-primary  { background: var(--accent); color: #fff; }
.btn-primary:hover  { background: var(--accent-h); text-decoration: none; color: #fff; }
.btn-danger   { background: var(--red); color: #fff; }
.btn-danger:hover   { background: var(--red-h); text-decoration: none; color: #fff; }
.btn-warning  { background: var(--amber); color: #fff; border-color: var(--amber); }
.btn-warning:hover  { background: #b45309; text-decoration: none; color: #fff; }
.btn-secondary{ background: #fff; color: var(--ink); border-color: var(--border); }
.btn-secondary:hover{ background: var(--surface); text-decoration: none; }
.btn-ghost    { background: transparent; color: var(--ink2); border-color: var(--border); }
.btn-ghost:hover    { background: #f1f5f9; color: var(--ink); text-decoration: none; }
.btn-sm       { padding: 4px 10px; font-size: 13px; }

/* Table */
.table-wrap  { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.lic-table   { width: 100%; border-collapse: collapse; }
.lic-table th{
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink2);
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.lic-table td{ padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.lic-table tr:last-child td { border-bottom: none; }
.lic-row--revoked td { color: var(--ink3); }
.lic-link    { font-weight: 500; }
.empty-state { text-align: center; color: var(--ink2); padding: 32px; }
.ink2        { color: var(--ink2); }
.sm          { font-size: 13px; }

/* Badges */
.tier-badge, .status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.tier-full      { background: #dbeafe; color: #1e40af; }
.tier-payroll   { background: #ede9fe; color: #5b21b6; }
.tier-invoices  { background: #dcfce7; color: #14532d; }
.tier-cashbook  { background: #fef3c7; color: #78350f; }

.status-active    { background: #dcfce7; color: #14532d; }
.status-permanent { background: #dbeafe; color: #1e40af; }
.status-lapsed    { background: #fef3c7; color: #78350f; }
.status-suspended { background: #ffedd5; color: #7c2d12; }
.status-revoked   { background: #fee2e2; color: #7f1d1d; }
.status-badge-lg  { padding: 4px 14px; font-size: 14px; }

/* Login */
.login-box {
  max-width: 360px;
  margin: 80px auto 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}
.login-title { font-size: 20px; font-weight: 600; margin-bottom: 24px; text-align: center; }

/* Form card */
.form-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 560px;
}
.form-foot { display: flex; gap: 10px; margin-top: 8px; }

/* Radio group */
.radio-group { display: flex; gap: 20px; align-items: center; }
.radio-label { display: flex; align-items: center; gap: 6px; cursor: pointer; }

/* Detail grid */
.detail-grid  { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 680px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-card  {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card-title   { font-size: 15px; font-weight: 600; margin-bottom: 14px; }
.card-actions { margin-top: 16px; display: flex; gap: 8px; }
.card-divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* Definition list */
.dl { display: grid; grid-template-columns: 120px 1fr; gap: 8px 12px; align-items: baseline; }
.dl dt { font-size: 12px; font-weight: 600; color: var(--ink2); text-transform: uppercase; letter-spacing: .04em; }
.dl dd { color: var(--ink); }

/* Sortable column headers */
.sort-hdr {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}
.sort-hdr:hover { color: var(--accent); }
.sort-active    { color: var(--accent); }

/* Mono / raw */
.mono     { font-family: monospace; font-size: 13px; }
.lic-raw  {
  font-family: monospace;
  font-size: 13px;
  white-space: pre;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  overflow-x: auto;
}
