/* ═══════════════════════════════════════════════════════════
   ResumeForge — Light Theme
═══════════════════════════════════════════════════════════ */

:root {
  --primary:        #6366f1;
  --primary-dark:   #4f46e5;
  --primary-light:  #eef2ff;
  --primary-glow:   rgba(99,102,241,.18);
  --success:        #10b981;
  --success-light:  #d1fae5;
  --success-dark:   #059669;
  --danger:         #ef4444;
  --danger-light:   #fee2e2;
  --warning:        #f59e0b;
  --warning-light:  #fef3c7;
  --info:           #0ea5e9;
  --purple:         #8b5cf6;
  --orange:         #f97316;
  --pink:           #ec4899;
  --teal:           #14b8a6;

  /* Light theme surface colors */
  --sidebar-bg:     #ffffff;
  --sidebar-border: #e2e8f0;
  --sidebar-w:      256px;
  --bg:             #f8fafc;
  --bg-alt:         #f1f5f9;
  --surface:        #ffffff;
  --border:         #e2e8f0;
  --border-dark:    #cbd5e1;
  --text:           #1e293b;
  --text-muted:     #64748b;
  --text-light:     #94a3b8;

  /* Height system */
  --h-xs:     24px;
  --h-sm:     30px;
  --h-md:     36px;
  --h-lg:     42px;
  --h-xl:     48px;
  --h-input:  38px;
  --h-nav:    38px;
  --h-topbar: 56px;

  /* Radius */
  --r-xs: 4px;  --r-sm: 6px;  --r: 8px;
  --r-md: 10px; --r-lg: 12px; --r-xl: 16px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,.04);
  --shadow-sm: 0 1px 4px rgba(0,0,0,.05), 0 1px 2px rgba(0,0,0,.03);
  --shadow:    0 4px 8px rgba(0,0,0,.05), 0 2px 4px rgba(0,0,0,.03);
  --shadow-md: 0 6px 18px rgba(0,0,0,.07), 0 3px 6px rgba(0,0,0,.04);
  --shadow-lg: 0 16px 40px rgba(0,0,0,.09), 0 6px 12px rgba(0,0,0,.05);
  --shadow-primary: 0 4px 14px rgba(99,102,241,.28);

  --ease:    .15s ease;
  --ease-md: .25s ease;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg); color: var(--text);
  font-size: 14px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img { display: block; max-width: 100%; }
p { color: var(--text-muted); }
h1,h2,h3,h4 { font-weight: 700; line-height: 1.25; color: var(--text); letter-spacing: -.015em; }

