/* 
 * RecruitCRM - Modern UI Styles
 * Clean, Professional Design for Recruitment Call Centre
 */

/* ===== CSS Variables ===== */
:root {
  /* Primary Colors */
  --primary: #4f46e5;
  --primary-light: #6366f1;
  --primary-dark: #4338ca;
  --primary-50: #eef2ff;
  --primary-100: #e0e7ff;

  /* Secondary Colors */
  --secondary: #64748b;
  --secondary-light: #94a3b8;
  --secondary-dark: #475569;

  /* Status Colors */
  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --info: #3b82f6;
  --info-light: #dbeafe;
  --purple: #8b5cf6;
  --purple-light: #ede9fe;
  --orange: #f97316;
  --orange-light: #ffedd5;

  /* Neutral Colors */
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* Layout */
  --sidebar-width: 260px;
  --header-height: 64px;
  --border-radius: 8px;
  --border-radius-lg: 12px;
  --border-radius-xl: 16px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1),
    0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1),
    0 8px 10px -6px rgb(0 0 0 / 0.1);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition: 200ms ease;
  --transition-slow: 300ms ease;
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, sans-serif;
  background-color: var(--gray-100);
  color: var(--gray-800);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

a {
  text-decoration: none;
  color: var(--primary);
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-dark);
}

/* ===== Typography ===== */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  color: var(--gray-900);
  line-height: 1.3;
}

h1 {
  font-size: 1.875rem;
}
h2 {
  font-size: 1.5rem;
}
h3 {
  font-size: 1.25rem;
}
h4 {
  font-size: 1.125rem;
}
h5 {
  font-size: 1rem;
}
h6 {
  font-size: 0.875rem;
}

/* ===== Layout Structure ===== */
.app-container {
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-width);
  max-width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--gray-900) 0%, var(--gray-800) 100%);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-slow);
  overflow-x: hidden;
  overflow-y: auto;
}

.sidebar-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-light) 100%
  );
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 1.25rem;
}

.sidebar-logo-text {
  color: var(--white);
  font-size: 1.25rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}

.nav-section {
  margin-bottom: 1rem;
}

.nav-section-title {
  padding: 0.5rem 1.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-500);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  color: var(--gray-400);
  font-weight: 500;
  transition: all var(--transition-fast);
  border-left: 3px solid transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--white);
}

.nav-item.active {
  background-color: rgba(79, 70, 229, 0.2);
  color: var(--white);
  border-left-color: var(--primary);
}

.nav-item i {
  width: 20px;
  font-size: 1.1rem;
}

.nav-item .badge {
  margin-left: auto;
  padding: 0.125rem 0.5rem;
  font-size: 0.7rem;
  border-radius: 9999px;
}

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 600;
  font-size: 0.875rem;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  color: var(--white);
  font-weight: 500;
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  color: var(--gray-500);
  font-size: 0.75rem;
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity var(--transition);
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
  display: inline-flex;
  margin-right: 1rem;
}

/* Default: Sidebar visible on desktop */
.sidebar {
  transform: translateX(0);
}

/* Base state - collapsed sidebar hides it */
body.sidebar-collapsed .sidebar {
  transform: translateX(-260px) !important;
}

body.sidebar-collapsed .main-content {
  margin-left: 0 !important;
  max-width: 100vw !important;
}

/* Mobile/Tablet: Sidebar hidden by default, shown when NOT collapsed */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-260px) !important;
    z-index: 1001;
  }

  body:not(.sidebar-collapsed) .sidebar {
    transform: translateX(0) !important;
    box-shadow: var(--shadow-xl);
  }

  .main-content {
    margin-left: 0 !important;
    max-width: 100vw !important;
  }
}

/* ===== Main Content ===== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  max-width: calc(100vw - var(--sidebar-width));
  transition: margin-left var(--transition-slow),
    max-width var(--transition-slow);
}

/* ===== Header ===== */
.header {
  height: var(--header-height);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  max-width: 100%;
  overflow: visible;
  box-sizing: border-box;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  max-width: 50%;
}

.header-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--gray-500);
}

.header-breadcrumb a {
  color: var(--gray-500);
}

.header-breadcrumb a:hover {
  color: var(--primary);
}

.header-breadcrumb .separator {
  color: var(--gray-300);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 0 0 auto;
  flex-shrink: 0;
}

.header-search {
  position: relative;
  width: 200px;
  max-width: 200px;
  flex-shrink: 1;
}

