:root {
  --bg-color: #f1f5f9;
  --sidebar-bg: #ffffff;
  --card-bg: #ffffff;
  --sidebar-width: 280px;
  --accent-color: #e11d48;
  /* Premium Crimson */
  --accent-soft: rgba(225, 29, 72, 0.08);
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --shadow-sm: 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);
  --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-color);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Outfit', 'Inter', sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-color);
  background-image:
    radial-gradient(at 0% 0%, rgba(225, 29, 72, 0.03) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(241, 245, 249, 1) 0px, transparent 50%);
  display: flex;
  min-height: 100vh;
  color: var(--text-main);
}

/* Sidebar Tasarımı */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  margin: 20px;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  padding: 35px 20px;
  box-shadow:
    var(--shadow-lg),
    0 0 5px rgba(225, 29, 72, 0.2),
    0 0 15px rgba(225, 29, 72, 0.1);
  /* Neo Layered Glow */
  border: 1.5px solid rgba(225, 29, 72, 0.8);
  /* Neo Crimson Frame */
  transition: var(--transition);
  position: fixed;
  /* FIXED SIDEBAR */
  height: calc(100vh - 40px);
  z-index: 1000;
  overflow: hidden;
  flex-shrink: 0;
}

/* Collapsed State */
body.sidebar-collapsed .sidebar {
  transform: translateX(-320px);
  opacity: 0;
  pointer-events: none;
}

.logo {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 40px;
  padding-left: 15px;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-main);
  white-space: nowrap;
}

.logo span {
  background: linear-gradient(135deg, #e11d48, #9f1239);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar nav {
  flex-grow: 1;
}

.sidebar nav ul {
  list-style: none;
}

.sidebar nav ul li {
  margin-bottom: 5px;
}

.sidebar nav ul li a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 14px;
  transition: var(--transition);
  white-space: nowrap;
}

.sidebar nav ul li.active a,
.sidebar nav ul li a:hover {
  background: var(--accent-soft);
  color: var(--accent-color);
}

/* İçerik Alanı */
.content {
  flex: 1;
  padding: 40px;
  margin-left: calc(var(--sidebar-width) + 40px);
  /* ADJUSTED MARGIN */
  display: flex;
  flex-direction: column;
  max-width: 1400px;
  width: 100%;
  transition: var(--transition);
}

body.sidebar-collapsed .content {
  margin-left: 0;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  position: sticky;
  top: 0;
  background: var(--bg-color);
  padding: 10px 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

#sidebar-toggle {
  background: #fff;
  border: 1px solid var(--border-color);
  width: 45px;
  height: 45px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-main);
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

#sidebar-toggle:hover {
  background: var(--accent-color);
  color: #fff;
  border-color: var(--accent-color);
}

header h1 {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

header p {
  color: var(--text-muted);
  font-size: 1rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 10px;
}

.card {
  background: var(--card-bg);
  padding: 28px;
  border-radius: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-color);
}



.card-icon {
  width: 48px;
  height: 48px;
  background: var(--accent-soft);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-color);
  margin-bottom: 18px;
}

.card-icon i {
  width: 24px;
  height: 24px;
}

.card-title {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 8px;
}

.card-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-main);
}

/* Footer */
footer {
  margin-top: auto;
  padding: 40px 0 20px 0;
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
}

footer a {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 600;
}

#theme-toggle {
  margin-top: 20px;
  padding: 12px;
  border: 1px solid var(--border-color);
  background: #fff;
  color: var(--text-main);
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

#theme-toggle:hover {
  background: var(--accent-color);
  color: #fff;
  border-color: var(--accent-color);
}

#theme-toggle {
  text-decoration: none;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 15px;
}

.user-profile span {
  color: var(--text-muted);
  font-weight: 500;
}

