/* =========================
   CSS RESET & BASE
========================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  transition: background 0.3s ease, color 0.3s ease;
}

/* =========================
   THEME VARIABLES
========================= */
:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --primary: #2563eb;
  --danger: #dc2626;
}

/* dark mode */
[data-theme="dark"] {
  --bg: #0f172a;
  --card: #1e293b;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --border: #334155;
  --primary: #3b82f6;
  --danger: #ef4444;
}

/* =========================
   UTILITIES
========================= */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
}

.section-title {
  margin: 0 0 1rem;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* =========================
   BUTTONS
========================= */
.btn {
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-secondary {
  background: var(--border);
  color: var(--text);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
}

/* =========================
   HEADER
========================= */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.app-title {
  margin: 0;
}

.app-subtitle {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.header-right {
  display: flex;
  gap: 0.5rem;
}

/* =========================
   GRID TOP
========================= */
.grid-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

/* =========================
   CARDS
========================= */
.stats,
.form-wrap,
.toolbar,
.list-wrap,
.stat-card,
.app-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
}

/* =========================
   STATS
========================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: bold;
}

/* =========================
   FORM
========================= */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.field-full {
  grid-column: span 2;
}

input,
select,
textarea {
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
}

.form-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.5rem;
}

/* =========================
   TOOLBAR
========================= */
.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* =========================
   LIST
========================= */
.list {
  display: grid;
  gap: 1rem;
}

.app-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.app-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.badge {
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
}

.badge-applied {
  background: #e0e7ff;
  color: #1e40af;
}

.badge-interview {
  background: #fef3c7;
  color: #92400e;
}

.badge-accepted {
  background: #dcfce7;
  color: #166534;
}

.badge-rejected {
  background: #fee2e2;
  color: #991b1b;
}

/* =========================
   FOOTER
========================= */
.app-footer {
  text-align: center;
  padding: 1rem;
  color: var(--muted);
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 768px) {
  .grid-top {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .field-full {
    grid-column: span 1;
  }

  .toolbar {
    flex-direction: column;
  }
}
/* =========================
   POLISH + TOAST
========================= */
.app-header {
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}

.stats,
.form-wrap,
.toolbar,
.list-wrap,
.stat-card,
.app-card {
  box-shadow: 0 6px 18px rgba(2, 6, 23, 0.06);
}

.btn {
  transition: transform 0.08s ease, opacity 0.2s ease;
}
.btn:active {
  transform: scale(0.98);
}
.btn:hover {
  opacity: 0.92;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(37, 99, 235, 0.35);
  outline-offset: 2px;
}

.app-card:hover {
  box-shadow: 0 10px 26px rgba(2, 6, 23, 0.1);
}

/* Toast */
.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.75rem 1rem;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(2, 6, 23, 0.18);
  max-width: 320px;
}
.toast.success {
  border-left: 6px solid #16a34a;
}
.toast.info {
  border-left: 6px solid var(--primary);
}
.toast.danger {
  border-left: 6px solid var(--danger);
}

.file-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Fix dropdown (select/option) di dark mode */
select {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
}

select option {
  background: var(--card);
  color: var(--text);
}

select:focus {
  background: var(--card);
  color: var(--text);
}

.app-card.highlight {
  outline: 2px solid rgba(37, 99, 235, 0.5);
  box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.12);
}
