/* Light Mode Defaults */
:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --primary-dark: #3730a3;
  --success: #10b981;
  --success-light: #ecfdf5;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --info: #06b6d4;
  --info-light: #ecfeff;

  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-card-secondary: #f8fafc;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --border-focus: #818cf8;
  --input-bg: #f8fafc;
  --sidebar-bg: #0f172a;
  --sidebar-border: #1e293b;
  --sidebar-text: #f1f5f9;
  --sidebar-muted: #94a3b8;
  --topbar-bg: #ffffff;
  --modal-bg: #ffffff;
  --badge-bg-neutral: #f1f5f9;
  --badge-text-neutral: #475569;

  --sidebar-w: 260px;
  --radius: 12px;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Overrides */
[data-theme="dark"] {
  --bg-main: #0b0f19;
  --bg-card: #111827;
  --bg-card-hover: #1f2937;
  --bg-card-secondary: #1a2234;
  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --border: #283347;
  --border-focus: #6366f1;
  --input-bg: #1a2234;
  --sidebar-bg: #080c14;
  --sidebar-border: #1a2333;
  --sidebar-text: #f9fafb;
  --sidebar-muted: #8492a6;
  --topbar-bg: #111827;
  --modal-bg: #111827;
  --badge-bg-neutral: #1f2937;
  --badge-text-neutral: #cbd5e1;
  --primary-light: rgba(79, 70, 229, 0.15);
  --success-light: rgba(16, 185, 129, 0.15);
  --warning-light: rgba(245, 158, 11, 0.15);
  --danger-light: rgba(239, 68, 68, 0.15);
  --info-light: rgba(6, 182, 212, 0.15);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.35);
  --shadow-lg: 0 10px 20px -3px rgb(0 0 0 / 0.5);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  border-right: 1px solid var(--sidebar-border);
}

.brand {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--sidebar-border);
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: bold;
  color: white;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.brand-text h1 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #fff;
}

.brand-text p {
  font-size: 11px;
  color: var(--sidebar-muted);
  font-weight: 500;
}

.role-switch-container {
  padding: 14px 18px;
  border-bottom: 1px solid var(--sidebar-border);
}

.role-badge-box {
  background: rgba(255, 255, 255, 0.05);
  padding: 10px 14px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.role-badge-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--sidebar-muted);
  font-weight: 600;
}

.role-selector {
  width: 100%;
  padding: 8px 10px;
  background: #0f172a;
  color: #e2e8f0;
  border: 1px solid #334155;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  outline: none;
  cursor: pointer;
}

.nav-section {
  padding: 16px 14px;
  flex: 1;
  overflow-y: auto;
}

.nav-heading {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--sidebar-muted);
  font-weight: 700;
  padding: 0 10px 8px;
  letter-spacing: 0.5px;
}

.nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: var(--sidebar-muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 8px;
  transition: var(--transition);
}

