/* ═══════════════════════════════════════════════════════════
   CompanyApp — Main Stylesheet
   Font: Inter | Framework: Bootstrap 5
═══════════════════════════════════════════════════════════ */

:root {
  --sidebar-w: 260px;
  --topbar-h: 60px;
  --footer-h: 48px;
  --brand-primary: #2563eb;
  --brand-primary-dark: #1d4ed8;
  --brand-primary-light: #dbeafe;
  --brand-secondary: #0f172a;
  --sidebar-bg: #0f172a;
  --sidebar-hover: #1e293b;
  --sidebar-active: #2563eb;
  --sidebar-text: #94a3b8;
  --sidebar-text-active: #ffffff;
  --topbar-bg: #ffffff;
  --topbar-border: #e2e8f0;
  --footer-bg: #1e293b;
  --footer-text: #94a3b8;
  --content-bg: #f1f5f9;
  --card-bg: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --border-color: #e2e8f0;
  --radius: 10px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow: 0 4px 16px rgba(0,0,0,.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.14);
  --transition: all 0.22s ease;
}

/* ── Reset & Base ─────────────────────────────────────────── */
* { box-sizing: border-box; }
body { font-family: 'Inter', system-ui, sans-serif; font-size: 14px; color: var(--text-primary); background: var(--content-bg); margin: 0; overflow-x: hidden; }

/* ── App Layout Shell ─────────────────────────────────────── */
.app-layout { min-height: 100vh; display: flex; flex-direction: column; }

/* ════════════════════════════════════════════════════════════
   TOP NAVIGATION BAR
════════════════════════════════════════════════════════════ */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--topbar-border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  z-index: 1100;
  box-shadow: var(--shadow-sm);
  gap: 12px;
}

.topbar-left { display: flex; align-items: center; gap: 10px; flex-shrink: 0; min-width: var(--sidebar-w); }
.topbar-center { flex: 1; display: flex; align-items: center; justify-content: center; }
.topbar-right { display: flex; align-items: center; gap: 4px; flex-shrink: 0; margin-left: auto; }

/* Hamburger */
.sidebar-toggle {
  width: 38px; height: 38px;
  border: none; background: none;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 20px;
  transition: var(--transition);
}
.sidebar-toggle:hover { background: var(--brand-primary-light); color: var(--brand-primary); }

/* Brand */
.topbar-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-logo {
  width: 36px; height: 36px;
  background: var(--brand-primary);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 16px;
  flex-shrink: 0;
}
.brand-name { font-size: 15px; font-weight: 700; color: var(--text-primary); white-space: nowrap; }

/* Page title in topbar */
.page-title { font-size: 14px; font-weight: 500; color: var(--text-secondary); }

/* Notification button */
.topbar-icon-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 18px;
  position: relative;
  transition: var(--transition);
}
.topbar-icon-btn:hover { background: var(--brand-primary-light); color: var(--brand-primary); }
.badge-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid white;
}

.topbar-divider { width: 1px; height: 28px; background: var(--border-color); margin: 0 6px; }

/* Profile */
.topbar-profile-btn {
  border: none; background: none;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}
.topbar-profile-btn:hover { background: var(--brand-primary-light); }
.topbar-profile-btn::after { display: none; } /* remove default caret from bootstrap */

.profile-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  flex-shrink: 0;
}
.profile-name { font-size: 13px; font-weight: 600; color: var(--text-primary); line-height: 1.2; }
.profile-role { font-size: 11px; color: var(--text-secondary); line-height: 1.2; }

.profile-dropdown { min-width: 220px; border: 1px solid var(--border-color); box-shadow: var(--shadow); border-radius: 12px; padding: 8px; }
.dropdown-header { padding: 8px 12px; }
.profile-dropdown .dropdown-item { border-radius: 7px; padding: 8px 12px; font-size: 13px; display: flex; align-items: center; }
.profile-dropdown .dropdown-item:hover { background: var(--brand-primary-light); color: var(--brand-primary); }

/* ════════════════════════════════════════════════════════════
   BODY (sidebar + content)
════════════════════════════════════════════════════════════ */
.app-body {
  display: flex;
  margin-top: var(--topbar-h);
  min-height: calc(100vh - var(--topbar-h) - var(--footer-h));
  position: relative;
}

/* ════════════════════════════════════════════════════════════
   LEFT SIDEBAR
════════════════════════════════════════════════════════════ */
.sidebar {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  bottom: var(--footer-h);
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1000;
  transition: transform 0.25s ease, width 0.25s ease;
  flex-shrink: 0;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }

.sidebar-inner {
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  gap: 2px;
}

.sidebar-section { margin-bottom: 8px; }
.sidebar-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #475569;
  padding: 10px 12px 6px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
  border: none;
  background: none;
  width: 100%;
  cursor: pointer;
}
.sidebar-link i { font-size: 16px; flex-shrink: 0; width: 18px; text-align: center; }
.sidebar-link:hover { background: var(--sidebar-hover); color: white; }
.sidebar-link.active {
  background: var(--sidebar-active);
  color: white;
  box-shadow: 0 2px 8px rgba(37,99,235,.4);
}

/* Overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 999;
}

/* Collapsed state */
.sidebar-collapsed .sidebar { transform: translateX(calc(-1 * var(--sidebar-w))); }
.sidebar-collapsed .main-content { margin-left: 0; }

