/* ══════════════════════════════════════════
   REGISTRAR PORTAL — Shared Design System
   Minimalist · Professional · Responsive
   ══════════════════════════════════════════ */

:root {
  --primary:       #0d1f4e;
  --primary-dark:  #091537;
  --primary-light: #1a3a8f;
  --primary-accent:#2563eb;
  --accent-soft:   #eff6ff;
  --bg:            #f4f6fa;
  --surface:       #ffffff;
  --border:        #e2e8f0;
  --text:          #1e293b;
  --text-muted:    #64748b;
  --text-light:    #94a3b8;
  --success:       #22c55e;
  --warning:       #f59e0b;
  --danger:        #ef4444;
  --info:          #3b82f6;
  --radius:        12px;
  --radius-sm:     8px;
  --radius-xs:     6px;
  --shadow-sm:     0 1px 3px rgba(13,31,78,.06);
  --shadow-md:     0 4px 16px rgba(13,31,78,.08);
  --shadow-lg:     0 8px 32px rgba(13,31,78,.12);
  --font:          system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

/* ── Base ── */
* { box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding-top: 60px; /* nav height */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Card ── */
.r-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, border-color .2s;
}
.r-card:hover { box-shadow: var(--shadow-md); }
.r-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.r-card-body { padding: 20px; }

/* ── Page Header ── */
.r-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.r-page-header h1 {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  margin: 0;
}
.r-page-header p.sub {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 2px 0 0;
}
.r-page-header .date-pill {
  font-size: 12px;
  color: var(--text-muted);
  background: #f0f2f7;
  border-radius: 20px;
  padding: 5px 14px;
  font-weight: 500;
}

/* ── Buttons ── */
.r-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: none;
  transition: all .15s;
  white-space: nowrap;
  line-height: 1.4;
}
.r-btn:hover {
  background: var(--accent-soft);
  color: var(--primary-accent);
  border-color: #bfdbfe;
}
.r-btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.r-btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
}
.r-btn-success {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}
.r-btn-success:hover {
  background: #16a34a;
  color: #fff;
}
.r-btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.r-btn-danger:hover {
  background: #dc2626;
  color: #fff;
}
.r-btn-sm { padding: 5px 10px; font-size: 12px; }

/* ── Form Inputs ── */
.r-input {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface);
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.r-input:focus {
  border-color: var(--primary-accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.r-input::placeholder { color: var(--text-light); }
.r-search-wrap { position: relative; }
.r-search-wrap .r-input { padding-left: 36px; }
.r-search-wrap .r-search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 13px;
  pointer-events: none;
}

/* ── Select ── */
.r-select {
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface);
  font-size: 13px;
  color: var(--text);
  outline: none;
  cursor: pointer;
  transition: border-color .15s;
  min-width: 140px;
}
.r-select:focus { border-color: var(--primary-accent); }

