:root {
  --primary-color: #6366f1;
  --secondary-color: #64748b;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --dark-color: #1e293b;
  --light-color: #f8fafc;
  --border-color: #e2e8f0;
  --sidebar-width: 320px;
}

* {
  font-family: "Inter", sans-serif;
  box-sizing: border-box;
}

body {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* ===========================================
   LOGIN CONTAINER & CARD
   =========================================== */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 1rem;
}

.login-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
  width: 100%;
  max-width: 400px;
}

.login-header {
  background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
  color: white;
  padding: 2rem;
  text-align: center;
}

.login-body {
  padding: 2rem;
}

/* Login Tabs Modern Style */
.login-tabs {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-bottom: 2rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* login-tabs ve nav-tabs mor efektler tamamen kaldırıldı, Bootstrap klasik tab görünümü */
.login-tabs .nav-tabs,
.nav-tabs {
  border-bottom: 1px solid #dee2e6;
  background: transparent;
  box-shadow: none;
  gap: 0;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
}

.login-tabs .nav-link,
.nav-tabs .nav-link {
  background: none !important;
  color: #495057 !important;
  border: 1px solid transparent !important;
  border-radius: 0.375rem 0.375rem 0 0 !important;
  font-weight: 500 !important;
  padding: 0.5rem 1.25rem !important;
  margin-bottom: -1px !important;
  min-width: 100px;
  white-space: nowrap;
  box-shadow: none !important;
  transition: color 0.2s, background 0.2s !important;
}

.login-tabs .nav-link.active,
.nav-tabs .nav-link.active {
  color: #495057 !important;
  background-color: #fff !important;
  border-color: #dee2e6 #dee2e6 #fff !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}

.login-tabs .nav-link:not(.active):hover,
.nav-tabs .nav-link:not(.active):hover {
  background: #f8f9fa !important;
  color: #495057 !important;
}

/* ===========================================
   FORM CONTROLS
   =========================================== */
.form-control {
  border-radius: 12px;
  border: 2px solid var(--border-color);
  padding: 12px 16px;
  transition: all 0.3s ease;
  font-size: 16px; /* Prevents zoom on iOS */
  min-height: 44px;
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  outline: none;
}

/* ===========================================
   BUTTONS
   =========================================== */
.btn {
  border-radius: 12px;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  transition: all 0.3s ease;
  min-height: 44px;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
  border: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
}

.btn-success {
  background: linear-gradient(135deg, var(--success-color), #059669);
  border: none;
}

.btn-warning {
  background: linear-gradient(135deg, var(--warning-color), #d97706);
  border: none;
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger-color), #dc2626);
  border: none;
}

/* ===========================================
   DASHBOARD LAYOUT
   =========================================== */
.dashboard-container {
  display: flex;
  min-height: 100vh;
  background: var(--light-color) !important;
}

/* Desktop Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: rgba(30, 41, 59, 0.95);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 1000;
  color: #fff;
  left: 0;
  top: 0;
}

.sidebar-header {
  padding: 2rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.sidebar-brand {
  color: white;
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.sidebar-nav {
  padding: 1rem 0;
}

.nav-item {
  margin: 0.25rem 1rem;
}

.nav-link {
  color: rgba(255, 255, 255, 0.7);
  padding: 0.75rem 1rem;
  border-radius: 12px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 500;
  text-decoration: none;
  min-height: 44px;
}

.nav-link:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(5px);
  text-decoration: none;
}

.nav-link.active {
  color: white;
  background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.sidebar .nav-link,
.sidebar .nav-link i {
  color: rgba(255, 255, 255, 0.7);
  opacity: 1;
}

.sidebar .nav-link.active,
.sidebar .nav-link:hover {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
}

.sidebar .nav-link.active i,
.sidebar .nav-link:hover i {
  color: #fff;
}

/* Sidebar Online Users */
.sidebar-online-users {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  margin: 1rem;
  padding: 1rem;
}

.sidebar-online-users .badge {
  background: var(--success-color) !important;
}

.sidebar-online-users .text-success {
  color: var(--success-color) !important;
}

/* Main Content */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  background: var(--light-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: calc(100% - var(--sidebar-width));
}

.content-wrapper {
  flex: 1;
  padding: 2rem;
}

.top-navbar {
  background: white;
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 2rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

.content-area {
  padding: 2rem;
}

.page-header {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-color);
}

.page-title {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--dark-color);
  margin: 0;
}

.page-subtitle {
  color: var(--secondary-color);
  margin: 0.5rem 0 0 0;
}

/* ===========================================
   CARDS
   =========================================== */
.card {
  border-radius: 16px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  margin-bottom: 1rem;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.card-header {
  background: white;
  border-bottom: 1px solid var(--border-color);
  border-radius: 16px 16px 0 0 !important;
  padding: 1.5rem;
}

.card-body {
  padding: 1.5rem;
}

/* ===========================================
   TOPBAR PROFILE
   =========================================== */
.topbar-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #fff;
  border-radius: 2rem;
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.08);
  border: 1.5px solid #e2e8f0;
  padding: 0.25rem 1.1rem 0.25rem 0.4rem;
  cursor: pointer;
  transition: border 0.2s, box-shadow 0.2s;
  min-width: 140px;
  min-height: 44px;
  text-decoration: none;
}

.topbar-profile:hover,
.topbar-profile:focus {
  border: 1.5px solid #6366f1;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.13);
  background: #f8fafc;
  text-decoration: none;
}

.topbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
  flex-shrink: 0;
}