.header-search input {
  width: 100%;
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  transition: all var(--transition-fast);
}

.header-search input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-50);
}

.header-search i {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.header-action-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--border-radius);
  border: none;
  background: transparent;
  color: var(--gray-600);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all var(--transition-fast);
}

.header-action-btn:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.header-action-btn .badge {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 18px;
  height: 18px;
  padding: 0 0.35rem;
  font-size: 0.65rem;
  border-radius: 9999px;
  background: var(--danger);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.375rem 0.75rem;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.header-user:hover {
  background: var(--gray-100);
}

.header-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
}

/* ===== Page Content ===== */
.page-content {
  flex: 1;
  padding: 1.5rem;
  overflow-x: hidden;
  max-width: 100%;
}

/* ===== Cards ===== */
.card {
  background: var(--white);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  max-width: 100%;
  width: 100%;
}

.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-title i {
  color: var(--primary);
}

.card-body {
  padding: 1.5rem;
  overflow-x: auto;
  max-width: 100%;
}

.card-footer {
  padding: 1rem 1.5rem;
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
}

/* ===== Stats Cards ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--white);
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: all var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.stat-card-icon.primary {
  background: var(--primary-100);
  color: var(--primary);
}

.stat-card-icon.success {
  background: var(--success-light);
  color: var(--success);
}

.stat-card-icon.warning {
  background: var(--warning-light);
  color: var(--warning);
}

.stat-card-icon.danger {
  background: var(--danger-light);
  color: var(--danger);
}

.stat-card-icon.info {
  background: var(--info-light);
  color: var(--info);
}

.stat-card-icon.purple {
  background: var(--purple-light);
  color: var(--purple);
}

.stat-card-content {
  flex: 1;
}

.stat-card-title {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.025em;
  margin-bottom: 0.25rem;
}

.stat-card-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.2;
}

.stat-card-change {
  font-size: 0.75rem;
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.stat-card-change.positive {
  color: var(--success);
}

.stat-card-change.negative {
  color: var(--danger);
}

/* ===== Tables ===== */
.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

.table th,
.table td {
  padding: 0.875rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}

.table th {
  background: var(--gray-50);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-600);
  white-space: nowrap;
}

.table tbody tr {
  transition: background var(--transition-fast);
}

.table tbody tr:hover {
  background: var(--gray-50);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
}

.table-candidate-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.table-candidate-name {
  font-weight: 500;
  color: var(--gray-900);
}

.table-candidate-ref {
  font-size: 0.75rem;
  color: var(--gray-500);
}

/* ===== Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
  white-space: nowrap;
}

.badge-primary {
  background: var(--primary-100);
  color: var(--primary-dark);
}

.badge-success {
  background: var(--success-light);
  color: #065f46;
}

.badge-warning {
  background: var(--warning-light);
  color: #92400e;
}

.badge-danger {
  background: var(--danger-light);
  color: #991b1b;
}

.badge-info {
  background: var(--info-light);
  color: #1e40af;
}

.badge-secondary {
  background: var(--gray-200);
  color: var(--gray-700);
}

.badge-purple {
  background: var(--purple-light);
  color: #5b21b6;
}

.badge-orange {
  background: var(--orange-light);
  color: #c2410c;
}

.badge-green {
  background: #d1fae5;
  color: #047857;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--border-radius);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--gray-200);
  color: var(--gray-700);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--gray-300);
}

.btn-success {
  background: var(--success);
  color: var(--white);
}

.btn-success:hover:not(:disabled) {
  background: #059669;
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
}

.btn-danger:hover:not(:disabled) {
  background: #dc2626;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--gray-300);
  color: var(--gray-700);
}

.btn-outline:hover:not(:disabled) {
  background: var(--gray-100);
  border-color: var(--gray-400);
}

.btn-outline-primary {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
}

.btn-outline-primary:hover:not(:disabled) {
  background: var(--primary);
  color: var(--white);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
}

.btn-icon.btn-sm {
  width: 32px;
  height: 32px;
}

.btn-group {
  display: flex;
  gap: 0.25rem;
}

/* ===== Forms ===== */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
}

.form-label.required::after {
  content: "*";
  color: var(--danger);
  margin-left: 0.25rem;
}

.form-control {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius);
  background: var(--white);
  color: var(--gray-900);
  transition: all var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-50);
}

.form-control:disabled {
  background: var(--gray-100);
  cursor: not-allowed;
}