/* ════════════════════════════════════════════════════════════
   BUTTONS
════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--h-md); padding: 0 16px;
  border-radius: var(--r); font-size: .8125rem; font-weight: 600;
  font-family: inherit; cursor: pointer; border: none;
  white-space: nowrap; text-decoration: none; letter-spacing: -.01em;
  transition: all var(--ease); position: relative;
}
.btn i { font-size: .75rem; flex-shrink: 0; }
.btn:active { transform: translateY(1px); }

.btn-xs { height: var(--h-xs); padding: 0 10px; font-size: .72rem;  border-radius: var(--r-sm); gap: 4px; }
.btn-sm { height: var(--h-sm); padding: 0 12px; font-size: .78rem;  border-radius: var(--r-sm); gap: 5px; }
.btn-lg { height: var(--h-lg); padding: 0 22px; font-size: .9375rem; border-radius: var(--r-md); gap: 8px; }
.btn-xl { height: var(--h-xl); padding: 0 28px; font-size: 1rem;    border-radius: var(--r-lg); gap: 8px; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; box-shadow: var(--shadow-primary);
}
.btn-primary:hover { color: #fff; filter: brightness(1.07); box-shadow: 0 6px 20px var(--primary-glow); }

.btn-ghost {
  background: var(--surface); color: var(--text-muted);
  border: 1.5px solid var(--border); box-shadow: var(--shadow-xs);
}
.btn-ghost:hover { background: var(--bg-alt); color: var(--text); border-color: var(--border-dark); }

.btn-danger  { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-soft-primary { background: var(--primary-light); color: var(--primary-dark); border: none; }
.btn-soft-success { background: var(--success-light); color: var(--success-dark); border: none; }
.btn-soft-danger  { background: var(--danger-light);  color: #b91c1c; border: none; }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary-light); }

.btn-icon {
  width: 32px; height: 32px; padding: 0; border-radius: var(--r-sm);
  border: 1.5px solid var(--border); background: var(--surface); color: var(--text-muted);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: .75rem; flex-shrink: 0; transition: all var(--ease);
}
.btn-icon:hover { background: var(--bg-alt); color: var(--text); border-color: var(--border-dark); }
.btn-icon.danger:hover { background: var(--danger-light); color: var(--danger); border-color: #fca5a5; }
.btn-icon.sm { width: 26px; height: 26px; font-size: .68rem; }

/* ════════════════════════════════════════════════════════════
   FORMS
════════════════════════════════════════════════════════════ */
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label {
  font-size: .78rem; font-weight: 600; color: var(--text-muted);
  display: flex; align-items: center; gap: 5px; line-height: 1;
}
.form-group label .req { color: var(--danger); font-size: .68rem; }
.form-row      { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row.col3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

input[type="text"], input[type="email"], input[type="tel"],
input[type="url"],  input[type="password"], input[type="date"],
input[type="month"], input[type="number"], input[type="search"],
select {
  width: 100%; height: var(--h-input); padding: 0 12px;
  border: 1.5px solid var(--border); border-radius: var(--r-sm);
  font-size: .8125rem; font-family: inherit; color: var(--text);
  background: var(--surface); outline: none; appearance: none;
  transition: border-color var(--ease), box-shadow var(--ease);
}
input:focus, select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow);
}
input::placeholder { color: var(--text-light); }
select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%2394a3b8' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; padding-right: 32px;
}
textarea {
  width: 100%; min-height: 80px; padding: 9px 12px;
  border: 1.5px solid var(--border); border-radius: var(--r-sm);
  font-size: .8125rem; font-family: inherit; color: var(--text);
  background: var(--surface); outline: none; resize: vertical; line-height: 1.55;
  transition: border-color var(--ease), box-shadow var(--ease);
}
textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
textarea::placeholder { color: var(--text-light); }
input[type="range"] { height: 4px; width: 100%; padding: 0; border: none; box-shadow: none; accent-color: var(--primary); cursor: pointer; }
input[type="color"] { width: 38px; height: 38px; padding: 2px; cursor: pointer; border: 1.5px solid var(--border); border-radius: var(--r-sm); background: var(--surface); }
input[readonly] { background: var(--bg); color: var(--text-muted); cursor: default; }
.hint { font-size: .72rem; color: var(--text-light); line-height: 1.4; }

/* ════════════════════════════════════════════════════════════
   APP LAYOUT
════════════════════════════════════════════════════════════ */
.app-body { display: flex; min-height: 100vh; background: var(--bg); }

/* ════════════════════════════════════════════════════════════
   SIDEBAR — Light
════════════════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  position: fixed; inset: 0 auto 0 0; z-index: 200;
  display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden;
  border-right: 1px solid var(--sidebar-border);
  box-shadow: var(--shadow-sm);
}
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* Logo */
.sidebar-logo {
  height: 62px; padding: 0 16px; flex-shrink: 0;
  display: flex; align-items: center;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo a { display: flex; align-items: center; gap: 10px; text-decoration: none; width: 100%; }
.logo-icon {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; color: #fff; box-shadow: var(--shadow-primary);
}
.logo-text { font-size: 1.05rem; font-weight: 800; color: var(--text); letter-spacing: -.02em; line-height: 1; }
.logo-text span { color: var(--primary); }

/* Section label */
.nav-section-label {
  padding: 16px 16px 5px;
  font-size: .62rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--text-light);
}

/* Nav */
.sidebar-nav { padding: 6px 10px; flex: 1; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  height: var(--h-nav); padding: 0 10px;
  border-radius: var(--r-sm); color: var(--text-muted);
  font-size: .8125rem; font-weight: 500;
  cursor: pointer; text-decoration: none; border: none;
  background: transparent; width: 100%; text-align: left;
  transition: all var(--ease); margin-bottom: 2px;
  position: relative;
}
.nav-item::before {
  content: ''; position: absolute; left: 0; top: 20%; height: 60%;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--primary); transform: scaleY(0);
  transition: transform var(--ease);
}
.nav-item:hover          { background: var(--bg); color: var(--text); }
.nav-item:hover::before  { transform: scaleY(1); }
.nav-item.active         { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }
.nav-item.active::before { transform: scaleY(1); }

