﻿/* Axis FMIS - Main Stylesheet */
:root {
  --sidebar-width: 260px;
  --sidebar-bg: #0f1b2d;
  --sidebar-hover: #1a2f4e;
  --sidebar-active: #2563eb;
  --topbar-height: 56px;
  --accent: #2563eb;
  --accent-light: #eff6ff;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --card-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --font: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }
body { font-family: var(--font); font-size: 14px; background: #f8fafc; color: #1f2937; }

#sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--sidebar-bg);
  color: #e2e8f0;
  transition: width 0.25s ease;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
  z-index: 100;
}

#sidebar::-webkit-scrollbar { width: 4px; }
#sidebar::-webkit-scrollbar-track { background: transparent; }
#sidebar::-webkit-scrollbar-thumb { background: #2d3748; border-radius: 2px; }

.sidebar-brand {
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  transition: background 0.2s;
}
.sidebar-brand:hover { background: rgba(255,255,255,0.05); }
.brand-icon { font-size: 1.5rem; color: #60a5fa; }
.brand-name { font-size: 1.1rem; font-weight: 700; color: #fff; line-height: 1.2; }
.brand-sub { font-size: 0.68rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.05em; }

.sidebar-user { border-bottom: 1px solid rgba(255,255,255,0.08); }
.user-avatar {
  width: 36px; height: 36px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem; color: #fff; flex-shrink: 0;
}
.user-name { font-size: 0.85rem; font-weight: 600; color: #e2e8f0; }
.user-role { font-size: 0.72rem; color: #64748b; }

.sidebar-divider { height: 1px; background: rgba(255,255,255,0.06); }

.nav-section-label {
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: #475569;
  padding: 12px 16px 4px;
  margin-top: 4px;
}

.sidebar-nav .nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; border-radius: 8px;
  color: #94a3b8; font-size: 0.875rem; font-weight: 500;
  transition: all 0.15s; margin-bottom: 2px;
  white-space: nowrap;
}
.sidebar-nav .nav-link:hover { background: var(--sidebar-hover); color: #e2e8f0; }
.sidebar-nav .nav-link.active { background: var(--accent); color: #fff; }
.sidebar-nav .nav-link i { width: 18px; text-align: center; font-size: 0.9rem; }

.sidebar-footer { border-top: 1px solid rgba(255,255,255,0.08); }
.sidebar-footer .btn { border-color: rgba(255,255,255,0.2); color: #94a3b8; }
.sidebar-footer .btn:hover { background: rgba(255,255,255,0.1); color: #e2e8f0; }

#main-content { min-width: 0; background: #f8fafc; }

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  min-height: var(--topbar-height);
  position: sticky;
  top: 0;
  z-index: 50;
}
.sidebar-toggle { background: none; border: 1px solid var(--border); color: #6b7280; padding: 6px 10px; }
.sidebar-toggle:hover { background: var(--accent-light); border-color: var(--accent); color: var(--accent); }

.breadcrumb { font-size: 0.8rem; }
.breadcrumb-item + .breadcrumb-item::before { content: "â€º"; font-size: 1rem; }

.card {
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  background: #fff;
}
.card-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  border-radius: 12px 12px 0 0 !important;
  padding: 14px 20px;
  font-weight: 600;
}

.stat-card {
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: var(--card-shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.stat-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; flex-shrink: 0;
}
.stat-icon.blue { background: #eff6ff; color: #2563eb; }
.stat-icon.green { background: #ecfdf5; color: #10b981; }
.stat-icon.orange { background: #fffbeb; color: #f59e0b; }
.stat-icon.red { background: #fef2f2; color: #ef4444; }
.stat-icon.purple { background: #f5f3ff; color: #7c3aed; }
.stat-value { font-size: 1.6rem; font-weight: 700; color: #1f2937; line-height: 1.2; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }

.table-responsive { border-radius: 0 0 12px 12px; }
.table { margin-bottom: 0; }
.table thead th {
  background: #f8fafc;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  white-space: nowrap;
}
.table tbody td { padding: 12px 16px; vertical-align: middle; border-color: #f1f5f9; }
.table tbody tr:hover { background: #f8fafc; }

.badge { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.02em; padding: 4px 8px; border-radius: 6px; }
.badge-paid { background: #ecfdf5; color: #059669; }
.badge-unpaid { background: #fef2f2; color: #dc2626; }
.badge-draft { background: #f8fafc; color: #6b7280; border: 1px solid var(--border); }
.badge-sent { background: #eff6ff; color: #2563eb; }
.badge-overdue { background: #fff7ed; color: #ea580c; }
.badge-cancelled { background: #f1f5f9; color: #64748b; }
.badge-pending { background: #fefce8; color: #ca8a04; }
.badge-approved { background: #ecfdf5; color: #16a34a; }
.badge-rejected { background: #fef2f2; color: #dc2626; }
.badge-active { background: #ecfdf5; color: #059669; }
.badge-inactive { background: #f1f5f9; color: #64748b; }
.badge-new { background: #eff6ff; color: #2563eb; }
.badge-won { background: #ecfdf5; color: #059669; }
.badge-lost { background: #fef2f2; color: #dc2626; }

.btn { border-radius: 8px; font-size: 0.875rem; font-weight: 500; }
.btn-primary { background: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; }
.btn-sm { font-size: 0.8rem; padding: 4px 10px; }
.btn-icon { width: 32px; height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; }

.form-control, .form-select {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.875rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.form-label { font-size: 0.8rem; font-weight: 600; color: #374151; margin-bottom: 4px; }
.input-group-text { background: #f9fafb; border: 1px solid #d1d5db; border-radius: 8px; font-size: 0.875rem; }

.page-header { margin-bottom: 24px; }
.page-title { font-size: 1.5rem; font-weight: 700; color: #1f2937; margin: 0; }
.page-subtitle { font-size: 0.875rem; color: var(--text-muted); margin-top: 2px; }

.doc-status-bar {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px;
}

.line-items-table th, .line-items-table td { padding: 8px 10px; vertical-align: middle; }
.line-items-table .form-control { padding: 6px 8px; }

#wrapper.sidebar-collapsed #sidebar { width: 0; overflow: hidden; }

.login-card {
  width: 100%; max-width: 440px;
  background: #fff; border-radius: 20px;
  padding: 40px; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-logo { font-size: 2rem; color: #60a5fa; }
.login-title { font-size: 1.8rem; font-weight: 700; color: #1f2937; }
.login-sub { color: #6b7280; font-size: 0.9rem; }

.quick-action {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 20px; border-radius: 12px; border: 1px dashed #d1d5db;
  text-decoration: none; color: var(--text-muted);
  transition: all 0.2s; background: #fff; gap: 8px; text-align: center;
  font-size: 0.8rem; font-weight: 500;
}
.quick-action i { font-size: 1.5rem; }
.quick-action:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

.pdf-preview-wrapper { background: #e5e7eb; padding: 20px; border-radius: 8px; }

@media (max-width: 768px) {
  #sidebar { position: fixed; left: -260px; height: 100vh; transition: left 0.25s; }
  #sidebar.show { left: 0; box-shadow: 4px 0 20px rgba(0,0,0,0.3); }
  #main-content { margin-left: 0 !important; }
  .stat-value { font-size: 1.3rem; }
}

@media print {
  #sidebar, .topbar, .no-print { display: none !important; }
  #main-content { margin: 0; padding: 0; }
  .card { box-shadow: none; border: none; }
}

.text-accent { color: var(--accent); }
.bg-accent { background: var(--accent); }
.rounded-lg { border-radius: 12px; }
.fw-600 { font-weight: 600; }
.gap-2 { gap: 8px; }
.action-buttons { white-space: nowrap; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state i { font-size: 3rem; margin-bottom: 16px; opacity: 0.4; }
.empty-state h5 { font-size: 1rem; font-weight: 600; color: #374151; }
.empty-state p { font-size: 0.875rem; }

/* Select2 override */
.select2-container--bootstrap-5 .select2-selection { border-radius: 8px !important; border-color: #d1d5db !important; }
.select2-container--bootstrap-5 .select2-selection:focus-within { border-color: var(--accent) !important; box-shadow: 0 0 0 3px rgba(37,99,235,0.1) !important; }

/* Timeline for activities */
.timeline { list-style: none; padding: 0; }
.timeline-item { display: flex; gap: 12px; padding-bottom: 20px; }
.timeline-icon { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-light); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 0.8rem; flex-shrink: 0; }
.timeline-content { flex: 1; }
.timeline-date { font-size: 0.75rem; color: var(--text-muted); }

/* HR specific */
.payslip-header { background: var(--sidebar-bg); color: #fff; border-radius: 12px 12px 0 0; padding: 20px 24px; }
.score-circle { width: 60px; height: 60px; border-radius: 50%; border: 4px solid var(--accent); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; font-weight: 700; color: var(--accent); }
