/* ==========================================================================
   LemonHaze STUDIO OS - Ultra-Modern Dark Violet/Cyberpunk Admin Theme
   Birebir Referans Tasarım (Lyrion Control Hub / Studio OS Estetiği)
   ========================================================================== */

:root {
  --os-bg: #09081e;
  --os-sidebar: #0f0e2b;
  --os-card: #15133d;
  --os-card-hover: #1c1a4e;
  --os-border: rgba(140, 110, 255, 0.16);
  --os-border-active: #00f2fe;

  --neon-cyan: #00f2fe;
  --neon-purple: #9d4edd;
  --neon-pink: #ff007f;
  --neon-green: #00f5a0;
  --neon-red: #ff3366;
  --neon-gold: #ffb703;

  --text-main: #f8fafc;
  --text-muted: #8b8aa8;
  --text-dim: #5f5d82;

  --font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  --radius-card: 16px;
  --radius-sm: 10px;
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.admin-body {
  background-color: var(--os-bg);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(157, 78, 221, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(0, 242, 254, 0.06) 0%, transparent 40%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  display: flex;
}

/* ---------------- Sol Sidebar ---------------- */
.admin-sidebar {
  width: 270px;
  background-color: var(--os-sidebar);
  border-right: 1px solid var(--os-border);
  min-height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  box-shadow: 4px 0 25px rgba(0, 0, 0, 0.4);
}

.brand-header-os {
  padding: 24px 22px;
  border-bottom: 1px solid var(--os-border);
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon-os {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #00f2fe 0%, #7b2cbf 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  font-size: 20px;
  font-weight: 900;
  box-shadow: 0 0 16px rgba(0, 242, 254, 0.35);
}

.brand-title-os {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  background: linear-gradient(90deg, #ffffff, #00f2fe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-sub-os {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-muted);
}

.sidebar-nav-os {
  padding: 18px 12px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-grow: 1;
  overflow-y: auto;
}

.sidebar-item-os a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 600;
  transition: var(--transition);
}

.sidebar-item-os a:hover {
  color: #ffffff;
  background: rgba(140, 110, 255, 0.1);
  transform: translateX(3px);
}

.sidebar-item-os.active a {
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid var(--neon-cyan);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(0, 242, 254, 0.2);
}

.sidebar-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-item-left i {
  font-size: 1.05rem;
  width: 20px;
  text-align: center;
  color: #a78bfa;
}

.sidebar-item-os.active .sidebar-item-left i {
  color: var(--neon-cyan);
}

.badge-pill-red {
  background-color: var(--neon-red);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(255, 51, 102, 0.5);
}

.badge-pill-green {
  background-color: rgba(0, 245, 160, 0.15);
  border: 1px solid var(--neon-green);
  color: var(--neon-green);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.badge-pill-green::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--neon-green);
  box-shadow: 0 0 6px var(--neon-green);
  display: inline-block;
  animation: pulseGreen 1.5s infinite;
}

@keyframes pulseGreen {
  0% { opacity: 0.4; }
  50% { opacity: 1; }
  100% { opacity: 0.4; }
}

/* ---------------- Ana İçerik Konteyneri ---------------- */
.admin-content-os {
  margin-left: 270px;
  flex-grow: 1;
  padding: 30px 36px;
  max-width: calc(100vw - 270px);
}

/* ---------------- Üst 4'lü İstatistik Kartları (Stat Bar) ---------------- */
.stats-grid-os {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 30px;
}

.stat-card-os {
  background: var(--os-card);
  border: 1px solid var(--os-border);
  border-radius: var(--radius-card);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.stat-card-os:hover {
  transform: translateY(-3px);
  border-color: rgba(140, 110, 255, 0.35);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

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

.icon-active {
  background: rgba(0, 245, 160, 0.12);
  color: var(--neon-green);
  border: 1px solid rgba(0, 245, 160, 0.25);
}

.icon-today {
  background: rgba(0, 180, 255, 0.12);
  color: #00b4ff;
  border: 1px solid rgba(0, 180, 255, 0.25);
}

.icon-total {
  background: rgba(0, 242, 254, 0.12);
  color: var(--neon-cyan);
  border: 1px solid rgba(0, 242, 254, 0.25);
}

.icon-device {
  background: rgba(157, 78, 221, 0.12);
  color: #b76eff;
  border: 1px solid rgba(157, 78, 221, 0.25);
}

.stat-title-os {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-value-os {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
}

/* ---------------- Tema & Görünüm Stüdyosu Tasarımı ---------------- */
.studio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.studio-title-box h1 {
  font-size: 2rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.studio-title-box p {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 800px;
  margin-bottom: 0;
}

.studio-actions-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-studio-action {
  background: var(--os-card);
  border: 1px solid var(--os-border);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-studio-action:hover {
  background: var(--os-card-hover);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  transform: translateY(-2px);
}

.alert-studio-success {
  background: rgba(0, 245, 160, 0.12);
  border: 1px solid rgba(0, 245, 160, 0.3);
  color: #a7f3d0;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 30px;
}

.studio-panel {
  background: var(--os-card);
  border: 1px solid var(--os-border);
  border-radius: var(--radius-card);
  padding: 28px;
  margin-bottom: 30px;
}

.studio-section-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.studio-section-subtitle {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 24px;
}

/* Hazır Tema Koleksiyonu Grid */
.themes-grid-os {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}

.theme-card-os {
  background: #0d0c24;
  border: 2px solid rgba(140, 110, 255, 0.2);
  border-radius: 14px;
  padding: 16px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.theme-card-os:hover {
  border-color: rgba(140, 110, 255, 0.5);
  transform: translateY(-3px);
  background: #11102e;
}

.theme-card-os.active {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.35);
  background: #121035;
}

.theme-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.theme-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
}

.theme-badge {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.badge-dark {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
}

.badge-light {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

.badge-gold {
  background: rgba(255, 183, 3, 0.2);
  border: 1px solid var(--neon-gold);
  color: var(--neon-gold);
}

.theme-swatches {
  display: flex;
  height: 42px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.swatch-box {
  flex: 1;
  height: 100%;
}

/* Tablolar & Form Elemanları */
.table-os {
  width: 100%;
  color: var(--text-main);
  border-collapse: collapse;
}

.table-os th {
  padding: 14px 16px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--os-border);
}

.table-os td {
  padding: 16px;
  border-bottom: 1px solid var(--os-border);
  vertical-align: middle;
}

.form-control-os, .form-select-os {
  background-color: #0d0c24 !important;
  border: 1px solid var(--os-border) !important;
  color: #ffffff !important;
  border-radius: var(--radius-sm) !important;
  padding: 10px 14px !important;
}

.form-control-os:focus, .form-select-os:focus {
  border-color: var(--neon-cyan) !important;
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.25) !important;
}

.admin-card {
  background: var(--os-card);
  border: 1px solid var(--os-border);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.table-dark-custom {
  --bs-table-bg: transparent;
  color: var(--text-main);
  border-color: var(--os-border);
}

.table-dark-custom th {
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--os-border);
}

.table-dark-custom td {
  vertical-align: middle;
  border-bottom: 1px solid var(--os-border);
}

.admin-mobile-topbar {
  position: sticky;
  top: 0;
  z-index: 1040;
  background: #0f0e2b;
  border-bottom: 1px solid rgba(140, 110, 255, 0.25);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.admin-sidebar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.admin-sidebar-backdrop.show {
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
}

@media (max-width: 991px) {
  html, body.admin-body {
    display: block !important;
    overflow-x: hidden !important;
    max-width: 100vw !important;
    position: relative !important;
  }
  .admin-sidebar {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 280px !important;
    max-width: 85vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 1060 !important;
    transform: translateX(-100%) !important;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-shadow: 10px 0 50px rgba(0, 0, 0, 0.9) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    background-color: #0f0e2b !important;
  }
  .admin-sidebar.open-mobile {
    transform: translateX(0) !important;
  }
  .admin-content-os {
    margin-left: 0 !important;
    max-width: 100vw !important;
    padding: 14px 12px !important;
    width: 100% !important;
    overflow-x: hidden !important;
    min-height: auto !important;
  }
  .stats-grid-os {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 16px !important;
  }
  .stat-card-os {
    padding: 10px 12px !important;
    gap: 10px !important;
    border-radius: 12px !important;
  }
  .stat-icon-wrapper-os {
    width: 36px !important;
    height: 36px !important;
    font-size: 1rem !important;
    border-radius: 8px !important;
    flex-shrink: 0;
  }
  .stat-title-os {
    font-size: 0.68rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .stat-value-os {
    font-size: 0.82rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .admin-card, .studio-panel {
    padding: 14px !important;
    border-radius: 12px !important;
    margin-bottom: 16px !important;
  }
  .themes-grid-os {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  .studio-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }
  .studio-title-box h1 {
    font-size: 1.35rem !important;
  }
  .studio-actions-box {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  .studio-actions-box .btn-studio-action {
    flex: 1 1 auto !important;
    justify-content: center !important;
    padding: 8px 12px !important;
    font-size: 0.8rem !important;
  }
  .table-responsive {
    -webkit-overflow-scrolling: touch !important;
    border-radius: 8px !important;
    border: 1px solid rgba(140, 110, 255, 0.12) !important;
  }
}

@media (max-width: 480px) {
  .stats-grid-os {
    grid-template-columns: 1fr 1fr !important;
  }
}

