/* ═══════════════════════════════════════════════════════════
   PM System — Custom Styles (поверх SB Admin 2)
   ═══════════════════════════════════════════════════════════ */

/* ─── Переменные ──────────────────────────────────────────── */
:root {
  --pm-primary:    #4e73df;
  --pm-success:    #1cc88a;
  --pm-warning:    #f6c23e;
  --pm-danger:     #e74a3b;
  --pm-info:       #36b9cc;
  --pm-dark:       #0f172a;
  --pm-sidebar-bg: #1e293b;
  --pm-card-shadow: 0 4px 20px rgba(0,0,0,.08);
  --pm-radius:     12px;
  --pm-font:       'Nunito', -apple-system, sans-serif;
}

/* ─── Глобальные переопределения ─────────────────────────── */
body { font-family: var(--pm-font); }

/* ─── Layout fix ─────────────────────────────────────────── */
#wrapper { display: flex; }
#layoutRoot { display: contents; }
#content-wrapper { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
#content { flex: 1; }

/* ─── Sidebar ────────────────────────────────────────────── */
.sidebar { background: var(--pm-sidebar-bg) !important; }
.sidebar .sidebar-brand { background: rgba(78,115,223,.15) !important; }
.sidebar .nav-item .nav-link { color: #94a3b8 !important; padding: 10px 18px; transition: all .2s; }
.sidebar .nav-item .nav-link:hover,
.sidebar .nav-item.active .nav-link { color: #fff !important; background: rgba(78,115,223,.2) !important; border-radius: 8px; }
.sidebar .nav-item .nav-link i { color: var(--pm-primary) !important; }
.sidebar-heading { color: #64748b !important; font-size: 10px; letter-spacing: 1px; font-weight: 700; padding: 8px 18px; }
.sidebar-divider { border-top: 1px solid rgba(255,255,255,.06) !important; }
.sidebar-brand-text { font-size: 18px; font-weight: 800; color: #fff !important; }

/* ─── Topbar ─────────────────────────────────────────────── */
.topbar { background: #fff !important; border-bottom: 1px solid #f1f5f9; height: 64px; }
.topbar .navbar-search input { border-radius: 24px; background: #f8fafc !important; border: 1px solid #e2e8f0 !important; }
.topbar .navbar-search input:focus { box-shadow: 0 0 0 3px rgba(78,115,223,.15); }
.topbar .navbar-search .btn { border-radius: 0 24px 24px 0; }

/* ─── Cards ──────────────────────────────────────────────── */
.card {
  border: none !important;
  border-radius: var(--pm-radius) !important;
  box-shadow: var(--pm-card-shadow) !important;
  transition: transform .2s, box-shadow .2s;
}
.card:hover { box-shadow: 0 8px 32px rgba(0,0,0,.12) !important; }
.card-header { border-radius: var(--pm-radius) var(--pm-radius) 0 0 !important; font-weight: 700; }

/* ─── Stat Cards ─────────────────────────────────────────── */
.stat-card { border-radius: var(--pm-radius) !important; overflow: hidden; }
.stat-card .card-body { padding: 20px 24px; }
.stat-card .stat-number {
  font-size: 2rem; font-weight: 800; line-height: 1;
  background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,.7) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.stat-card .stat-label { font-size: 11px; font-weight: 700; letter-spacing: 1px; opacity: .8; text-transform: uppercase; }
.stat-card .stat-icon { font-size: 2.5rem; opacity: .15; }
.stat-card-primary  { background: linear-gradient(135deg, #4e73df, #224abe); }
.stat-card-success  { background: linear-gradient(135deg, #1cc88a, #13855c); }
.stat-card-warning  { background: linear-gradient(135deg, #f6c23e, #dda20a); }
.stat-card-danger   { background: linear-gradient(135deg, #e74a3b, #be2617); }
.stat-card-info     { background: linear-gradient(135deg, #36b9cc, #258391); }

/* ─── Progress bars ──────────────────────────────────────── */
.progress { height: 8px; border-radius: 20px; background: #f1f5f9; }
.progress-bar { border-radius: 20px; }

/* ─── Badges ─────────────────────────────────────────────── */
.badge { border-radius: 6px; padding: 5px 10px; font-weight: 600; font-size: 11px; }

/* ─── Buttons ────────────────────────────────────────────── */
.btn { border-radius: 8px !important; font-weight: 600; font-size: 13px; }
.btn-primary   { background: var(--pm-primary) !important; border-color: var(--pm-primary) !important; }
.btn-success   { background: var(--pm-success) !important; border-color: var(--pm-success) !important; }
.btn-danger    { background: var(--pm-danger)  !important; border-color: var(--pm-danger)  !important; }

/* ─── Forms ──────────────────────────────────────────────── */
.form-control { border-radius: 8px !important; border: 1.5px solid #e2e8f0; font-size: 13px; }
.form-control:focus { border-color: var(--pm-primary) !important; box-shadow: 0 0 0 3px rgba(78,115,223,.15) !important; }
select.form-control { padding-right: 32px; }

/* ─── Tables ─────────────────────────────────────────────── */
.table thead th { font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: #64748b; border-bottom: 2px solid #f1f5f9; background: #f8fafc; }
.table td { vertical-align: middle; font-size: 13px; color: #374151; border-color: #f1f5f9; }
.table-hover tbody tr:hover { background: #f8fafc; }

/* ─── Employee Cards ─────────────────────────────────────── */
.employee-card .card { cursor: default; }
.employee-card:hover .card { transform: translateY(-4px); box-shadow: 0 12px 36px rgba(0,0,0,.12) !important; }
.emp-avatar {
  width: 72px; height: 72px; border-radius: 50%; object-fit: cover;
  border: 3px solid #f1f5f9; margin: 0 auto 12px;
  background: linear-gradient(135deg, #f0f4ff, #e0e7ff);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700; color: var(--pm-primary);
}
.emp-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

/* ─── Project Cards ──────────────────────────────────────── */
.project-card { cursor: pointer; }
.project-status-dot {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px;
}
.dot-active    { background: var(--pm-success); }
.dot-planning  { background: var(--pm-warning); }
.dot-completed { background: var(--pm-primary); }
.dot-paused    { background: #94a3b8; }

/* ─── Task rows ──────────────────────────────────────────── */
.task-row:hover { background: #f8fafc; cursor: pointer; }
.task-completed td { opacity: .55; text-decoration: line-through; }
.priority-stripe-high   { border-left: 3px solid var(--pm-danger)  !important; }
.priority-stripe-medium { border-left: 3px solid var(--pm-warning) !important; }
.priority-stripe-low    { border-left: 3px solid var(--pm-success) !important; }

/* ─── Page header ────────────────────────────────────────── */
.page-header {
  background: linear-gradient(135deg, var(--pm-primary) 0%, #224abe 100%);
  border-radius: var(--pm-radius); padding: 28px 32px; margin-bottom: 28px;
  color: #fff; box-shadow: 0 8px 24px rgba(78,115,223,.3);
}
.page-header h1 { font-size: 1.6rem; font-weight: 800; margin: 0; }
.page-header p  { margin: 4px 0 0; opacity: .8; font-size: 13px; }

/* ─── Filters bar ────────────────────────────────────────── */
.filters-bar {
  background: #fff; border-radius: var(--pm-radius);
  padding: 16px 20px; margin-bottom: 20px;
  box-shadow: var(--pm-card-shadow);
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
}
.filters-bar .form-control { max-width: 180px; height: 38px; }
.filters-bar .btn { height: 38px; }

/* ─── Modals ─────────────────────────────────────────────── */
.modal-content { border: none !important; border-radius: var(--pm-radius) !important; }
.modal-header { border-bottom: 1px solid #f1f5f9; padding: 20px 24px; }
.modal-footer { border-top: 1px solid #f1f5f9; padding: 16px 24px; }

/* ─── Loading spinner ────────────────────────────────────── */
.pm-spinner {
  display: flex; align-items: center; justify-content: center;
  padding: 48px; color: #94a3b8; flex-direction: column; gap: 12px;
}
.pm-spinner i { font-size: 32px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Empty state ────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 56px 24px; color: #94a3b8;
}
.empty-state i { font-size: 48px; margin-bottom: 16px; display: block; }
.empty-state h6 { font-size: 16px; color: #4a5568; font-weight: 700; }

/* ─── Footer ─────────────────────────────────────────────── */
.pm-footer {
  background: linear-gradient(135deg, var(--pm-dark) 0%, #1e293b 100%);
  color: #94a3b8; padding: 40px 0 20px; margin-top: 48px;
  border-top: 1px solid rgba(255,255,255,.05);
}
.pm-footer a { color: #94a3b8; transition: color .2s; }
.pm-footer a:hover { color: var(--pm-primary); text-decoration: none; }
.pm-footer h6 { color: #fff; font-weight: 700; margin-bottom: 14px; }
.social-btn {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,.06); display: inline-flex;
  align-items: center; justify-content: center; transition: all .2s;
}
.social-btn:hover { background: var(--pm-primary); transform: translateY(-2px); }

/* ─── Login page ─────────────────────────────────────────── */
.login-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 50%, #1a1040 100%);
  display: flex; align-items: center; justify-content: center;
}
.login-card {
  background: #fff; border-radius: 20px; overflow: hidden;
  box-shadow: 0 32px 80px rgba(0,0,0,.3); width: 100%; max-width: 460px;
}
.login-card .login-header {
  background: linear-gradient(135deg, var(--pm-primary), #224abe);
  padding: 36px 40px; text-align: center; color: #fff;
}
.login-card .login-body { padding: 36px 40px; }
.login-card .form-control { height: 48px; font-size: 14px; padding-left: 44px; }
.login-card .input-icon { position: relative; }
.login-card .input-icon i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #94a3b8; z-index: 5; }
.login-card .btn-login { height: 48px; font-size: 15px; font-weight: 700; border-radius: 12px !important; }

/* ─── Chart container ────────────────────────────────────── */
.chart-container { position: relative; min-height: 260px; }

/* ─── Notification dot ───────────────────────────────────── */
.notif-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--pm-danger); position: absolute; top: 6px; right: 6px;
  border: 2px solid #fff;
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .filters-bar { flex-direction: column; }
  .filters-bar .form-control { max-width: 100%; }
  .page-header h1 { font-size: 1.3rem; }
  .stat-card .stat-number { font-size: 1.6rem; }
}
