/* ============================================
   SCRAP — Dark Theme (Soft Contrast)
   Layered grays: body → card → input → hover
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #464958;
  color: #e2e4ea;
  min-height: 100vh;
  padding: 24px;
}

::selection {
  background: rgba(99,140,230,0.35);
  color: #fff;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #464958; }
::-webkit-scrollbar-thumb { background: #767a9e; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #8c90be; }

/* === Layout === */
.wrap {
  max-width: 1600px;
  margin: 0 auto;
}

/* === Typography === */
h1 {
  font-size: 28px;
  font-weight: 700;
  color: #f0f1f5;
  letter-spacing: -0.3px;
  margin-bottom: 4px;
}
h2 {
  font-size: 17px;
  font-weight: 600;
  color: #e2e4ea;
  margin-bottom: 14px;
}
h3 {
  font-size: 15px;
  font-weight: 600;
  color: #e2e4ea;
  margin-bottom: 10px;
}
.subtitle {
  font-size: 13px;
  color: #c5c9d6;
  margin-bottom: 22px;
}

/* === Card — Layer 1 (above body) === */
.card {
  background: #5b5e72;
  border: 1px solid #6a6e86;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 18px;
}

.card h2, .card-title {
  font-size: 15px;
  font-weight: 600;
  color: #e2e4ea;
}
.card-subtitle {
  font-size: 12px;
  color: #b8bdd4;
  margin-top: 2px;
}

/* === Buttons === */
.btn {
  background: #3d5a99;
  color: #e8ecf4;
  border: 1px solid #587cc0;
  border-radius: 8px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn:hover {
  background: #4a6bb5;
  box-shadow: 0 2px 10px rgba(74,106,173,0.25);
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}
.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 6px;
}
.btn-secondary {
  background: #666982;
  border-color: #767a9e;
  color: #9ca0b4;
}
.btn-secondary:hover {
  background: #707492;
  color: #e2e4ea;
}
.btn-success {
  background: #28a745;
  border-color: #2fc75a;
  color: #ffffff;
}
.btn-success:hover {
  background: #2fc75a;
  box-shadow: 0 2px 12px rgba(40,167,69,0.35);
}
.btn-danger {
  background: #c53030;
  border-color: #e04040;
  color: #ffffff;
}
.btn-danger:hover {
  background: #e04040;
  box-shadow: 0 2px 12px rgba(197,48,48,0.35);
}
.btn-outline {
  background: transparent;
  border: 1px solid #767a9e;
  color: #9ca0b4;
}
.btn-outline:hover {
  background: #666982;
  color: #e2e4ea;
}
.btn-primary {
  background: #3d5a99;
  border-color: #587cc0;
  color: #e8ecf4;
}

/* === Forms & Inputs — Layer 2 (sunken into card) === */
input[type="text"],
input[type="number"],
input[type="date"],
input[type="search"],
input[type="password"],
input[type="url"],
textarea,
select {
  font-family: inherit;
  font-size: 13px;
  color: #d1d5db;
  background: #505262;
  border: 1px solid #6a6e86;
  border-radius: 7px;
  padding: 7px 11px;
  outline: none;
  transition: border-color 0.2s ease;
}
input:focus, textarea:focus, select:focus {
  border-color: #5b82cc;
  box-shadow: 0 0 0 2px rgba(91,130,204,0.15);
}
input::placeholder, textarea::placeholder {
  color: #a0a5c0;
}
select {
  cursor: pointer;
}
select option {
  background: #5b5e72;
  color: #d1d5db;
}
textarea {
  resize: vertical;
}
label {
  font-size: 13px;
  color: #d1d5db;
  font-weight: 500;
}
input[type="checkbox"] {
  accent-color: #5b82cc;
  cursor: pointer;
}

/* === Tables === */
table {
  width: 100%;
  border-collapse: collapse;
}
thead th {
  font-size: 11px;
  color: #e2e4ea;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  text-align: left;
  padding: 9px 12px;
  border-bottom: 2px solid #767a9e;
  position: sticky;
  top: 0;
  background: #4a4d62;
  z-index: 2;
}
tbody td {
  font-size: 13px;
  color: #e8eaf0;
  padding: 8px 12px;
  border-bottom: 1px solid #62657a;
}
tbody tr {
  transition: background 0.12s;
}
tbody tr:hover {
  background: #626780;
}

/* === Toolbar === */
.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 18px;
}
.toolbar input,
.toolbar select {
  background: #505262;
  border: 1px solid #6a6e86;
  color: #d1d5db;
  padding: 6px 11px;
  border-radius: 7px;
  font-size: 13px;
}
.toolbar .stats {
  margin-left: auto;
  font-size: 13px;
  color: #b8bdd4;
}