/* ── Chips / Badges ── */
.r-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
  line-height: 1.6;
}
.r-chip-green  { background: #dcfce7; color: #15803d; }
.r-chip-blue   { background: #dbeafe; color: #1d4ed8; }
.r-chip-yellow { background: #fef9c3; color: #b45309; }
.r-chip-red    { background: #fee2e2; color: #b91c1c; }
.r-chip-gray   { background: #f1f5f9; color: #475569; }
.r-chip-purple { background: #ede9fe; color: #6d28d9; }
.r-chip-orange { background: #ffedd5; color: #c2410c; }

/* ── Stat Pill ── */
.r-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  text-decoration: none;
}
.r-stat-pill:hover { border-color: #93c5fd; background: var(--accent-soft); }
.r-stat-pill.active { border-color: var(--primary-accent); background: var(--accent-soft); color: var(--primary-accent); }

/* ── Icon Button ── */
.r-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
}
.r-icon-btn:hover { background: var(--accent-soft); color: var(--primary-accent); border-color: #bfdbfe; }
.r-icon-btn.danger:hover { background: #fee2e2; color: var(--danger); border-color: #fca5a5; }

/* ── Tables ── */
.r-table-wrap { overflow-x: auto; }
.r-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.r-table thead th {
  background: #f8fafc;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}
.r-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
.r-table tbody tr:hover td { background: #fafcff; }
.r-table tbody tr:last-child td { border-bottom: none; }

/* ── Modals ── */
.r-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(15,23,42,.45);
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.r-modal.open { display: flex; }
.r-modal-box {
  background: var(--surface);
  border-radius: 14px;
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: rSlideUp .22s ease;
}
.r-modal-box.wide { max-width: 900px; }
@keyframes rSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.r-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}
.r-modal-body { padding: 20px; }
.r-modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ── Pagination ── */
.r-pg {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 16px 0;
  flex-wrap: wrap;
}
.r-pg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: var(--surface);
  color: var(--text-muted);
  text-decoration: none;
  transition: all .15s;
}
.r-pg-btn:hover { background: var(--accent-soft); color: var(--primary-accent); border-color: #93c5fd; }
.r-pg-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.r-pg-btn:disabled { opacity: .4; cursor: default; pointer-events: none; }

/* ── Banner ── */
.r-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid;
  flex-wrap: wrap;
}
.r-banner.red    { background: #fff5f5; border-color: #fca5a5; color: #991b1b; }
.r-banner.orange { background: #fff7ed; border-color: #fdba74; color: #9a3412; }
.r-banner.green  { background: #f0fdf4; border-color: #86efac; color: #166534; }
.r-banner.blue   { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

/* ── Stat Card ── */
.r-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .18s, transform .18s;
}
.r-stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.r-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.r-stat-icon svg { width: 22px; height: 22px; }
.r-stat-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .02em; }
.r-stat-value { font-size: 28px; font-weight: 800; color: var(--primary); line-height: 1.15; margin-top: 2px; }

/* ── Dropdown Menu ── */
.r-drop-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 500;
  padding: 14px;
  animation: rDropIn .15s ease;
}
.r-drop-menu.hidden { display: none; }
@keyframes rDropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.r-drop-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }

/* ── Hero Section ── */
.r-hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, var(--primary-light) 100%);
  padding: 40px 24px 56px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.r-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.r-hero-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  border: 2px solid rgba(255,255,255,.2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.r-hero-icon i { font-size: 24px; color: rgba(255,255,255,.9); }
.r-hero h1 { font-size: clamp(1.3rem, 3.5vw, 1.8rem); font-weight: 700; color: #fff; margin: 0 0 6px; }
.r-hero p { color: rgba(255,255,255,.65); font-size: 14px; margin: 0; }

/* ── Banner Alert ── */
.r-alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  margin-bottom: 16px;
}
.r-alert-success { background: #f0fdf4; border: 1px solid #86efac; color: #166534; }
.r-alert-error   { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.r-alert-info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.r-alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }

/* ── Grid helpers ── */
.r-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.r-grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.r-grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }

/* ── Content Area ── */
.r-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 40px;
}
@media (min-width: 768px) {
  .r-content { padding: 28px 24px 40px; }
}

/* ── Empty State ── */
.r-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}
.r-empty i { font-size: 40px; color: var(--border); margin-bottom: 12px; }
.r-empty h3 { font-size: 16px; font-weight: 600; color: var(--text); margin: 0 0 4px; }
.r-empty p { font-size: 13px; color: var(--text-muted); margin: 0; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── Utility ── */
.r-text-muted { color: var(--text-muted); }
.r-text-primary { color: var(--primary); }
.r-text-success { color: var(--success); }
.r-text-danger { color: var(--danger); }
.r-text-warning { color: var(--warning); }
.r-mb-0 { margin-bottom: 0; }
.r-mb-2 { margin-bottom: 8px; }
.r-mb-4 { margin-bottom: 16px; }
.r-mt-4 { margin-top: 16px; }
.r-mt-6 { margin-top: 24px; }
.r-gap-2 { gap: 8px; }

/* ── Responsive ── */
@media (max-width: 640px) {
  body { padding-top: 56px; }
  .r-card-header { padding: 12px 14px; }
  .r-card-body { padding: 14px; }
  .r-page-header h1 { font-size: 17px; }
  .r-content { padding: 16px 12px 32px; }
  .r-stat-card { padding: 14px 16px; }
  .r-stat-value { font-size: 22px; }
  .r-hero { padding: 28px 16px 44px; }
  .r-hero-icon { width: 48px; height: 48px; }
  .r-hero-icon i { font-size: 18px; }
  .r-table thead th { font-size: 10px; padding: 8px 10px; }
  .r-table tbody td { padding: 8px 10px; font-size: 12px; }
}
