:root {
  --navy: #0A1F44;
  --teal: #14B8A6;
  --teal-dark: #0D9488;
  --bg: #F5F7FA;
  --card: #FFFFFF;
  --text: #0F172A;
  --muted: #64748B;
  --border: #E2E8F0;
  --danger: #DC2626;
  --success: #16A34A;
  --warning: #D97706;
  --radius: 12px;
  --shadow: 0 1px 4px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 8px 24px rgba(16, 24, 40, 0.10);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

input, select, textarea, button {
  font-family: inherit;
  font-size: 14px;
}

input, select, textarea {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  background: white;
  color: var(--text);
  width: 100%;
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}

button {
  cursor: pointer;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.container {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.badge-high {
  background: #FEE2E2;
  color: #991B1B;
}

.badge-medium {
  background: #FEF3C7;
  color: #92400E;
}

.badge-low {
  background: #DBEAFE;
  color: #1E40AF;
}

.badge-success {
  background: #DCFCE7;
  color: #166534;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--navy);
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  font-weight: 700;
  text-decoration: none;
}

.btn-primary:hover {
  opacity: 0.9;
  text-decoration: none;
}

.btn-teal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--teal);
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  font-weight: 700;
  text-decoration: none;
}

.btn-teal:hover {
  background: var(--teal-dark);
  text-decoration: none;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: white;
  color: var(--text);
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-weight: 700;
  text-decoration: none;
}

.btn-outline:hover {
  border-color: var(--teal);
  text-decoration: none;
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--danger);
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  font-weight: 700;
}

.text-muted {
  color: var(--muted);
}

.text-danger {
  color: var(--danger);
}

.text-success {
  color: var(--success);
}

.alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  border: 1px solid var(--border);
}

.alert-success {
  background: #F0FDF4;
  border-color: #BBF7D0;
  color: #166534;
}

.alert-error {
  background: #FEF2F2;
  border-color: #FECACA;
  color: #991B1B;
}

.alert-info {
  background: #EFF6FF;
  border-color: #BFDBFE;
  color: #1E40AF;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th {
  text-align: left;
  background: #F8FAFC;
  padding: 10px 12px;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

tr:last-child td {
  border-bottom: none;
}

.chatbot-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
}

.chatbot-toggle {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: var(--teal);
  color: white;
  border: none;
  font-size: 22px;
  box-shadow: var(--shadow-lg);
}

.chatbot-panel {
  width: min(360px, calc(100vw - 32px));
  max-height: 480px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-bottom: 12px;
}

.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chatbot-input {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--border);
}

.empty-state {
  text-align: center;
  padding: 40px 16px;
  color: var(--muted);
}

.skeleton {
  background: linear-gradient(90deg, #E2E8F0 25%, #F1F5F9 50%, #E2E8F0 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.2s infinite;
  border-radius: 8px;
  min-height: 16px;
}

@keyframes skeleton-pulse {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 1rem;
  }
  .card {
    padding: 16px;
    border-radius: 12px;
  }
  .chatbot-container {
    bottom: 12px;
    right: 12px;
  }
  .chatbot-panel {
    max-height: calc(100vh - 100px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .skeleton {
    animation: none;
  }
}
