/* ── SIDEBAR ────────────────────────────────────────── */
.erp-sidebar {
  width: var(--sidebar-w);
  background: var(--brand);
  height: 100vh;
  position: fixed;
  top: 0; left: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: width .25s ease;
}

.sidebar-logo {
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-mark {
  width: 34px; height: 34px;
  background: var(--accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: #fff;
  flex-shrink: 0;
  letter-spacing: -.5px;
}
.logo-name { color: #fff; font-size: 14px; font-weight: 600; line-height: 1.2; }
.logo-sub  { color: rgba(255,255,255,.35); font-size: 10px; font-weight: 400; letter-spacing: .04em; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 0; }
.sidebar-nav::-webkit-scrollbar { width: 0; }

.nav-section { padding: 0 10px; margin-bottom: 4px; }
.nav-section-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.25);
  padding: 10px 8px 6px;
}
.nav-link {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.55);
  font-size: 13px;
  font-weight: 400;
  transition: background .15s, color .15s;
  position: relative;
  cursor: pointer;
}
.nav-link:hover  { background: rgba(255,255,255,.06); color: rgba(255,255,255,.85); }
.nav-link.active { background: rgba(37,99,235,.25); color: #fff; }
.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 20px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}
.nav-link i { font-size: 16px; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  font-size: 10px; font-weight: 600;
  padding: 1px 6px;
  border-radius: 20px;
  background: var(--accent);
  color: #fff;
  min-width: 18px; text-align: center;
}
.nav-badge.warn { background: var(--warning); }
.nav-badge.danger { background: var(--danger); }

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid rgba(255,255,255,.07);
}
.sidebar-user {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s;
}
.sidebar-user:hover { background: rgba(255,255,255,.06); }
.user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; color: #fff;
  flex-shrink: 0;
}
.user-name  { font-size: 12.5px; font-weight: 500; color: rgba(255,255,255,.85); }
.user-email { font-size: 10px; color: rgba(255,255,255,.35); }

/* ── MAIN LAYOUT ────────────────────────────────────── */
.erp-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.erp-topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px;
  gap: 12px;
  position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-size: 15px; font-weight: 600; color: var(--text-primary); flex: 1; }
.topbar-breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
  display: flex; align-items: center; gap: 6px;
}
.topbar-breadcrumb span { color: var(--text-secondary); }

.topbar-search {
  display: flex; align-items: center; gap: 7px;
  background: var(--bg);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  width: 220px;
  transition: border-color .2s, width .2s;
}
.topbar-search:focus-within { border-color: var(--accent); width: 260px; }
.topbar-search i { font-size: 14px; color: var(--text-muted); flex-shrink: 0; }
.topbar-search input {
  border: none; background: transparent;
  font-size: 13px; color: var(--text-primary);
  outline: none; width: 100%;
}
.topbar-search input::placeholder { color: var(--text-muted); }

.topbar-btn {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-md);
  background: transparent;
  color: var(--text-secondary);
  transition: background .15s, color .15s;
  position: relative;
}
.topbar-btn:hover { background: var(--bg); color: var(--text-primary); }
.topbar-btn i { font-size: 17px; }
.topbar-notif::after {
  content: '';
  position: absolute; top: 7px; right: 8px;
  width: 6px; height: 6px;
  background: var(--danger);
  border-radius: 50%;
  border: 1.5px solid var(--surface);
}

/* ── CONTENT ─────────────────────────────────────────── */
.erp-content { padding: 24px; flex: 1; }

.page-header { margin-bottom: 22px; }
.page-header h1 { font-size: 20px; font-weight: 600; margin-bottom: 2px; }
.page-header p  { font-size: 13px; color: var(--text-muted); }

