/* ── CareerUp Shared Styles ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=DM+Mono:wght@400&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --ink: #1c1c1e; --sub: #38383a; --muted: #6e6e73;
  --bg: #f2f2f7; --card: #ffffff; --border: #e5e5ea;
  --accent: #e85d26; --green: #1a7f4b; --gold: #b45309;
  --brand: #0a66c2; --error: #c0392b;
  --radius: 10px; --radius-lg: 14px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.09);
}
body { font-family: 'Inter', sans-serif; font-size: 14px; line-height: 1.55; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }

/* TOPBAR */
.topbar {
  height: 52px; background: var(--card); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem; position: sticky; top: 0; z-index: 100;
}
.topbar-brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.topbar-icon { width: 28px; height: 28px; border-radius: 6px; background: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; color: white; }
.topbar-name { font-size: 0.9rem; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }

/* SIDEBAR */
.app-layout { display: flex; min-height: calc(100vh - 52px); }
.sidebar {
  width: 220px; flex-shrink: 0; background: var(--card);
  border-right: 1px solid var(--border); padding: 1rem 0.75rem;
  position: sticky; top: 52px; height: calc(100vh - 52px); overflow-y: auto;
}
.sidebar-label { font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding: 0 0.5rem; margin: 1rem 0 0.3rem; }
.sidebar-label:first-child { margin-top: 0; }
.nav-item {
  display: flex; align-items: center; gap: 0.6rem;
  width: 100%; padding: 0.5rem 0.6rem; border-radius: 7px;
  font-size: 0.83rem; font-weight: 500; color: var(--sub);
  background: none; border: none; cursor: pointer; text-align: left;
  text-decoration: none; transition: all 0.12s; margin-bottom: 1px;
}
.nav-item:hover { background: var(--bg); color: var(--ink); }
.nav-item.active { background: #e8f0fe; color: var(--brand); font-weight: 600; }
.nav-item .ni { font-size: 1rem; width: 18px; text-align: center; flex-shrink: 0; }
.nav-badge { margin-left: auto; font-size: 0.68rem; font-weight: 600; background: rgba(232,93,38,0.1); color: var(--accent); padding: 0.1rem 0.45rem; border-radius: 100px; }
.nav-badge.empty { background: var(--bg); color: var(--muted); }

/* MAIN CONTENT */
.main { flex: 1; padding: 1.75rem 2rem; overflow-y: auto; }
.page-header { margin-bottom: 1.5rem; }
.page-title { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 0.2rem; }
.page-desc { font-size: 0.82rem; color: var(--muted); }

/* CARDS */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 1rem; }
.card-header { padding: 0.85rem 1.25rem; border-bottom: 1px solid var(--border); background: #fafafa; display: flex; align-items: center; gap: 0.6rem; }
.card-title { font-size: 0.875rem; font-weight: 600; }
.card-body { padding: 1.25rem; }
.card-footer { padding: 0.85rem 1.25rem; border-top: 1px solid var(--border); background: #fafafa; display: flex; align-items: center; justify-content: flex-end; gap: 0.75rem; }

/* FORM */
.field { margin-bottom: 1rem; }
.field:last-child { margin-bottom: 0; }
.field-label { display: block; font-size: 0.75rem; font-weight: 600; color: var(--sub); margin-bottom: 0.35rem; letter-spacing: 0.01em; }
.field-input {
  width: 100%; padding: 0.6rem 0.85rem; border-radius: 7px;
  border: 1px solid var(--border); background: var(--card);
  font-family: 'Inter', sans-serif; font-size: 0.83rem; color: var(--ink);
  outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.field-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(10,102,194,0.1); }
textarea.field-input { resize: vertical; min-height: 90px; line-height: 1.6; }
.field-hint { font-size: 0.72rem; color: var(--muted); margin-top: 0.3rem; line-height: 1.45; }
.field-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.55rem 1.1rem; border-radius: 7px; font-family: 'Inter', sans-serif; font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: all 0.15s; border: none; text-decoration: none; }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover:not(:disabled) { background: #c94d1a; box-shadow: 0 2px 10px rgba(232,93,38,0.3); }
.btn-secondary { background: var(--ink); color: white; }
.btn-secondary:hover:not(:disabled) { background: #2c2c2e; }
.btn-ghost { background: none; color: var(--sub); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg); }
.btn-danger { background: #fef2f2; color: var(--error); border: 1px solid #fecaca; }
.btn-danger:hover { background: #fee2e2; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.775rem; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 0.9rem; }
.btn-full { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ALERTS */
.alert { display: none; align-items: center; gap: 0.6rem; padding: 0.7rem 1rem; border-radius: 7px; font-size: 0.8rem; margin-bottom: 1rem; border: 1px solid; }
.alert.show { display: flex; }
.alert-ok  { background: #f0faf5; border-color: #a7f3d0; color: var(--green); }
.alert-err { background: #fef2f2; border-color: #fecaca; color: var(--error); }
.alert-warn { background: #fffbeb; border-color: #fde68a; color: var(--gold); }

/* STATUS PILLS */
.pill { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.72rem; font-weight: 600; padding: 0.2rem 0.6rem; border-radius: 100px; }
.pill-green { background: #f0faf5; color: var(--green); border: 1px solid #a7f3d0; }
.pill-red   { background: #fef2f2; color: var(--error); border: 1px solid #fecaca; }
.pill-gold  { background: #fffbeb; color: var(--gold);  border: 1px solid #fde68a; }
.pill-gray  { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }

/* SPINNER */
.spinner { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.35); border-top-color: white; border-radius: 50%; animation: spin 0.65s linear infinite; }
.spinner-dark { border-color: rgba(28,28,30,0.15); border-top-color: var(--ink); }
@keyframes spin { to { transform: rotate(360deg); } }

/* EMPTY STATE */
.empty-state { text-align: center; padding: 3rem 2rem; color: var(--muted); }
.empty-state-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.empty-state-title { font-size: 0.95rem; font-weight: 600; color: var(--sub); margin-bottom: 0.4rem; }
.empty-state-desc { font-size: 0.82rem; }

/* MODAL */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 200; display: none; align-items: center; justify-content: center; padding: 1rem; }
.modal-backdrop.show { display: flex; }
.modal { background: var(--card); border-radius: var(--radius-lg); width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-md); }
.modal-header { padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 0.95rem; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--muted); line-height: 1; }
.modal-body { padding: 1.25rem; }
.modal-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 0.75rem; }

/* CREDIT CARDS */
.credit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 0.75rem; }
.credit-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.1rem; }
.credit-type { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 0.4rem; }
.credit-num { font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.credit-label { font-size: 0.72rem; color: var(--muted); }
.credit-bar { height: 3px; border-radius: 2px; background: var(--bg); margin-top: 0.75rem; }
.credit-bar-fill { height: 100%; border-radius: 2px; background: var(--accent); transition: width 0.4s; }

/* TABS */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; }
.tab-btn { padding: 0.65rem 1rem; font-size: 0.82rem; font-weight: 500; color: var(--muted); background: none; border: none; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all 0.15s; }
.tab-btn.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.tab-btn:hover { color: var(--ink); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* USER AVATAR */
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 0.9rem; font-weight: 700; color: white; flex-shrink: 0; }

/* RESPONSIVE */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main { padding: 1.25rem; }
  .field-grid-2 { grid-template-columns: 1fr; }
}
