/* ═══════════════════════════════════════════════════════════════
   InvnTree Patent Fee Platform — Shared Styles
   ═══════════════════════════════════════════════════════════════ */

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

:root {
  --navy:   #1A2F5E;
  --blue:   #2563A8;
  --gold:   #C9A227;
  --bg:     #f0f4f9;
  --border: #d4dce8;
  --text:   #1a2035;
  --muted:  #6b7a99;
  --white:  #ffffff;
  --red:    #dc2626;
  --green:  #16a34a;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
}

/* ── NAVBAR ─────────────────────────────────────────────────── */
.navbar {
  background: var(--navy);
  height: 60px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: 0 2px 12px rgba(26,47,94,.4);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-brand { display: flex; flex-direction: column; }
.nav-logo  { font-size: 21px; font-weight: 800; color: var(--gold); letter-spacing: -.5px; line-height: 1; }
.nav-tag   { font-size: 10px; color: rgba(255,255,255,.4); letter-spacing: .5px; text-transform: uppercase; margin-top: 3px; }
.nav-sep   { width: 1px; height: 30px; background: rgba(255,255,255,.15); }
.nav-title { font-size: 15px; font-weight: 600; color: rgba(255,255,255,.9); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.nav-user  { font-size: 13px; color: rgba(255,255,255,.6); }
.nav-user strong { color: rgba(255,255,255,.9); font-weight: 600; }

/* ── BUTTONS ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: 7px; font-size: 13px;
  font-weight: 600; cursor: pointer; font-family: inherit;
  transition: all .15s; border: 1.5px solid transparent;
  text-decoration: none; white-space: nowrap;
}
.btn-primary  { background: var(--blue);  color: #fff; border-color: var(--blue);  }
.btn-primary:hover  { background: #1d52a0; }
.btn-gold     { background: var(--gold);  color: var(--navy); border-color: var(--gold); }
.btn-gold:hover     { background: #d4aa2d; }
.btn-ghost    { background: transparent; color: var(--muted); border-color: var(--border); }
.btn-ghost:hover    { border-color: var(--navy); color: var(--navy); background: #f8fafd; }
.btn-danger   { background: #fee2e2; color: var(--red); border-color: #fca5a5; }
.btn-danger:hover   { background: #fecaca; }
.btn-nav-outline { background: transparent; border-color: rgba(255,255,255,.3); color: rgba(255,255,255,.8); padding: 5px 14px; font-size: 12px; }
.btn-nav-outline:hover { border-color: rgba(255,255,255,.7); color: #fff; }
.btn-sm  { padding: 5px 12px; font-size: 12px; }
.btn-lg  { padding: 11px 24px; font-size: 15px; }
.btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn-full { width: 100%; justify-content: center; }

/* ── LAYOUT ─────────────────────────────────────────────────── */
.container { max-width: 1140px; margin: 0 auto; padding: 32px 24px 56px; }
.page-header { margin-bottom: 28px; }
.page-header h1 { font-size: 22px; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.page-header p  { font-size: 14px; color: var(--muted); }

/* ── CARDS ──────────────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
  overflow: hidden;
}
.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-header h2 { font-size: 14px; font-weight: 600; color: var(--navy); }
.card-body { padding: 22px; }

/* ── FORM FIELDS ────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-size: 11px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .6px;
}
.field input, .field select {
  border: 1.5px solid var(--border);
  border-radius: 7px;
  padding: 10px 13px;
  font-size: 14px;
  color: var(--text);
  outline: none;
  background: #fff;
  font-family: inherit;
  width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,168,.1);
}
.field input::placeholder { color: #b0bccc; }

/* ── TOGGLE SWITCH ──────────────────────────────────────────── */
.toggle { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute; inset: 0;
  background: #cbd5e1; border-radius: 24px; cursor: pointer;
  transition: background .2s;
}
.toggle-track::before {
  content: ''; position: absolute;
  width: 18px; height: 18px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.toggle input:checked + .toggle-track { background: var(--blue); }
.toggle input:checked + .toggle-track::before { transform: translateX(18px); }
.toggle input:disabled + .toggle-track { opacity: .5; cursor: not-allowed; }

/* ── BADGES ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 9px; border-radius: 10px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.badge-green  { background: #dcfce7; color: #15803d; }
.badge-red    { background: #fee2e2; color: #b91c1c; }
.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-gold   { background: #fef3c7; color: #92400e; }
.badge-gray   { background: #f1f5f9; color: #64748b; }

/* ── ALERTS ─────────────────────────────────────────────────── */
.alert { padding: 11px 16px; border-radius: 8px; font-size: 13px; }
.alert-error   { background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; }
.alert-success { background: #dcfce7; border: 1px solid #86efac; color: #166534; }
.alert-info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.alert-warn    { background: #fefbec; border: 1px solid #f0d97a; color: #7c6208; }
.hidden { display: none !important; }

/* ── DATA TABLE ─────────────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table thead th {
  background: #edf2f9; padding: 10px 14px;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .5px; color: var(--navy); text-align: left;
  border-bottom: 2px solid var(--border); white-space: nowrap;
}
.data-table tbody td {
  padding: 12px 14px; border-bottom: 1px solid #f0f3f9;
  color: var(--text); vertical-align: middle;
}
.data-table tbody tr:hover td { background: #f7faff; }
.data-table tbody tr:last-child td { border-bottom: none; }

/* ── MODAL ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 20px;
}
.modal {
  background: #fff; border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  width: 100%; max-width: 480px;
}
.modal-head {
  padding: 18px 20px 14px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-head h3 { font-size: 16px; font-weight: 700; color: var(--navy); }
.modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--muted); line-height: 1; padding: 0 2px; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ── SPINNER ────────────────────────────────────────────────── */
.spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,.35);
  border-top-color: #fff; border-radius: 50%;
  animation: spin .7s linear infinite;
}
.spinner-blue { border-color: rgba(37,99,168,.2); border-top-color: var(--blue); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .navbar { padding: 0 16px; }
  .container { padding: 20px 14px 40px; }
  .nav-user { display: none; }
}