/* ── KPI CARDS ──────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: border-color .2s, transform .2s;
}
.kpi-card:hover { border-color: var(--border-md); transform: translateY(-1px); }
.kpi-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.kpi-card.blue::after  { background: var(--accent); }
.kpi-card.green::after { background: var(--success); }
.kpi-card.warn::after  { background: var(--warning); }
.kpi-card.dark::after  { background: var(--brand); }

.kpi-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.kpi-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.kpi-icon.blue   { background: var(--accent-light); color: var(--accent); }
.kpi-icon.green  { background: var(--success-bg);   color: var(--success); }
.kpi-icon.warn   { background: var(--warning-bg);   color: var(--warning); }
.kpi-icon.dark   { background: #F1F3F5; color: var(--brand); }

.kpi-label { font-size: 12px; color: var(--text-muted); font-weight: 400; }
.kpi-value { font-size: 26px; font-weight: 600; color: var(--text-primary); line-height: 1; margin-bottom: 6px; }
.kpi-delta { font-size: 11.5px; display: flex; align-items: center; gap: 4px; }
.kpi-delta.up   { color: var(--success); }
.kpi-delta.down { color: var(--danger); }
.kpi-delta.neutral { color: var(--text-muted); }
.kpi-delta i { font-size: 13px; }

/* ── GRID 2 COLS ────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 320px; gap: 14px; margin-bottom: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; margin-bottom: 22px; }
.grid-2-eq { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 22px; }

/* ── CARD ───────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.card-title { font-size: 13.5px; font-weight: 600; color: var(--text-primary); }
.card-action { font-size: 12px; color: var(--accent); cursor: pointer; font-weight: 500; }
.card-action:hover { text-decoration: underline; }

/* ── TABLE ──────────────────────────────────────────── */
.erp-table { width: 100%; border-collapse: collapse; }
.erp-table th {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted);
  padding: 0 0 10px; text-align: left;
  border-bottom: 1px solid var(--border);
}
.erp-table td {
  padding: 11px 0;
  font-size: 13px; color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.erp-table tr:last-child td { border-bottom: none; }
.erp-table tr:hover td { background: var(--bg); }

/* ── PROGRESS ───────────────────────────────────────── */
.prog-bar {
  height: 4px; background: var(--bg);
  border-radius: 2px; overflow: hidden; margin-top: 5px;
}
.prog-fill { height: 100%; border-radius: 2px; }

/* ── BADGES / STATUS ────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 500;
  padding: 3px 9px; border-radius: 20px;
}
.badge-blue    { background: var(--accent-light); color: var(--accent); }
.badge-green   { background: var(--success-bg);   color: var(--success); }
.badge-warning { background: var(--warning-bg);   color: var(--warning); }
.badge-danger  { background: var(--danger-bg);    color: var(--danger); }
.badge-gray    { background: #F3F4F6; color: #4B5563; }
.badge i { font-size: 10px; }

/* ── AVATAR ─────────────────────────────────────────── */
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; flex-shrink: 0;
}
.av-blue   { background: var(--accent-light); color: var(--accent); }
.av-green  { background: var(--success-bg);   color: var(--success); }
.av-warn   { background: var(--warning-bg);   color: var(--warning); }
.av-dark   { background: var(--brand); color: #fff; }
.av-purple { background: #EDE9FE; color: #5B21B6; }
.av-coral  { background: #FEF3C7; color: #92400E; }

/* ── ACTIVITY ───────────────────────────────────────── */
.activity-item {
  display: flex; gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.activity-item:last-child { border-bottom: none; }
.act-icon {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0; margin-top: 1px;
}
.act-body { flex: 1; min-width: 0; }
.act-text { font-size: 12.5px; color: var(--text-secondary); line-height: 1.45; }
.act-text strong { color: var(--text-primary); font-weight: 500; }
.act-time { font-size: 11px; color: var(--text-muted); flex-shrink: 0; margin-top: 2px; }

/* ── TASK ───────────────────────────────────────────── */
.task-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.task-item:last-child { border-bottom: none; }
.task-check {
  width: 16px; height: 16px; border-radius: 4px;
  border: 1.5px solid var(--border-md);
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.task-check.done { background: var(--success); border-color: var(--success); }
.task-check.done i { font-size: 10px; color: #fff; }
.task-label { flex: 1; font-size: 13px; color: var(--text-primary); }
.task-label.done { text-decoration: line-through; color: var(--text-muted); }
.task-due { font-size: 11px; color: var(--text-muted); }

/* ── PROJECT ROW ────────────────────────────────────── */
.proj-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.proj-row:last-child { border-bottom: none; }
.proj-icon {
  width: 34px; height: 34px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
}
.proj-info { flex: 1; min-width: 0; }
.proj-name   { font-size: 13px; font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj-client { font-size: 11px; color: var(--text-muted); }
.proj-amount { font-size: 13px; font-weight: 600; color: var(--text-primary); text-align: right; flex-shrink: 0; min-width: 80px; font-family: var(--mono); }

/* ── HR TEAM ROW ────────────────────────────────────── */
.team-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.team-row:last-child { border-bottom: none; }
.team-info { flex: 1; min-width: 0; }
.team-name { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.team-role { font-size: 11px; color: var(--text-muted); }

/* ── STAT MINI ──────────────────────────────────────── */
.stat-row {
  display: flex; justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.stat-row:last-child { border-bottom: none; }
.stat-label { color: var(--text-secondary); }
.stat-val   { font-weight: 600; color: var(--text-primary); font-family: var(--mono); }

/* ── BUTTON ─────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  border: none; cursor: pointer;
  transition: background .15s, transform .1s;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost   { background: transparent; color: var(--text-secondary); border: 1px solid var(--border-md); }
.btn-ghost:hover { background: var(--bg); }
.btn i { font-size: 15px; }

/* ── CHART BAR MINI ─────────────────────────────────── */
.mini-bars {
  display: flex; align-items: flex-end; gap: 4px;
  height: 48px;
}
.mini-bar {
  flex: 1; background: var(--accent-light);
  border-radius: 3px 3px 0 0;
  transition: background .2s;
}
.mini-bar:hover { background: var(--accent); }
.mini-bar.active { background: var(--accent); }

/* ── SCROLLBAR ──────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-md); border-radius: 3px; }

/* ── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2   { grid-template-columns: 1fr; }
  .grid-3   { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .erp-sidebar { width: 60px; }
  .erp-sidebar .logo-name,
  .erp-sidebar .logo-sub,
  .erp-sidebar .nav-section-label,
  .erp-sidebar .nav-link span,
  .erp-sidebar .nav-badge,
  .erp-sidebar .user-name,
  .erp-sidebar .user-email { display: none; }
  .erp-main { margin-left: 60px; }
  .nav-link { justify-content: center; padding: 10px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
}

/* ── FORM ELEMENTS ──────────────────────────────────── */
.erp-label {
  font-size: 12px; font-weight: 500;
  color: var(--text-secondary);
  display: block; margin-bottom: 5px;
}
.erp-input {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border-md);
  border-radius: var(--radius-sm);
  font-size: 13px; font-family: var(--font);
  color: var(--text-primary); background: var(--surface);
  outline: none; transition: border-color .15s;
}
.erp-input:focus { border-color: var(--accent); }
.erp-select {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border-md);
  border-radius: var(--radius-sm);
  font-size: 13px; font-family: var(--font);
  color: var(--text-primary); background: var(--surface);
  outline: none; cursor: pointer;
}
.erp-select:focus { border-color: var(--accent); }
textarea.erp-input { resize: vertical; min-height: 70px; }

/* ── MODAL ──────────────────────────────────────────── */
.erp-modal { backdrop-filter: blur(2px); }

/* ── ACTION BUTTONS in table ────────────────────────── */
.btn-icon {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); border: 1px solid var(--border-md);
  background: transparent; cursor: pointer; font-size: 14px;
  color: var(--text-secondary); transition: background .15s, color .15s;
}
.btn-icon:hover { background: var(--bg); color: var(--text-primary); }
.btn-icon.danger:hover { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }
@import url('inline-forms.css');
