/* Advanced Admin Styles */
:root {
  --admin-sidebar: #1e1e2d;
  --admin-accent: #6c5ce7;
  --admin-bg: #f4f5f7;
  --admin-card: #ffffff;
  --font-admin: 'Stack Sans Headline', 'Inter', system-ui, sans-serif;
}

.admin-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  position: fixed;
  top: 0;
  left: 0;
  background: var(--admin-bg);
  font-family: var(--font-admin);
  color: #333;
  z-index: 9999; /* Ensure it covers everything */
}

/* Hide global site elements ONLY when admin-layout is present */
body:has(.admin-layout) .navbar, 
body:has(.admin-layout) .footer, 
body:has(.admin-layout) #breadcrumb-bar {
  display: none !important;
}

.admin-layout * {
  font-family: var(--font-admin) !important;
}

/* Sidebar Refined */
.admin-sidebar {
  width: 240px;
  background: var(--admin-sidebar);
  color: #fff;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.admin-brand {
  padding: 32px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: 1px;
}

.logo-box {
  width: 32px;
  height: 32px;
  background: var(--admin-accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-nav {
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-label {
  font-size: 0.65rem;
  font-weight: 800;
  color: #4b4b5f;
  margin: 20px 16px 8px;
  letter-spacing: 1px;
}

.admin-nav-item {
  padding: 10px 16px;
  border-radius: 8px;
  color: #a2a3b7;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  transition: 0.2s;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  margin-bottom: 2px;
}

.admin-form-compact .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-form-compact label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #5e6278;
}

.admin-nav-item:hover, .admin-nav-item.active {
  background: rgba(255,255,255,0.05);
  color: #fff;
}

.admin-nav-item.active {
  background: var(--admin-accent);
  box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
}

/* Main Area */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-header {
  height: 70px;
  background: #fff;
  border-bottom: 1px solid #e1e3ea;
  padding: 0 32px;
}

.header-content {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-header h1 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e1e2d;
}

.admin-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
}

/* Stats */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 32px;
}

.stat-box {
  background: #fff;
  padding: 24px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

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

.stat-meta .label {
  font-size: 0.8rem;
  color: #7e8299;
  display: block;
}

.stat-meta .number {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1e1e2d;
}

/* Layout Grids */
.admin-grid-2 {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 24px;
}

.admin-panel-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.admin-panel-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.header-tools {
  display: flex;
  gap: 12px;
}

.admin-search-input {
  padding: 10px 16px 10px 40px;
  border-radius: 8px;
  border: 1px solid #e1e3ea;
  background: #f9f9f9 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%237e8299' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E") no-repeat 12px center;
  font-size: 0.9rem;
  color: #3f4254;
  width: 300px;
  transition: all 0.2s ease;
}

.admin-search-input:focus {
  border-color: var(--admin-accent);
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
  outline: none;
}

/* Forms Compact */
.admin-form-compact {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admin-form-compact input, .admin-form-compact select {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #e1e3ea;
  background: #f9f9f9;
  font-size: 0.9rem;
  color: #3f4254;
  transition: all 0.2s ease;
}

.admin-form-compact select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%237e8299' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

.admin-form-compact input:focus, .admin-form-compact select:focus {
  border-color: var(--admin-accent);
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
  outline: none;
}

/* Data Table */
.table-container {
  overflow-x: auto;
}

.admin-data-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-data-table th {
  text-align: left;
  padding: 16px;
  font-size: 0.8rem;
  color: #7e8299;
  border-bottom: 1px solid #f3f6f9;
}

.admin-data-table td {
  padding: 16px;
  border-bottom: 1px solid #f3f6f9;
}

.palette-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.p-name {
  font-weight: 700;
  color: #1e1e2d;
}

/* Admin Login — Full Screen Focus */
.admin-login-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000; /* Header'ın da üstünde */
  padding: 20px;
}
.login-card {
  background: var(--bg-card);
  padding: 48px 40px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 20px 80px rgba(0,0,0,0.15);
  animation: modalIn 0.4s ease;
}
.logo-box-lg {
  width: 72px;
  height: 72px;
  background: var(--gradient);
  border-radius: 20px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 10px 30px rgba(168,85,247,0.3);
}
.login-card h2 { font-size: 1.75rem; margin-bottom: 8px; font-weight: 800; }
.login-card p { margin-bottom: 32px; font-size: 0.95rem; color: var(--text-secondary); }
.login-card input {
  width: 100%;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  margin-bottom: 20px;
  font-size: 1.1rem;
  transition: var(--transition);
}
.password-field-wrapper {
  position: relative;
  width: 100%;
}
.password-field-wrapper input {
  padding-right: 50px; /* İkon için boşluk */
}
.password-toggle {
  position: absolute;
  right: 14px;
  top: 14px; /* input padding'i ile hizalı */
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.password-toggle:hover {
  color: var(--accent);
}
.login-options {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 24px;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-secondary);
  user-select: none;
}
.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.login-card input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-subtle); }
.login-card .back-link {
  display: inline-block;
  margin-top: 24px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: var(--transition);
}
.login-card .back-link:hover { color: var(--accent); }
.w-100 { width: 100%; }

.badge-database { background: #e1f0ff; color: #009ef7; padding: 2px 8px; border-radius: 4px; font-size: 0.7rem; font-weight: 700; width: fit-content; }
.badge-system { background: #f3f6f9; color: #7e8299; padding: 2px 8px; border-radius: 4px; font-size: 0.7rem; font-weight: 700; width: fit-content; }

.admin-palette-preview {
  display: flex;
  height: 30px;
  width: 150px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.05);
}

.admin-palette-preview div { flex: 1; }

.admin-tag {
  background: #f3f6f9;
  color: #3f4254;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  margin-right: 6px;
  margin-bottom: 4px;
  display: inline-block;
}

.admin-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 250px;
}

.admin-actions {
  display: flex;
  gap: 8px;
}

.btn-action {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: 0.2s;
}

.btn-action.approve { background: #c9f7f5; color: #1bc5bd; }
.btn-action.disapprove { background: #f3f6f9; color: #7e8299; }
.btn-action.delete { background: #ffe2e5; color: #f64e60; }

.btn-action:hover { opacity: 0.8; transform: translateY(-1px); }

.pending-row {
  background: #fff8dd;
}

/* Tag Input UI */
.tag-input-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  border: 1px solid #e1e3ea;
  background: #f9f9f9;
  border-radius: 8px;
  min-height: 46px;
}

.tag-chip {
  background: var(--admin-accent);
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 6px;
  animation: popIn 0.2s ease;
}

.tag-chip .remove {
  cursor: pointer;
  opacity: 0.7;
  font-size: 1.1rem;
  line-height: 1;
}

.tag-chip .remove:hover { opacity: 1; }

.tag-input-field {
  border: none !important;
  background: transparent !important;
  padding: 4px !important;
  flex: 1;
  min-width: 100px;
  outline: none;
  font-size: 0.85rem;
}

@keyframes popIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.admin-section { display: none; }
.admin-section.active { display: block; animation: fadeIn 0.3s ease; }

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