.nav-item a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.nav-item.active a {
  background: #4f46e5;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

.nav-item .badge {
  margin-left: auto;
  font-size: 11px;
  padding: 2px 7px;
  background: #ef4444;
  color: white;
  border-radius: 20px;
  font-weight: 700;
}

.sidebar-footer {
  padding: 16px 18px;
  border-top: 1px solid var(--sidebar-border);
  font-size: 12px;
  color: var(--sidebar-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Main Content Area */
.main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 70px;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 90;
}

.page-title h2 {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-main);
}

.page-title p {
  font-size: 12px;
  color: var(--text-muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Theme Switcher Button */
.theme-toggle-btn {
  background: var(--bg-card-secondary);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 7px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.theme-toggle-btn:hover {
  background: var(--border);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card-secondary);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 24px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.user-role {
  font-size: 11px;
  color: var(--text-muted);
}

.logout-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--danger);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: var(--transition);
}

.logout-btn:hover {
  background: var(--danger-light);
  border-color: var(--danger);
}

/* Content Container */
.content-body {
  padding: 28px 32px;
  flex: 1;
}

/* KPI Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px 18px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.stat-icon.blue { background: #eff6ff; color: #2563eb; }
.stat-icon.green { background: #ecfdf5; color: #059669; }
.stat-icon.amber { background: #fffbeb; color: #d97706; }
.stat-icon.purple { background: #f5f3ff; color: #7c3aed; }
.stat-icon.rose { background: #fff1f2; color: #e11d48; }

[data-theme="dark"] .stat-icon.blue { background: rgba(37, 99, 235, 0.2); }
[data-theme="dark"] .stat-icon.green { background: rgba(5, 150, 105, 0.2); }
[data-theme="dark"] .stat-icon.amber { background: rgba(217, 119, 6, 0.2); }
[data-theme="dark"] .stat-icon.purple { background: rgba(124, 58, 237, 0.2); }
[data-theme="dark"] .stat-icon.rose { background: rgba(225, 29, 72, 0.2); }

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
}

.stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 2px;
}

/* Cards & Sections */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  overflow: hidden;
}

.card-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.card-title {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.card-body {
  padding: 22px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8.5px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-success {
  background: var(--success);
  color: white;
}
.btn-success:hover {
  background: #059669;
}

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover {
  background: #dc2626;
}

.btn-outline {
  background: var(--bg-card-secondary);
  border: 1px solid var(--border);
  color: var(--text-main);
}
.btn-outline:hover {
  background: var(--border);
}

.btn-export {
  background: linear-gradient(135deg, #059669, #10b981);
  color: white;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}
.btn-export:hover {
  background: linear-gradient(135deg, #047857, #059669);
}

.btn-sm {
  padding: 5px 11px;
  font-size: 12px;
  border-radius: 6px;
}

/* Filters & Inputs */
.search-box {
  position: relative;
  min-width: 250px;
}

.search-box input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  background: var(--input-bg);
  color: var(--text-main);
}

.search-box input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.search-box .icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 13px;
}

.select-filter {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  background: var(--input-bg);
  color: var(--text-main);
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

thead th {
  background: var(--bg-card-secondary);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
}

tbody td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-main);
  vertical-align: middle;
}

tbody tr:hover {
  background-color: var(--bg-card-hover);
}

/* Status Badges */
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
}

.badge-pending {
  background: #fef3c7;
  color: #b45309;
}
[data-theme="dark"] .badge-pending {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.badge-approved {
  background: #d1fae5;
  color: #065f46;
}
[data-theme="dark"] .badge-approved {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.badge-rejected {
  background: #fee2e2;
  color: #991b1b;
}
[data-theme="dark"] .badge-rejected {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.badge-active {
  background: #dbeafe;
  color: #1e40af;
}
[data-theme="dark"] .badge-active {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.badge-todo {
  background: var(--badge-bg-neutral);
  color: var(--badge-text-neutral);
}

.badge-priority-acil {
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 700;
}
[data-theme="dark"] .badge-priority-acil {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

.badge-priority-yuksek {
  background: #ffedd5;
  color: #c2410c;
}
[data-theme="dark"] .badge-priority-yuksek {
  background: rgba(249, 115, 22, 0.25);
  color: #fdba74;
}

.badge-priority-orta {
  background: #fef9c3;
  color: #854d0e;
}
[data-theme="dark"] .badge-priority-orta {
  background: rgba(234, 179, 8, 0.2);
  color: #fde047;
}

.badge-priority-dusuk {
  background: var(--badge-bg-neutral);
  color: var(--badge-text-neutral);
}

/* Progress bar */
.progress-bar {
  background: var(--border);
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 6px;
}

.progress-fill {
  background: var(--primary);
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 15, 26, 0.7);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-dialog {
  background: var(--modal-bg);
  border-radius: 16px;
  width: 90%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  transform: scale(0.95);
  transition: var(--transition);
}

.modal-overlay.active .modal-dialog {
  transform: scale(1);
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 16.5px;
  font-weight: 700;
  color: var(--text-main);
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 22px;
}

.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: var(--bg-card-secondary);
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}

.form-group.col-span-2 {
  grid-column: span 2;
}

.form-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-main);
}

.form-control {
  padding: 8.5px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  transition: var(--transition);
  background: var(--input-bg);
  color: var(--text-main);
  width: 100%;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

/* Login Modal / Screen */
.auth-wrapper {
  position: fixed;
  inset: 0;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(8px);
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.5);
  width: 100%;
  max-width: 460px;
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-header {
  padding: 28px 28px 20px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.auth-logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 12px;
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
}

.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card-secondary);
}

.auth-tab {
  flex: 1;
  padding: 12px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: transparent;
  transition: var(--transition);
}

.auth-tab.active {
  color: var(--primary);
  background: var(--bg-card);
  border-bottom: 2px solid var(--primary);
}

.auth-body {
  padding: 24px 28px;
}

.quick-demo-box {
  margin-top: 18px;
  padding: 14px;
  border-radius: 12px;
  background: var(--bg-card-secondary);
  border: 1px dashed var(--border);
}

.quick-demo-title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.quick-demo-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quick-chip {
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--text-main);
  transition: var(--transition);
}

.quick-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

/* Detailed Employee Profile Card */
.profile-hero {
  background: linear-gradient(135deg, #3730a3, #4f46e5);
  border-radius: var(--radius);
  padding: 24px 28px;
  color: white;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.25);
}

.profile-hero-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.profile-hero-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  border: 2px solid rgba(255, 255, 255, 0.4);
}

.profile-hero-info h3 {
  font-size: 20px;
  font-weight: 700;
}

.profile-hero-info p {
  font-size: 13px;
  opacity: 0.85;
  margin-top: 2px;
}

.profile-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  background: rgba(255, 255, 255, 0.1);
  padding: 14px 18px;
  border-radius: 12px;
  backdrop-filter: blur(4px);
}

.profile-meta-item {
  display: flex;
  flex-direction: column;
}

.profile-meta-label {
  font-size: 11px;
  text-transform: uppercase;
  opacity: 0.75;
  font-weight: 600;
}

.profile-meta-val {
  font-size: 13.5px;
  font-weight: 700;
}

/* Toast notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 6000;
}

.toast {
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: white;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 20px -3px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.3s ease;
}

.toast-success { background: #059669; }
.toast-error { background: #dc2626; }
.toast-info { background: #2563eb; }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Responsive */
@media (max-width: 900px) {
  .sidebar {
    width: 70px;
  }
  .brand-text, .role-switch-container, .nav-heading, .nav-item span:not(:first-child), .sidebar-footer {
    display: none;
  }
  .brand {
    justify-content: center;
    padding: 16px 0;
  }
  .nav-item a {
    justify-content: center;
    padding: 12px;
  }
  .main-wrapper {
    margin-left: 70px;
  }
}
