:root {
  --primary: #1e3a5f;
  --primary-dark: #142b47;
  --primary-light: #2c5282;
  --accent: #d4a017;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #f59e0b;
  --info: #0284c7;

  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --border-light: #f1f5f9;

  --text: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.08), 0 1px 2px -1px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.05);
}

* {
  box-sizing: border-box;
}

html, body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  margin: 0;
  padding: 0;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

h1, h2, h3, h4, h5, h6 {
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.navbar-udn {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.875rem 0;
  position: sticky;
  top: 0;
  z-index: 1020;
}

.navbar-udn .navbar-brand {
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
}

.navbar-udn .brand-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.navbar-udn .nav-link {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: all .15s;
}

.navbar-udn .nav-link:hover,
.navbar-udn .nav-link.active {
  color: var(--primary);
  background: var(--border-light);
}

.navbar-udn .nav-link i {
  margin-right: 6px;
  font-size: 16px;
  vertical-align: -2px;
}

.btn-udn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 14px;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-udn-primary:hover {
  background: var(--primary-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn-udn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--border);
  padding: 9px 18px;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 14px;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-udn-outline:hover {
  border-color: var(--primary);
  background: var(--border-light);
  color: var(--primary);
}

.btn-udn-success { background: var(--success); color: #fff; border: none; }
.btn-udn-success:hover { background: #15803d; color: #fff; }

.btn-udn-danger { background: var(--danger); color: #fff; border: none; }
.btn-udn-danger:hover { background: #b91c1c; color: #fff; }

.btn-udn-warning { background: var(--warning); color: #fff; border: none; }
.btn-udn-warning:hover { background: #d97706; color: #fff; }

.card-udn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.card-udn-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
}

.card-udn-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

.form-control-udn,
.form-select-udn {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
}
.form-control-udn:focus,
.form-select-udn:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.1);
}

.form-label-udn {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all .15s;
}
.stat-card:hover { box-shadow: var(--shadow); }

.stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-card .stat-icon.bg-primary-soft { background: #eff6ff; color: var(--primary); }
.stat-card .stat-icon.bg-success-soft { background: #f0fdf4; color: var(--success); }
.stat-card .stat-icon.bg-warning-soft { background: #fffbeb; color: var(--warning); }
.stat-card .stat-icon.bg-info-soft { background: #f0f9ff; color: var(--info); }
.stat-card .stat-icon.bg-purple-soft { background: #faf5ff; color: #7c3aed; }

.stat-card .stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

.stat-card .stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  margin: 2px 0 0;
  line-height: 1.1;
}

.table-udn {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.table-udn thead th {
  background: var(--border-light);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

.table-udn tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
  color: var(--text);
  vertical-align: middle;
}

.table-udn tbody tr:last-child td { border-bottom: none; }
.table-udn tbody tr:hover { background: var(--border-light); }

.badge-udn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.badge-mhs { background: #eff6ff; color: var(--primary); }
.badge-non { background: #fef3c7; color: #92400e; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-info { background: #dbeafe; color: #1e40af; }

.btn-sm-udn {
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  transition: all .15s;
}
.btn-sm-udn:hover { background: var(--border-light); color: var(--text); border-color: var(--primary-light); }
.btn-sm-udn.danger { color: var(--danger); border-color: #fee2e2; }
.btn-sm-udn.danger:hover { background: #fef2f2; }
.btn-sm-udn.success { color: var(--success); border-color: #dcfce7; }
.btn-sm-udn.success:hover { background: #f0fdf4; }
.btn-sm-udn.warning { color: var(--warning); border-color: #fef3c7; }
.btn-sm-udn.warning:hover { background: #fffbeb; }

.alert-udn {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1rem;
}

.alert-udn-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-udn-danger { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-udn-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.alert-udn-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.empty-state i { font-size: 48px; opacity: 0.4; display: block; margin-bottom: 1rem; }

.page-header-udn {
  margin: 1.5rem 0 1.5rem;
}
.page-header-udn h1 {
  font-size: 1.5rem;
  margin: 0 0 4px;
}
.page-header-udn .subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0;
}

.container-udn {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

@media (max-width: 768px) {
  .container-udn { padding: 0 1rem; }
  .navbar-udn .navbar-brand { font-size: 0.9rem; }
  .stat-card .stat-value { font-size: 1.4rem; }
}

@media print {
  .navbar-udn, .no-print, .btn-udn-primary, .btn-udn-outline { display: none !important; }
  body { background: white; }
  .card-udn { box-shadow: none; border: none; padding: 0; }
}