.form-control::placeholder {
  color: var(--gray-400);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='%236b7280'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  padding-right: 2.5rem;
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

.form-help {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 0.375rem;
}

.form-error {
  font-size: 0.75rem;
  color: var(--danger);
  margin-top: 0.375rem;
}

.form-control.is-invalid {
  border-color: var(--danger);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

/* ===== Checkbox & Radio ===== */
.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.form-check-input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.form-check-label {
  font-size: 0.875rem;
  color: var(--gray-700);
  cursor: pointer;
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--white);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.95) translateY(-20px);
  transition: transform var(--transition);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal.modal-lg {
  max-width: 800px;
}

.modal.modal-xl {
  max-width: 1000px;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-900);
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--gray-500);
  border-radius: var(--border-radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ===== Dropdown ===== */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 200px;
  background: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
  padding: 0.5rem 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all var(--transition-fast);
  z-index: 1000;
}

.dropdown.active .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(4px);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  color: var(--gray-700);
  font-size: 0.875rem;
  transition: background var(--transition-fast);
  cursor: pointer;
}

.dropdown-item:hover {
  background: var(--gray-100);
}

.dropdown-item i {
  width: 18px;
  color: var(--gray-500);
}

.dropdown-divider {
  height: 1px;
  background: var(--gray-200);
  margin: 0.5rem 0;
}

/* Notification Dropdown */
.notification-dropdown {
  width: 360px;
  max-height: 480px;
  padding: 0;
}

.notification-dropdown .dropdown-header {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
  font-weight: 600;
  font-size: 0.875rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notification-dropdown .dropdown-header a {
  font-weight: 400;
  font-size: 0.813rem;
  color: var(--primary);
}

.notification-dropdown .dropdown-header a:hover {
  text-decoration: underline;
}

.notification-list {
  max-height: 400px;
  overflow-y: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

.notification-list::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 1rem;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.notification-item:last-child {
  border-bottom: none;
}

.notification-item:hover {
  background: var(--gray-50);
  transform: translateX(2px);
}

.notification-item.unread {
  background: linear-gradient(to right, var(--primary-50), var(--white));
}

.notification-item.unread:hover {
  background: linear-gradient(to right, var(--primary-100), var(--gray-50));
}

.notification-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.notification-icon.icon-blue {
  background: var(--primary-100);
  color: var(--primary);
}

.notification-icon.icon-green {
  background: var(--success-light);
  color: var(--success);
}

.notification-icon.icon-purple {
  background: var(--purple-light);
  color: var(--purple);
}

.notification-icon.icon-orange {
  background: var(--orange-light);
  color: var(--orange);
}

.notification-icon.icon-yellow {
  background: var(--warning-light);
  color: var(--warning);
}

.notification-icon.icon-gray {
  background: var(--gray-200);
  color: var(--gray-600);
}

.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-title {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--gray-800);
  margin-bottom: 0.25rem;
  line-height: 1.4;
}

.notification-message {
  font-size: 0.813rem;
  color: var(--gray-600);
  line-height: 1.5;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notification-time {
  font-size: 0.75rem;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.notification-time i {
  font-size: 0.7rem;
}

.notification-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  position: absolute;
  top: 1.25rem;
  right: 1rem;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.1);
  }
}

.notification-empty {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--gray-500);
}

.notification-empty i {
  font-size: 3rem;
  color: var(--gray-300);
  margin-bottom: 0.75rem;
  display: block;
}

.notification-empty div {
  font-size: 0.875rem;
  color: var(--gray-500);
}

.notification-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--gray-200);
  text-align: center;
  background: var(--gray-50);
}

.notification-footer a {
  font-size: 0.875rem;
  font-weight: 500;
}

/* ===== Tabs ===== */
.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 1.5rem;
}

.tab {
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-500);
  border: none;
  background: transparent;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab:hover {
  color: var(--gray-700);
}

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ===== Alerts ===== */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--border-radius);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.alert-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.alert-content {
  flex: 1;
}

.alert-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.alert-message {
  font-size: 0.875rem;
}

.alert-success {
  background: var(--success-light);
  color: #065f46;
}

.alert-danger {
  background: var(--danger-light);
  color: #991b1b;
}

.alert-warning {
  background: var(--warning-light);
  color: #92400e;
}

.alert-info {
  background: var(--info-light);
  color: #1e40af;
}