.topbar-userinfo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.1;
  min-width: 0;
}

.topbar-username {
  font-weight: 600;
  color: #6366f1;
  font-size: 1.05rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.topbar-role {
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 400;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

/* ===========================================
   DROPDOWN MENUS
   =========================================== */
.dropdown-menu {
  border-radius: 1rem;
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.1);
  border: 1.5px solid #e2e8f0;
  padding: 0.5rem 0;
  min-width: 180px;
}

.dropdown-item {
  border-radius: 0.5rem;
  font-weight: 500;
  color: #374151;
  padding: 0.7rem 1.2rem;
  transition: background 0.18s, color 0.18s;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: #e0e7ff;
  color: #6366f1;
}

/* ===========================================
   TABLES
   =========================================== */
.table {
  border-radius: 12px;
  overflow: hidden;
  font-size: 0.9rem;
}

.table th {
  background: var(--light-color);
  border: none;
  font-weight: 600;
  color: var(--dark-color);
  padding: 1rem;
  white-space: nowrap;
}

.table td {
  padding: 1rem;
  border-color: var(--border-color);
  vertical-align: middle;
}

/* ===========================================
   BADGES & ALERTS
   =========================================== */
.badge {
  border-radius: 8px;
  font-weight: 600;
  padding: 0.5rem 0.75rem;
}

.alert {
  border-radius: 12px;
  border: none;
  padding: 1rem 1.5rem;
}

/* ===========================================
   PROGRESS BARS
   =========================================== */
.progress {
  border-radius: 10px;
  height: 8px;
}

.progress-bar {
  border-radius: 10px;
}

/* ===========================================
   FOOTER
   =========================================== */
.footer {
  margin-top: auto;
  z-index: 100;
  background: rgba(30, 41, 59, 0.95) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  width: 100%;
  position: relative;
}

.footer .container-fluid,
.footer .row,
.footer .col-md-6,
.footer * {
  background: transparent !important;
}

/* ===========================================
   ANIMATIONS
   =========================================== */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===========================================
   SCROLLBAR
   =========================================== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--light-color);
}

::-webkit-scrollbar-thumb {
  background: var(--secondary-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

/* ===========================================
   GLOBAL BACKGROUND FIXES
   =========================================== */
body,
.container-fluid,
.main-content,
.dashboard-container {
  background: var(--light-color) !important;
  color: var(--dark-color) !important;
}

/* ===========================================
   MOBILE HAMBURGER BUTTON
   =========================================== */
.mobile-hamburger {
  position: fixed !important;
  top: 1rem !important;
  left: 1rem !important;
  z-index: 1060 !important;
  border-radius: 50% !important;
  width: 50px !important;
  height: 50px !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.2) !important;
  border: none !important;
  background: linear-gradient(135deg, var(--primary-color), #8b5cf6) !important;
  color: white !important;
  font-size: 1.2rem !important;
}

.mobile-hamburger:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3) !important;
  color: white !important;
}

/* ===========================================
   MOBILE RESPONSIVE STYLES
   =========================================== */

