/* ==========================================================================
   Business Solution Client - HR Sync Dashboard Theme
   Latest Bootstrap 5 & Custom CSS System
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --sidebar-bg: #0b1329;
  --sidebar-hover: rgba(255, 255, 255, 0.06);
  --sidebar-active: rgba(255, 255, 255, 0.1);
  --sidebar-text: #94a3b8;
  --sidebar-text-active: #ffffff;
  
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --bg-canvas: #f8fafc;
  --card-bg: #ffffff;
  --border-color: #e2e8f0;
  
  --text-dark: #0f172a;
  --text-muted: #64748b;
}

html, body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-canvas);
  color: var(--text-dark);
  min-height: 100vh;
  margin: 0;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

/* Overall Layout */
.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

/* Sidebar Styling matching Sample Design */
.app-sidebar {
  width: 250px;
  background-color: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: all 0.3s ease;
}

.sidebar-brand {
  padding: 1.25rem 1.25rem 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.brand-text-hrs {
  color: #3b82f6;
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
}

.brand-text-sync {
  color: #ffffff;
  font-weight: 700;
  font-size: 1.4rem;
}

.sidebar-nav {
  padding: 0.75rem 0.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  color: var(--sidebar-text);
  font-weight: 500;
  text-decoration: none;
  font-size: 0.84rem;
  line-height: 1.4;
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
}

.sidebar-link > div {
  gap: 0.75rem !important;
}

.sidebar-link i {
  font-size: 1.025rem;
  color: #64748b;
  width: 1.25rem;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.sidebar-link:hover {
  color: #ffffff;
  background-color: var(--sidebar-hover);
}

.sidebar-link:hover i {
  color: #94a3b8;
}

.sidebar-link.active {
  color: #ffffff;
  background-color: var(--sidebar-active);
  font-weight: 600;
  border-left-color: #3b82f6;
}

.sidebar-link.active i {
  color: #3b82f6;
}

/* Main Content Area */
.app-main {
  flex: 1;
  margin-left: 250px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 100vw;
  overflow-x: hidden;
}

/* Top Navigation Bar */
.top-navbar {
  height: 68px;
  background-color: var(--navbar-bg, #ffffff);
  border-bottom: 1px solid var(--navbar-border, var(--border-color));
  color: var(--navbar-text, var(--text-dark));
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.search-input-group {
  position: relative;
  width: 280px;
}

.search-input-group i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 0.95rem;
}

.search-input-control {
  width: 100%;
  padding: 0.55rem 1rem 0.55rem 2.5rem;
  background-color: #f1f5f9;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 0.88rem;
  color: var(--text-dark);
  outline: none;
  transition: all 0.2s ease;
}

.search-input-control:focus {
  background-color: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.user-nav-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-icon-btn,
.sidebar-toggle-btn {
  background: transparent;
  border: none;
  color: var(--navbar-icon-color, #64748b);
  font-size: 1.25rem;
  cursor: pointer;
  position: relative;
  padding: 0.35rem;
  border-radius: 50%;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-icon-btn:hover,
.sidebar-toggle-btn:hover {
  background-color: var(--navbar-hover-bg, #f1f5f9);
  color: var(--navbar-text, var(--text-dark));
}

.avatar-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

/* Page Body Container */
.page-content {
  padding: 2.25rem 2rem;
  flex: 1;
}

/* Page Header */
.page-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.75rem;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: -0.02em;
  margin-bottom: 0.2rem;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.btn-add-emp {
  background-color: var(--primary-color);
  color: #ffffff;
  border: none;
  padding: 0.65rem 1.25rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
  transition: all 0.2s ease;
}

.btn-add-emp:hover {
  background-color: var(--primary-hover);
  color: #ffffff;
  transform: translateY(-1px);
}

/* Metric Cards Grid matching sample image */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.metric-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
}

.metric-icon-box {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.metric-icon-blue {
  background-color: #eff6ff;
  color: #2563eb;
}

.metric-icon-green {
  background-color: #f0fdf4;
  color: #16a34a;
}

.metric-icon-amber { background-color: #fffbeb; color: #d97706; }
.metric-icon-purple { background-color: #f5f3ff; color: #7c3aed; }
.metric-icon-cyan { background-color: #ecfeff; color: #0891b2; }
.metric-icon-indigo { background-color: #e0e7ff; color: #4f46e5; }
a.metric-card { text-decoration: none; color: inherit; cursor: pointer; }
a.metric-card:hover { text-decoration: none; color: inherit; }

.metric-info .metric-label {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1.3;
}

.metric-info .metric-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-top: 0.15rem;
}

/* Employee Directory Table Section */
.directory-panel {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.directory-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 1.25rem;
}

.directory-table {
  width: 100%;
  border-collapse: collapse;
}

.directory-table th {
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.05em;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

.directory-table td {
  padding: 1rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  font-size: 0.9rem;
}

.directory-table tr:last-child td {
  border-bottom: none;
}

.directory-table tbody tr {
  transition: background-color 0.15s ease;
}

.directory-table tbody tr:hover {
  background-color: #f8fafc;
}

.emp-initials-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: #e0e7ff;
  color: #4338ca;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.emp-name-text {
  font-weight: 600;
  color: var(--text-dark);
}

.emp-email-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Login Screen Styles */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top right, #e0e7ff, #f8fafc 60%);
  padding: 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.08);
}

.login-brand {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo-box {
  width: 52px;
  height: 52px;
  background-color: #2563eb;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.25);
}

.login-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-dark);
}

.login-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Sidebar Mobile Toggle Button */
.sidebar-toggle-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-dark);
  font-size: 1.5rem;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  border-radius: 8px;
  transition: background-color 0.2s ease;
}

.sidebar-toggle-btn:hover {
  background-color: #f1f5f9;
}

/* Sidebar Backdrop Overlay */
.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.5);
  z-index: 1040;
  backdrop-filter: blur(2px);
  transition: opacity 0.2s ease;
}

.sidebar-backdrop.show {
  display: block;
}

/* Media Queries for Responsive Design */
@media (max-width: 992px) {
  .sidebar-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .app-sidebar {
    transform: translateX(-100%);
    z-index: 1050;
    box-shadow: none;
  }

  .app-sidebar.show-sidebar {
    transform: translateX(0);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  }

  .app-main {
    margin-left: 0;
  }

  .top-navbar {
    padding: 0 1.25rem;
  }

  .page-content {
    padding: 1.5rem 1.25rem;
  }
}

@media (max-width: 576px) {
  .top-navbar {
    height: 60px;
    padding: 0 1rem;
  }

  .page-content {
    padding: 1rem 0.85rem;
  }

  .page-title {
    font-size: 1.35rem;
  }

  .page-subtitle {
    font-size: 0.85rem;
  }

  .login-card {
    padding: 1.75rem 1.25rem;
    border-radius: 16px;
  }

  .metric-card {
    padding: 1.15rem;
  }

  .metric-icon-box {
    width: 46px;
    height: 46px;
    font-size: 1.25rem;
  }

  .metric-info .metric-value {
    font-size: 1.4rem;
  }
}


/* Sidebar Submenu Styling */
.sidebar-group {
  display: flex;
  flex-direction: column;
}

.sidebar-chevron {
  font-size: 0.72rem !important;
  width: auto !important;
  transition: transform 0.2s ease;
}

.sidebar-link[aria-expanded="true"] .sidebar-chevron {
  transform: rotate(180deg);
}

.sidebar-submenu {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding-left: 1.25rem;
  margin-top: 0.125rem;
  margin-bottom: 0.25rem;
}

.sidebar-sublink {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  color: #94a3b8;
  font-weight: 500;
  text-decoration: none;
  font-size: 0.785rem;
  line-height: 1.4;
  transition: all 0.2s ease;
}

.sidebar-sublink i {
  font-size: 0.85rem;
  color: #64748b;
  width: 1.15rem;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.sidebar-sublink:hover {
  color: #ffffff;
  background-color: var(--sidebar-hover);
}

.sidebar-sublink:hover i {
  color: #3b82f6;
}

.sidebar-sublink.active {
  color: #3b82f6;
  background-color: rgba(59, 130, 246, 0.12);
  font-weight: 600;
}

.sidebar-sublink.active i {
  color: #3b82f6;
}

/* Employee Table Styling */
.emp-list-table th {
  padding-top: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.emp-list-table td {
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid #f1f5f9;
}

/* Color Picker Dot & Dropdown Styling */
.color-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.app-color-picker button {
  background-color: #f8fafc;
  color: #334155;
  transition: all 0.2s ease;
}

.app-color-picker button:hover {
  background-color: #e2e8f0;
  color: #0f172a;
}

.app-color-picker button.active-theme-btn {
  background-color: #eff6ff;
  color: #2563eb;
  font-weight: 600;
}

/* Navigation Theme Color Presets (Top Navbar + Left Sidebar) */
[data-app-theme="dark"] {
  --sidebar-bg: #090d16;
  --navbar-bg: #18181b;
  --navbar-border: #27272a;
  --navbar-text: #ffffff;
  --navbar-icon-color: #a1a1aa;
  --navbar-hover-bg: rgba(255, 255, 255, 0.12);
}

[data-app-theme="blue"] {
  --sidebar-bg: #1e3a8a;
  --navbar-bg: #2563eb;
  --navbar-border: #1d4ed8;
  --navbar-text: #ffffff;
  --navbar-icon-color: #dbeafe;
  --navbar-hover-bg: rgba(255, 255, 255, 0.18);
}

[data-app-theme="emerald"] {
  --sidebar-bg: #064e3b;
  --navbar-bg: #059669;
  --navbar-border: #047857;
  --navbar-text: #ffffff;
  --navbar-icon-color: #d1fae5;
  --navbar-hover-bg: rgba(255, 255, 255, 0.18);
}

[data-app-theme="purple"] {
  --sidebar-bg: #4c1d95;
  --navbar-bg: #7c3aed;
  --navbar-border: #6d28d9;
  --navbar-text: #ffffff;
  --navbar-icon-color: #ede9fe;
  --navbar-hover-bg: rgba(255, 255, 255, 0.18);
}

[data-app-theme="crimson"] {
  --sidebar-bg: #881337;
  --navbar-bg: #be123c;
  --navbar-border: #9f1239;
  --navbar-text: #ffffff;
  --navbar-icon-color: #fecdd3;
  --navbar-hover-bg: rgba(255, 255, 255, 0.18);
}

/* Remove number input spinners */
.no-spinner::-webkit-outer-spin-button,
.no-spinner::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.no-spinner {
  -moz-appearance: textfield;
  appearance: textfield;
}


/* Dashboard Spin Animation */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spin-animation {
  animation: spin 0.75s linear infinite;
  display: inline-block;
}