/* ===== Pagination ===== */
.pagination {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.pagination-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 0.75rem;
  border: 1px solid var(--gray-300);
  background: var(--white);
  color: var(--gray-700);
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.pagination-btn:hover:not(:disabled) {
  background: var(--gray-100);
  border-color: var(--gray-400);
}

.pagination-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-info {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-left: auto;
}

/* ===== Timeline ===== */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0.5rem;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 2px;
  background: var(--gray-200);
}

.timeline-item {
  position: relative;
  padding-bottom: 1.5rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -1.75rem;
  top: 0.25rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--white);
  box-shadow: 0 0 0 2px var(--primary-100);
}

.timeline-content {
  background: var(--gray-50);
  padding: 1rem;
  border-radius: var(--border-radius);
}

.timeline-title {
  font-weight: 500;
  color: var(--gray-900);
  margin-bottom: 0.25rem;
}

.timeline-time {
  font-size: 0.75rem;
  color: var(--gray-500);
}

.timeline-body {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin-top: 0.5rem;
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  background: var(--gray-100);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--gray-400);
}

.empty-state-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

.empty-state-text {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-bottom: 1.5rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== Loading States ===== */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--gray-200) 25%,
    var(--gray-100) 50%,
    var(--gray-200) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--border-radius);
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ===== Toast Notifications ===== */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  min-width: 300px;
  max-width: 400px;
  background: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  padding: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.toast-success .toast-icon {
  color: var(--success);
}

.toast-error .toast-icon {
  color: var(--danger);
}

.toast-warning .toast-icon {
  color: var(--warning);
}

.toast-info .toast-icon {
  color: var(--info);
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.125rem;
}

.toast-message {
  font-size: 0.875rem;
  color: var(--gray-600);
}

.toast-close {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--gray-400);
  cursor: pointer;
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-close:hover {
  background: var(--gray-100);
  color: var(--gray-600);
}

/* ===== Progress Bar ===== */
.progress {
  height: 8px;
  background: var(--gray-200);
  border-radius: 9999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 9999px;
  transition: width var(--transition);
}

.progress-bar.success {
  background: var(--success);
}

.progress-bar.warning {
  background: var(--warning);
}

.progress-bar.danger {
  background: var(--danger);
}

/* ===== Avatar Group ===== */
.avatar-group {
  display: flex;
}

.avatar-group .avatar {
  margin-left: -8px;
  border: 2px solid var(--white);
}

.avatar-group .avatar:first-child {
  margin-left: 0;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.75rem;
}

.avatar.avatar-sm {
  width: 24px;
  height: 24px;
  font-size: 0.65rem;
}

.avatar.avatar-lg {
  width: 48px;
  height: 48px;
  font-size: 1rem;
}

.avatar.avatar-xl {
  width: 64px;
  height: 64px;
  font-size: 1.25rem;
}

/* ===== Filters ===== */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--gray-50);
  border-radius: var(--border-radius);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.filter-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--gray-600);
}

.filter-control {
  min-width: 150px;
}

/* ===== Kanban Board ===== */
.kanban-board {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 1rem;
}

.kanban-column {
  flex: 0 0 280px;
  background: var(--gray-100);
  border-radius: var(--border-radius-lg);
  padding: 1rem;
}