/* === Controls row === */
.controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 14px;
}
.controls span {
  font-size: 13px;
  color: #b8bdd4;
}

/* === Badges & Pills === */
.badge, .pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
}
.badge-green, .pill-green {
  background: #1a4030;
  color: #6ee7a0;
  border: 1px solid #2a6848;
}
.badge-red, .pill-red {
  background: #5a2a2a;
  color: #ff7b72;
  border: 1px solid #7a3838;
}
.badge-yellow, .pill-yellow {
  background: #4a3818;
  color: #ffd060;
  border: 1px solid #6b5828;
}
.badge-blue, .pill-blue {
  background: #1e3050;
  color: #80b4ff;
  border: 1px solid #305880;
}
.badge-purple, .pill-purple {
  background: #301a4e;
  color: #c4a0ff;
  border: 1px solid #503878;
}
.badge-gray {
  background: #4a4d62;
  color: #b8bdd4;
  border: 1px solid #5c6078;
}

/* === Modal === */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal {
  background: #6b6e85;
  border: 1px solid #8a8eaa;
  border-radius: 14px;
  padding: 26px;
  min-width: 380px;
  max-width: 580px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0,0,0,0.4);
}
.modal h2, .modal h3 {
  color: #e2e4ea;
  margin-bottom: 14px;
}

/* === Status indicators === */
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.status-dot.green { background: #4cd68a; box-shadow: 0 0 4px rgba(76,214,138,0.4); }
.status-dot.red { background: #f07167; box-shadow: 0 0 4px rgba(240,113,103,0.4); }
.status-dot.yellow { background: #f0c060; box-shadow: 0 0 4px rgba(240,192,96,0.4); }
.status-dot.blue { background: #7ba3f7; box-shadow: 0 0 4px rgba(123,163,247,0.4); }

/* === Progress bars === */
.progress-bar {
  width: 100%;
  height: 5px;
  background: #62657a;
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}
.progress-fill.blue { background: linear-gradient(90deg, #4a7ad4, #7ba3f7); }
.progress-fill.green { background: linear-gradient(90deg, #2a9d5e, #6ee7a0); }
.progress-fill.red { background: linear-gradient(90deg, #c0453a, #f07167); }
.progress-fill.purple { background: linear-gradient(90deg, #7c52c4, #b794f4); }

/* === Tabs / Pill selector === */
.tab-bar {
  display: flex;
  gap: 3px;
  background: #575a70;
  border: 1px solid #6a6e86;
  padding: 3px;
  border-radius: 9px;
  width: fit-content;
}
.tab-btn {
  padding: 5px 14px;
  border-radius: 7px;
  font-size: 13px;
  color: #adb2ca;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  background: none;
  font-family: inherit;
  font-weight: 500;
}
.tab-btn:hover {
  color: #a5aac0;
  background: #62657a;
}
.tab-btn.active {
  background: #3d5a99;
  color: #e8ecf4;
}

/* === Alerts === */
.alert {
  padding: 11px 15px;
  border-radius: 9px;
  font-size: 13px;
  margin-bottom: 14px;
}
.alert-info {
  background: #1e3050;
  border: 1px solid #305880;
  color: #80b4ff;
}
.alert-warning {
  background: #4a3818;
  border: 1px solid #6b5828;
  color: #ffd060;
}
.alert-danger {
  background: #5a2a2a;
  border: 1px solid #7a3838;
  color: #ff7b72;
}
.alert-success {
  background: #1a4030;
  border: 1px solid #2a6848;
  color: #6ee7a0;
}

/* === Toggles / Switches === */
.toggle-switch {
  position: relative;
  width: 36px; height: 20px;
  background: #6a6e86;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.25s;
}
.toggle-switch.active {
  background: #3d5a99;
}
.toggle-switch::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #e2e4ea;
  top: 2px; left: 2px;
  transition: transform 0.25s;
}
.toggle-switch.active::after {
  transform: translateX(16px);
}

/* === Utility === */
.text-muted { color: #b8bdd4; }
.text-green { color: #5efa96; }
.text-red { color: #ff7b72; }
.text-yellow { color: #ffd060; }
.text-blue { color: #80b4ff; }
.mono { font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: 12px; }

.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }

/* === Section label === */
.section-label {
  font-size: 13px;
  color: #b8bdd4;
  margin-bottom: 8px;
  font-weight: 600;
  display: block;
}
.section-hint {
  font-size: 12px;
  color: #b8bdd4;
  margin-top: 3px;
}

/* === Loading === */
.loading {
  text-align: center;
  padding: 60px 20px;
  color: #adb2ca;
  font-size: 14px;
}

/* === Animation keyframes === */
@keyframes flash-green {
  0% { background: rgba(42,157,94,0.25); }
  100% { background: transparent; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