/* ════════════════════════════════════════════════════════════
   MAIN CONTENT
════════════════════════════════════════════════════════════ */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: margin-left 0.25s ease;
}

/* Page header */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 28px 16px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-heading {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;
}
.breadcrumb { font-size: 12px; margin-top: 4px; }
.breadcrumb-item a { color: var(--brand-primary); text-decoration: none; }
.breadcrumb-item.active { color: var(--text-secondary); }

/* Content area */
.content-area { padding: 0 28px 28px; flex: 1; }

/* ════════════════════════════════════════════════════════════
   FOOTER BAR
════════════════════════════════════════════════════════════ */
.app-footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--footer-h);
  background: var(--footer-bg);
  color: var(--footer-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  font-size: 12px;
  z-index: 1050;
  border-top: 1px solid #1e293b;
}
.footer-center { flex: 1; text-align: center; }
.footer-contact { opacity: 0.7; }

/* ════════════════════════════════════════════════════════════
   CARDS & COMPONENTS
════════════════════════════════════════════════════════════ */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-header { background: transparent; border-bottom: 1px solid var(--border-color); padding: 16px 20px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 20px; }

/* Stat cards */
.stat-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.stat-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.stat-icon.primary { background: var(--brand-primary-light); color: var(--brand-primary); }
.stat-icon.success { background: #dcfce7; color: #16a34a; }
.stat-icon.warning { background: #fef9c3; color: #ca8a04; }
.stat-icon.danger { background: #fee2e2; color: #dc2626; }
.stat-info { flex: 1; min-width: 0; }
.stat-value { font-size: 26px; font-weight: 700; color: var(--text-primary); line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.stat-delta { font-size: 11px; margin-top: 6px; }
.delta-up { color: #16a34a; } .delta-down { color: #dc2626; }

/* Tables */
.table-responsive { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border-color); background: white; }
.table { margin: 0; }
.table thead th { background: #f8fafc; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-secondary); border-bottom: 1px solid var(--border-color); padding: 12px 16px; white-space: nowrap; }
.table tbody td { padding: 12px 16px; vertical-align: middle; font-size: 13px; border-bottom: 1px solid #f1f5f9; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #f8fafc; }

/* Status badges */
.badge { font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 999px; }

/* Forms */
.form-label { font-size: 13px; font-weight: 500; color: var(--text-primary); margin-bottom: 5px; }
.form-control, .form-select { font-size: 13px; border-color: var(--border-color); border-radius: 8px; padding: 8px 12px; transition: var(--transition); }
.form-control:focus, .form-select:focus { border-color: var(--brand-primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.input-group-text { background: #f8fafc; border-color: var(--border-color); font-size: 13px; }

/* Buttons */
.btn { font-size: 13px; font-weight: 500; border-radius: 8px; padding: 8px 16px; transition: var(--transition); display: inline-flex; align-items: center; gap: 6px; }
.btn-primary { background: var(--brand-primary); border-color: var(--brand-primary); }
.btn-primary:hover { background: var(--brand-primary-dark); border-color: var(--brand-primary-dark); }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* Filter bar */
.filter-card { background: white; border: 1px solid var(--border-color); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 16px; }

/* Avatar */
.emp-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--brand-primary-light);
  color: var(--brand-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════════
   AUTH PAGES (login/register)
════════════════════════════════════════════════════════════ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.auth-page::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(37,99,235,.3) 0%, transparent 70%);
  top: -100px; right: -100px;
  pointer-events: none;
}
.auth-card {
  background: white;
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.auth-logo {
  width: 56px; height: 56px;
  background: var(--brand-primary);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 24px;
  margin: 0 auto 20px;
}
.auth-title { text-align: center; font-size: 22px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.auth-subtitle { text-align: center; font-size: 13px; color: var(--text-secondary); margin-bottom: 28px; }

/* ════════════════════════════════════════════════════════════
   SALARY SLIP
════════════════════════════════════════════════════════════ */
.salary-slip {
  max-width: 800px;
  margin: 0 auto;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
}
.slip-header {
  background: var(--sidebar-bg);
  color: white;
  padding: 28px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.slip-section { padding: 20px 32px; border-bottom: 1px solid var(--border-color); }
.slip-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 13px; border-bottom: 1px solid #f8fafc; }
.slip-total { background: #f8fafc; font-weight: 700; }
.net-salary { background: var(--brand-primary); color: white; padding: 20px 32px; text-align: center; }
.net-amount { font-size: 32px; font-weight: 800; }

/* ════════════════════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar { transform: translateX(calc(-1 * var(--sidebar-w))); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .main-content { margin-left: 0; }
  .app-footer .footer-center, .app-footer .footer-right { display: none; }
  .content-area { padding: 0 16px 16px; }
  .page-header { padding: 16px 16px 10px; }
  .topbar-left .brand-name { display: none; }
}

@media (min-width: 769px) {
  .topbar-left { min-width: auto; }
}

/* ════════════════════════════════════════════════════════════
   UTILITIES
════════════════════════════════════════════════════════════ */
.text-muted { color: var(--text-secondary) !important; }
.section-title { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-secondary); }
.empty-state i { font-size: 48px; opacity: .3; display: block; margin-bottom: 12px; }
.divider { border: none; border-top: 1px solid var(--border-color); margin: 20px 0; }