.kanban-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.kanban-column-title {
  font-weight: 600;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.kanban-column-count {
  padding: 0.125rem 0.5rem;
  background: var(--gray-300);
  border-radius: 9999px;
  font-size: 0.75rem;
  color: var(--gray-700);
}

.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.kanban-card {
  background: var(--white);
  border-radius: var(--border-radius);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.kanban-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

/* ===== Quick Actions ===== */
.quick-actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.quick-action {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  color: var(--gray-700);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.quick-action:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
}

.quick-action i {
  color: var(--primary);
}

/* ===== Responsive ===== */
@media (max-width: 1400px) {
  /* Adjust 2-column layouts for medium screens */
  .reports-grid,
  [style*="grid-template-columns: 2fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Make header more compact on smaller screens */
  .header-breadcrumb {
    display: none;
  }

  .header {
    padding: 0 0.75rem;
  }

  .header-title {
    font-size: 1rem;
    max-width: 200px;
  }

  .header-search {
    width: 160px;
    max-width: 160px;
  }

  .header-actions {
    gap: 0;
  }

  .header-action-btn {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 1200px) {
  /* Small desktop adjustments */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .header {
    padding: 0 0.5rem;
  }

  .header-search {
    width: 140px;
    max-width: 140px;
  }

  .header-title {
    font-size: 0.9rem;
    max-width: 150px;
  }

  /* Make page content more compact */
  .page-content {
    padding: 1rem;
  }

  /* Make user dropdown more compact */
  .header-user {
    padding: 0.25rem 0.5rem;
    gap: 0.5rem;
  }

  .header-user-avatar {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
  }
}

@media (max-width: 1024px) {
  .sidebar-toggle {
    display: inline-flex !important;
  }

  .container {
    padding: 1rem;
    overflow-x: hidden;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Make tables scrollable */
  .table-container,
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }

  .card {
    overflow-x: hidden;
    max-width: 100%;
  }

  /* Adjust grid layouts */
  [style*="grid-template-columns: 2fr 1fr"],
  [style*="display: grid"] {
    grid-template-columns: 1fr !important;
  }

  /* Fix any inline grid styles */
  .reports-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 768px) {
  .header-search {
    display: none;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr !important;
  }

  .filters {
    flex-direction: column;
  }

  .filter-control {
    min-width: 100%;
  }

  /* Sidebar adjustments for mobile */
  .sidebar {
    width: 75vw;
    max-width: 280px;
  }

  .main-content {
    padding: 0;
  }

  .container {
    padding: 0.5rem;
  }

  /* Mobile table improvements */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }

  table {
    min-width: 600px;
  }

  /* Card adjustments */
  .card {
    margin-bottom: 1rem;
    max-width: 100%;
    overflow: hidden;
  }

  /* Button groups stack on mobile */
  .btn-group {
    flex-direction: column;
    width: 100%;
  }

  .btn-group .btn {
    width: 100%;
    margin-bottom: 0.5rem;
  }

  /* Adjust padding for mobile */
  .card-body {
    padding: 1rem;
  }

  /* Make flex items wrap */
  .d-flex {
    flex-wrap: wrap;
  }

  /* Adjust spacing */
  .gap-2 {
    gap: 0.5rem !important;
  }

  .gap-3 {
    gap: 0.75rem !important;
  }
}

@media (max-width: 480px) {
  /* Extra small screens */
  :root {
    --sidebar-width: 100%;
  }

  .sidebar {
    width: 100%;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  /* Smaller text on very small screens */
  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  /* Full width buttons */
  .btn {
    width: 100%;
    margin-bottom: 0.5rem;
  }

  /* Stack form inputs */
  .form-row,
  .row {
    flex-direction: column;
  }

  .col-md-2,
  .col-md-3,
  .col-md-4,
  .col-md-6 {
    width: 100%;
    max-width: 100%;
  }
}

/* ===== Utilities ===== */
.text-center {
  text-align: center;
}
.text-right {
  text-align: right;
}
.text-primary {
  color: var(--primary);
}
.text-success {
  color: var(--success);
}
.text-danger {
  color: var(--danger);
}
.text-warning {
  color: var(--warning);
}
.text-muted {
  color: var(--gray-500);
}
.text-small {
  font-size: 0.875rem;
}
.text-xs {
  font-size: 0.75rem;
}

.font-medium {
  font-weight: 500;
}
.font-semibold {
  font-weight: 600;
}
.font-bold {
  font-weight: 700;
}

.mt-1 {
  margin-top: 0.25rem;
}
.mt-2 {
  margin-top: 0.5rem;
}
.mt-3 {
  margin-top: 0.75rem;
}
.mt-4 {
  margin-top: 1rem;
}
.mb-1 {
  margin-bottom: 0.25rem;
}
.mb-2 {
  margin-bottom: 0.5rem;
}
.mb-3 {
  margin-bottom: 0.75rem;
}
.mb-4 {
  margin-bottom: 1rem;
}

.d-flex {
  display: flex;
}
.align-center {
  align-items: center;
}
.justify-between {
  justify-content: space-between;
}
.gap-1 {
  gap: 0.25rem;
}
.gap-2 {
  gap: 0.5rem;
}
.gap-3 {
  gap: 0.75rem;
}
.gap-4 {
  gap: 1rem;
}

.hidden {
  display: none;
}
.visible {
  visibility: visible;
}
.invisible {
  visibility: hidden;
}

.w-full {
  width: 100%;
}
.h-full {
  height: 100%;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clickable {
  cursor: pointer;
}

.no-select {
  user-select: none;
}