/* Desktop - 768px ve üzeri */
@media (min-width: 768px) {
  .sidebar {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    width: var(--sidebar-width) !important;
    height: 100vh !important;
    background: rgba(30, 41, 59, 0.95) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
    z-index: 1045 !important;
    transform: none !important;
    visibility: visible !important;
    box-shadow: none !important;
    padding: 0 !important;
    display: block !important;
    opacity: 1 !important;
  }

  .sidebar.offcanvas {
    transform: none !important;
    visibility: visible !important;
    display: block !important;
    opacity: 1 !important;
    left: 0 !important;
    top: 0 !important;
  }

  .offcanvas-backdrop {
    display: none !important;
  }

  .main-content {
    margin-left: var(--sidebar-width) !important;
  }

  .mobile-hamburger {
    display: none !important;
  }
}

/* Tablet ve Mobile - 767px altı */
@media (max-width: 767.98px) {
  /* Hide desktop sidebar */
  .sidebar {
    display: none !important;
  }

  /* Show mobile hamburger */
  .mobile-hamburger {
    display: flex !important;
  }

  /* Adjust main content for mobile */
  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
  }

  /* Content adjustments */
  .content-wrapper {
    padding: 1rem;
    padding-top: 5rem; /* Account for hamburger button */
  }

  .content-area {
    padding: 1rem;
  }

  .top-navbar {
    padding: 1rem;
    margin-top: 4rem; /* Account for hamburger button */
  }

  .page-header {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
  }

  .page-title {
    font-size: 1.5rem;
  }

  .card-header,
  .card-body {
    padding: 1.25rem;
  }

  /* Login mobile adjustments */
  .login-container {
    padding: 0.5rem;
  }

  .login-card {
    max-width: 100%;
    border-radius: 16px;
  }

  .login-header,
  .login-body {
    padding: 1.5rem;
  }

  .login-tabs .nav-link {
    padding: 0.6rem 1rem;
    min-width: 100px;
    font-size: 0.9rem;
  }

  /* Mobile topbar profile */
  .topbar-profile {
    min-width: 120px;
  }

  .topbar-username,
  .topbar-role {
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Mobile table */
  .table-responsive {
    border-radius: 12px;
  }

  .table {
    font-size: 0.85rem;
  }

  .table th,
  .table td {
    padding: 0.75rem 0.5rem;
  }

  /* Mobile buttons */
  .btn {
    font-size: 0.9rem;
    padding: 0.6rem 1.2rem;
  }

  /* Disable hover effects on touch devices */
  .card:hover {
    transform: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  }

  .btn:hover {
    transform: none;
  }

  .nav-link:hover {
    transform: none;
  }
}

/* Small mobile - 576px altı */
@media (max-width: 575.98px) {
  .content-wrapper {
    padding: 0.75rem;
    padding-top: 4.5rem;
  }

  .page-header {
    padding: 1rem;
    text-align: center;
  }

  .page-title {
    font-size: 1.25rem;
  }

  .card-header,
  .card-body {
    padding: 1rem;
  }

  .login-header,
  .login-body {
    padding: 1rem;
  }

  .topbar-profile {
    min-width: 100px;
    gap: 0.5rem;
  }

  .topbar-username,
  .topbar-role {
    max-width: 60px;
    font-size: 0.8rem;
  }

  .topbar-avatar {
    width: 32px;
    height: 32px;
    font-size: 1.1rem;
  }
}

/* ===========================================
   MOBILE OFFCANVAS SIDEBAR
   =========================================== */
.offcanvas {
  background: rgba(30, 41, 59, 0.98) !important;
  color: #fff !important;
  width: 280px !important;
  max-width: 85vw !important;
}

.offcanvas-header {
  background: rgba(30, 41, 59, 0.98) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  padding: 1rem 1.5rem !important;
}

.offcanvas-title {
  color: #fff !important;
  font-weight: 600 !important;
  margin: 0 !important;
}

.offcanvas-title img {
  max-height: 40px !important;
  width: auto !important;
}

.offcanvas-title h5 {
  color: #fff !important;
  margin: 0 !important;
  font-weight: 600 !important;
}

.offcanvas-body {
  background: rgba(30, 41, 59, 0.98) !important;
  color: #fff !important;
  padding: 1rem 0 !important;
}