/* Nav icon badge */
.nav-icon {
  width: 28px; height: 28px; border-radius: 7px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .77rem; transition: all var(--ease);
  background: var(--bg); color: var(--text-light);
}
.nav-item:hover  .nav-icon { background: var(--bg-alt); color: var(--text-muted); }
.nav-item.active .nav-icon { background: var(--primary); color: #fff; box-shadow: var(--shadow-primary); }

.nav-icon.blue   { background: #eff6ff  !important; color: #3b82f6 !important; }
.nav-icon.green  { background: #f0fdf4  !important; color: #16a34a !important; }
.nav-icon.purple { background: #f5f3ff  !important; color: #7c3aed !important; }
.nav-icon.orange { background: #fff7ed  !important; color: #ea580c !important; }
.nav-icon.pink   { background: #fdf2f8  !important; color: #db2777 !important; }

/* Footer */
.sidebar-footer { padding: 10px; border-top: 1px solid var(--border); flex-shrink: 0; }
.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--r-sm);
  background: var(--bg); margin-bottom: 6px; border: 1px solid var(--border);
}
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: .82rem;
}
.user-name  { font-size: .8rem;  font-weight: 600; color: var(--text);      line-height: 1.2; }
.user-email { font-size: .7rem;  color: var(--text-muted); line-height: 1.3; }
.nav-logout { color: var(--danger) !important; }
.nav-logout .nav-icon { background: var(--danger-light) !important; color: var(--danger) !important; }
.nav-logout:hover { background: #fef2f2 !important; }

/* ════════════════════════════════════════════════════════════
   MAIN CONTENT
════════════════════════════════════════════════════════════ */
.main-content { margin-left: var(--sidebar-w); flex: 1; padding: 28px 30px; }

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; gap: 16px; flex-wrap: wrap;
}
.page-title { font-size: 1.35rem; font-weight: 800; letter-spacing: -.025em; }
.page-sub   { font-size: .8125rem; color: var(--text-muted); margin-top: 3px; }

/* ════════════════════════════════════════════════════════════
   STATS ROW
════════════════════════════════════════════════════════════ */
.stats-row { display: grid; grid-template-columns: repeat(6,1fr); gap: 14px; margin-bottom: 24px; }
.stat-card {
  background: var(--surface); border-radius: var(--r-lg);
  border: 1px solid var(--border); padding: 16px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
  transition: box-shadow var(--ease-md), transform var(--ease-md);
}
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-icon { width: 40px; height: 40px; border-radius: 9px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 1rem; }
.stat-info { flex: 1; min-width: 0; }
.stat-num   { font-size: 1.5rem; font-weight: 800; color: var(--text); line-height: 1.1; letter-spacing: -.02em; }
.stat-label { font-size: .68rem; font-weight: 600; color: var(--text-light); text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; }

.stat-blue   .stat-icon { background: #eff6ff; color: #3b82f6; } .stat-blue::before   { background: #3b82f6; }
.stat-green  .stat-icon { background: #f0fdf4; color: #16a34a; } .stat-green::before  { background: #16a34a; }
.stat-purple .stat-icon { background: #f5f3ff; color: #7c3aed; } .stat-purple::before { background: #7c3aed; }
.stat-orange .stat-icon { background: #fff7ed; color: #ea580c; } .stat-orange::before { background: #ea580c; }
.stat-yellow .stat-icon { background: #fefce8; color: #ca8a04; } .stat-yellow::before { background: #ca8a04; }
.stat-teal   .stat-icon { background: #f0fdfa; color: #0d9488; } .stat-teal::before   { background: #0d9488; }

/* ════════════════════════════════════════════════════════════
   FILTER BAR
════════════════════════════════════════════════════════════ */
.filter-bar { margin-bottom: 20px; }
.filter-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search-wrap { position: relative; flex: 1; min-width: 200px; }
.search-wrap i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-light); font-size: .75rem; pointer-events: none; }
.search-wrap input { padding-left: 34px; }
.filter-form select { width: 145px; height: 36px; }
.filter-form input  { height: 36px; }
.search-wrap input  { height: 36px; }

/* ════════════════════════════════════════════════════════════
   BADGES
════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 9px; border-radius: 20px;
  font-size: .69rem; font-weight: 700; letter-spacing: .02em; line-height: 1;
}
.badge i { font-size: .6rem; }
.badge-resume  { background: #eff6ff; color: #3b82f6; border: 1px solid #bfdbfe; }
.badge-cv      { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.badge-biodata { background: #fff7ed; color: #ea580c; border: 1px solid #fed7aa; }
.badge-draft   { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }
.badge-final   { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }

/* ════════════════════════════════════════════════════════════
   DOCUMENT CARDS
════════════════════════════════════════════════════════════ */
.docs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(285px,1fr)); gap: 16px; }

.doc-card {
  background: var(--surface); border-radius: var(--r-lg);
  border: 1px solid var(--border); padding: 18px;
  display: flex; flex-direction: column; gap: 0;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--ease-md), transform var(--ease-md), border-color var(--ease-md);
  position: relative;
}
.doc-card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: linear-gradient(90deg, var(--primary), var(--purple));
  opacity: 0; transition: opacity var(--ease-md); pointer-events: none;
}
.doc-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: #c7d2fe; }
.doc-card:hover::after { opacity: 1; }

.doc-card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.doc-card-icon   { width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: .88rem; }
.doc-icon-resume  { background: #eff6ff; color: #3b82f6; }
.doc-icon-cv      { background: #f0fdf4; color: #16a34a; }
.doc-icon-biodata { background: #fff7ed; color: #ea580c; }
.doc-card-header-right { margin-left: auto; display: flex; align-items: center; }

.doc-title { font-size: .9rem; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 6px; }
.doc-meta  { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; font-size: .72rem; color: var(--text-light); margin-bottom: 14px; }
.doc-meta span { display: flex; align-items: center; gap: 4px; }
.doc-meta i { font-size: .68rem; }
.doc-actions { display: flex; align-items: center; gap: 6px; padding-top: 12px; border-top: 1px solid var(--border); margin-top: auto; flex-wrap: wrap; }
.doc-actions > .btn { flex: 1; min-width: 0; height: 30px; font-size: .76rem; }
.doc-actions > .btn-icon { flex: 0 0 auto; width: 30px; height: 30px; }

/* More menu */
.btn-more-wrap { position: relative; }
.more-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 6px);
  z-index: 9999; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); min-width: 168px; overflow: hidden;
}
.more-menu.open { display: block; animation: menuPop .12s ease; }
@keyframes menuPop { from{opacity:0;transform:translateY(-4px) scale(.97)} to{opacity:1;transform:none} }
.more-menu a,
.more-menu button {
  display: flex; align-items: center; gap: 9px;
  width: 100%; height: 36px; padding: 0 14px;
  font-size: .8rem; color: var(--text); border: none; background: none;
  cursor: pointer; text-decoration: none; transition: background var(--ease);
}
.more-menu a:hover, .more-menu button:hover { background: var(--bg); }
.more-menu .divider { height: 1px; background: var(--border); margin: 4px 0; }
.more-menu .danger { color: var(--danger); }
.more-menu .danger:hover { background: var(--danger-light); }
.more-menu i { width: 16px; text-align: center; font-size: .78rem; color: var(--text-muted); }
.more-menu .danger i { color: var(--danger); }

/* ════════════════════════════════════════════════════════════
   EMPTY STATE
════════════════════════════════════════════════════════════ */
.empty-state {
  text-align: center; padding: 64px 24px;
  background: var(--surface); border-radius: var(--r-xl);
  border: 2px dashed var(--border);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.empty-state-icon { width: 64px; height: 64px; border-radius: var(--r-xl); background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 1.6rem; margin-bottom: 6px; }
.empty-state h3 { font-size: 1rem; }
.empty-state p  { font-size: .8125rem; max-width: 300px; }

/* ════════════════════════════════════════════════════════════
   ALERTS
════════════════════════════════════════════════════════════ */
.alert { display: flex; align-items: flex-start; gap: 9px; padding: 11px 14px; border-radius: var(--r); font-size: .8125rem; margin-bottom: 14px; border: 1px solid; line-height: 1.5; }
.alert i { font-size: .875rem; flex-shrink: 0; margin-top: 1px; }
.alert-error   { background: var(--danger-light);  color: #b91c1c; border-color: #fca5a5; }
.alert-success { background: var(--success-light); color: #065f46; border-color: #6ee7b7; }
.alert-info    { background: #e0f2fe; color: #075985; border-color: #7dd3fc; }
.alert-warn    { background: var(--warning-light); color: #92400e; border-color: #fcd34d; }

/* ════════════════════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════════════════════ */
@media (max-width: 1400px) { .stats-row { grid-template-columns: repeat(3,1fr); } }
@media (max-width: 1024px) { .stats-row { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .main-content { margin-left: 0; padding: 16px; }
  .stats-row { grid-template-columns: repeat(2,1fr); }
  .form-row, .form-row.col3 { grid-template-columns: 1fr; }
  .docs-grid { grid-template-columns: 1fr; }
}