.avatar {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: var(--accent-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  box-shadow: 0 4px 12px var(--accent-soft);
}

.auth-page {
  display: block;
  overflow-x: hidden;
}

body.auth-page {
  display: block;
}

.auth-content {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}

.auth-shell {
  width: 100%;
  display: flex;
  justify-content: center;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  padding: 34px;
  animation: fadeInContent 0.8s ease-out;
}

.auth-card.wide {
  max-width: 760px;
}

.auth-brand {
  text-align: center;
  margin-bottom: 26px;
}

.auth-brand .card-icon {
  margin: 0 auto 16px;
}

.auth-brand h1 {
  font-size: 28px;
  margin-bottom: 10px;
}

.auth-brand p,
.auth-switch,
.muted-line,
.section-heading p {
  color: var(--text-muted);
}

.form-stack,
.form-grid {
  display: grid;
  gap: 18px;
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-stack label,
.form-grid label {
  display: grid;
  gap: 8px;
  font-weight: 600;
  color: var(--text-main);
}

.form-stack input,
.form-grid input {
  width: 100%;
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-color);
  color: var(--text-main);
  font-family: inherit;
  outline: none;
}

.form-stack input:focus,
.form-grid input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.primary-button,
.text-button {
  border: 0;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.primary-button {
  width: 100%;
  padding: 14px 18px;
  background: var(--accent-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.full-row {
  grid-column: 1 / -1;
}

.text-button {
  color: var(--accent-color);
  background: var(--accent-soft);
  padding: 10px 14px;
}

.auth-switch {
  text-align: center;
  margin-top: 22px;
}

.auth-switch a {
  color: var(--accent-color);
  font-weight: 700;
  text-decoration: none;
}

.alert {
  border-radius: 12px;
  padding: 13px 15px;
  margin-bottom: 18px;
  font-weight: 600;
}

.alert-success {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.alert-error {
  background: #fff1f2;
  color: #be123c;
  border: 1px solid #fecdd3;
}

.partner-strip,
.panel-section {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  box-shadow: var(--shadow-sm);
}

.partner-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 26px;
  margin-bottom: 24px;
}

.partner-strip span {
  display: block;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.partner-strip strong {
  font-size: 30px;
  letter-spacing: 1px;
}

.panel-section {
  margin-top: 26px;
  padding: 26px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.section-heading h2 {
  font-size: 22px;
  margin-bottom: 6px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

th {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

td strong,
td span {
  display: block;
}

td span {
  color: var(--text-muted);
  margin-top: 4px;
  font-size: 13px;
}

.status-pill {
  display: inline-flex;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-color);
  font-weight: 700;
  text-transform: capitalize;
}

.empty-state {
  text-align: center;
  padding: 36px 20px;
  color: var(--text-muted);
}

.empty-state i {
  color: var(--accent-color);
  width: 40px;
  height: 40px;
  margin-bottom: 12px;
}

.empty-state h3 {
  color: var(--text-main);
  margin-bottom: 8px;
}

/* Preloader */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(241, 245, 249, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.8s;
}

#preloader.loaded {
  opacity: 0;
  visibility: hidden;
}

.loader-icon {
  width: 90px;
  height: 90px;
  background: var(--accent-color);
  border-radius: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  animation: pulse-ring 2s infinite cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 15px 30px var(--accent-soft);
}

.loader-icon i {
  width: 45px;
  height: 45px;
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.5);
  }

  70% {
    transform: scale(1);
    box-shadow: 0 0 0 25px rgba(225, 29, 72, 0);
  }

  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(225, 29, 72, 0);
  }
}

/* Page Transitions */
.content {
  opacity: 0;
  transform: translateY(15px);
  animation: fadeInContent 1s forwards 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInContent {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* Mobile Responsive */
@media (max-width: 1024px) {
  body {
    flex-direction: column;
  }

  .sidebar {
    width: calc(100% - 40px);
    height: auto;
    margin: 20px;
    padding: 20px;
    flex-shrink: unset;
    position: relative;
    /* Unfix on mobile */
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  .content {
    margin-left: 0;
    padding: 20px;
  }

  body.sidebar-collapsed .sidebar {
    height: 0;
    margin: 0;
    padding: 0;
    display: none;
  }

  .sidebar nav ul {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 5px;
  }

  .sidebar nav ul li {
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .sidebar nav ul li a span {
    display: none;
  }

  .header-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    position: relative;
    padding: 20px 0;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .partner-strip,
  .section-heading {
    flex-direction: column;
    align-items: flex-start;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  header h1 {
    font-size: 26px;
  }
}