/* Mobile sidebar navigation - Override all styles */
#mobileSidebar,
#mobileSidebar .offcanvas-body,
#mobileSidebar .sidebar-nav,
#mobileSidebar .nav,
#mobileSidebar .nav-link,
#mobileSidebar .sidebar-online-users,
#mobileSidebar .sidebar-online-users *,
#mobileSidebar .nav-link i,
#mobileSidebar .collapse,
#mobileSidebar .collapse .nav-link,
#mobileSidebar .collapse .nav-link.active {
  background: rgba(30, 41, 59, 0.98) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: none !important;
}

#mobileSidebar .nav-link {
  color: rgba(255, 255, 255, 0.7) !important;
  padding: 0.75rem 1.5rem !important;
  border-radius: 0 !important;
  transition: all 0.3s ease !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.75rem !important;
  font-weight: 500 !important;
  border-left: 3px solid transparent !important;
  min-height: 48px !important;
  text-decoration: none !important;
}

#mobileSidebar .nav-link:hover {
  color: white !important;
  background: rgba(255, 255, 255, 0.1) !important;
  border-left: 3px solid var(--primary-color) !important;
  text-decoration: none !important;
}

#mobileSidebar .nav-link.active {
  color: white !important;
  background: rgba(99, 102, 241, 0.2) !important;
  border-left: 3px solid var(--primary-color) !important;
}

#mobileSidebar .nav-link i {
  color: inherit !important;
  opacity: 1 !important;
  width: 20px !important;
  text-align: center !important;
}

#mobileSidebar .collapse {
  background: rgba(255, 255, 255, 0.05) !important;
  margin: 0.5rem 0 !important;
}

#mobileSidebar .collapse .nav-link {
  padding: 0.6rem 2rem !important;
  font-size: 0.9rem !important;
  color: rgba(255, 255, 255, 0.7) !important;
  border-left: none !important;
  padding-left: 3rem !important;
}

#mobileSidebar .collapse .nav-link:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
}

#mobileSidebar .collapse .nav-link.active {
  background: rgba(99, 102, 241, 0.3) !important;
  color: #fff !important;
}

#mobileSidebar .sidebar-online-users {
  background: rgba(255, 255, 255, 0.05) !important;
  border-radius: 8px !important;
  margin: 1rem !important;
  padding: 1rem !important;
}

#mobileSidebar .sidebar-online-users .badge {
  background: var(--success-color) !important;
  color: #fff !important;
}

#mobileSidebar .sidebar-online-users .text-success {
  color: var(--success-color) !important;
}

#mobileSidebar .sidebar-online-users .text-muted {
  color: #e0e0e0 !important;
}

/* Landscape mobile adjustments */
@media (max-width: 767.98px) and (orientation: landscape) {
  .mobile-hamburger {
    top: 0.5rem !important;
    left: 0.5rem !important;
    width: 44px !important;
    height: 44px !important;
  }

  .content-wrapper {
    padding-top: 3.5rem;
  }

  .top-navbar {
    margin-top: 3rem;
  }
}

/* Prevent horizontal scroll */
html,
body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .btn:hover {
    transform: none;
  }

  .nav-link:hover {
    transform: none;
  }

  .card:hover {
    transform: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .card,
  .login-card {
    border: 2px solid #000;
  }

  .btn-primary {
    background: #000 !important;
    color: #fff !important;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus improvements */
.btn:focus,
.nav-link:focus,
.form-control:focus,
.dropdown-item:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Tablo içindeki küçük butonlar için boyut düzeltme */
.table .btn,
.table .btn-sm,
.btn-group-sm > .btn {
  padding: 0.25rem 0.5rem !important;
  font-size: 0.85rem !important;
  min-height: 28px !important;
  border-radius: 6px !important;
}

/* --- index.php'den taşınan inline stiller --- */

/* Logo stilleri */
.company-logo {
  max-height: 60px;
}

.company-logo-sidebar {
  max-height: 25px;
}

/* Online kullanıcılar bölümü */
.online-users-header {
  font-size: 13px;
  color: #fff;
}

.online-users-icon {
  font-size: 10px;
}

.online-users-title {
  font-weight: 600;
  letter-spacing: 0.5px;
}

.online-users-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 8px;
}

.online-users-list {
  padding-left: 0;
}

.online-user-item {
  font-size: 13px;
  color: #e0e0e0;
}

.user-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #6366f1;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
}

.user-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90px;
  display: inline-block;
}

.no-online-users {
  font-size: 12px;
}
