/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: #f5f7fa;
  color: #1a1a2e;
  line-height: 1.6;
  padding: 20px;
}

h1, h2, h3 { color: #16213e; }
h1 { font-size: 1.75rem; margin-bottom: 1rem; }
h2 { font-size: 1.35rem; margin-bottom: 0.75rem; }

/* ===== Layout ===== */
.container { max-width: 960px; margin: 0 auto; }
.card {
  background: #fff;
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* ===== Navigation ===== */
.nav {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.nav a {
  text-decoration: none;
  color: #16213e;
  background: #e8ecf1;
  padding: 8px 18px;
  border-radius: 6px;
  font-weight: 500;
  transition: background 0.2s;
}
.nav a:hover, .nav a.active { background: #0f3460; color: #fff; }

/* ===== Forms ===== */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 0.9rem;
  color: #333;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #0f3460;
  box-shadow: 0 0 0 3px rgba(15,52,96,0.1);
}
.form-group textarea { min-height: 150px; resize: vertical; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 180px; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: #0f3460; color: #fff; }
.btn-primary:hover { background: #1a4a7a; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-danger:hover { background: #c0392b; }
.btn-secondary { background: #e8ecf1; color: #333; }
.btn-secondary:hover { background: #d1d5db; }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }

/* ===== Tables ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #e5e7eb; }
th { background: #f9fafb; font-weight: 600; font-size: 0.85rem; text-transform: uppercase; color: #666; }
tr:hover { background: #f9fafb; }

/* ===== Results ===== */
.result-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 0.9rem;
}
.result-success { background: #d4edda; color: #155724; }
.result-error   { background: #f8d7da; color: #721c24; }
.result-icon { font-size: 1.1rem; }

/* ===== Tabs ===== */
.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 2px solid #e5e7eb; }
.tab-btn {
  padding: 10px 20px;
  border: none;
  background: none;
  font-size: 0.95rem;
  font-weight: 600;
  color: #666;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s;
}
.tab-btn.active { color: #0f3460; border-bottom-color: #0f3460; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== Modal ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff;
  border-radius: 12px;
  padding: 28px;
  width: 90%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}
.modal h2 { margin-bottom: 16px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }

/* ===== Utility ===== */
.hidden { display: none !important; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.text-muted { color: #888; font-size: 0.85rem; }
.file-input-wrapper { position: relative; }
.file-input-wrapper input[type="file"] { font-size: 0.85rem; }
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}
.tag-html { background: #d1ecf1; color: #0c5460; }
.tag-text { background: #e2e3e5; color: #383d41; }
