/* =========================================================
   Öncü Döner Afşin — Öncü Döner Afşin Styled Admin Panel CSS
   ========================================================= */

@font-face {
  font-family: 'OncuDisplay';
  src: url('../fonts/OncuDisplay.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --bg-main: #F4F1EA;
  --bg-card: #FFFFFF;
  --bg-dark: #160C08;
  --bg-sidebar: #1D100B;
  --primary: #C33130;
  --primary-dark: #9E2221;
  --gold: #FBBA00;
  --gold-light: #FFF5D6;
  --green: #00833E;
  --text-dark: #1E1D23;
  --text-muted: #64626A;
  --border: #E4DFD3;
  --font-display: 'OncuDisplay', 'Barlow Condensed', sans-serif;
  --font-condensed: 'Barlow Condensed', sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg-main);
  color: var(--text-dark);
  min-height: 100vh;
}

/* =========================================================
   LOGIN OVERLAY
   ========================================================= */
.admin-login-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(circle at 50% 25%, #3B1812 0%, #140906 75%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.admin-login-screen.is-hidden {
  display: none;
}

.login-card {
  width: min(430px, 100%);
  background: var(--bg-card);
  border-radius: 26px;
  border: 2px solid var(--gold);
  padding: 36px 30px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65);
  text-align: center;
}

.login-card img {
  width: 155px;
  margin-bottom: 12px;
}

.login-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(195, 49, 48, 0.1);
  color: var(--primary);
  font-family: var(--font-condensed);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.login-card h1 {
  font-family: var(--font-display);
  font-size: 34px;
  color: var(--text-dark);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.login-card p {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 22px;
}

.form-group {
  text-align: left;
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: #FAF8F4;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
  transition: all 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(195, 49, 48, 0.12);
}

.login-error {
  display: none;
  background: rgba(195, 49, 48, 0.1);
  color: var(--primary);
  border: 1px solid rgba(195, 49, 48, 0.3);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 14px;
}

.login-hint {
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--gold-light);
  border: 1px dashed var(--gold);
  font-size: 12.5px;
  color: var(--text-dark);
}

/* =========================================================
   ADMIN SHELL (SIDEBAR + MAIN CONTENT)
   ========================================================= */
.admin-layout {
  display: grid;
  grid-template-columns: 270px 1fr;
  min-height: 100vh;
}

.admin-sidebar {
  background: var(--bg-sidebar);
  color: #fff;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  padding: 22px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-brand img {
  width: 120px;
}

.sidebar-brand-tag {
  background: var(--primary);
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 3px 8px;
  border-radius: 6px;
  font-family: var(--font-condensed);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.sidebar-nav {
  padding: 18px 12px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.sidebar-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.sidebar-btn i {
  font-size: 18px;
  color: var(--gold);
}

.sidebar-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.sidebar-btn.is-active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 20px rgba(195, 49, 48, 0.35);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* =========================================================
   MAIN WORKSPACE & TOPBAR
   ========================================================= */
.admin-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.admin-topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-title h2 {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--text-dark);
  text-transform: uppercase;
  line-height: 1.1;
}

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

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 12px;
  border: none;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn--primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 6px 16px rgba(195, 49, 48, 0.25);
}
.btn--primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn--gold {
  background: var(--gold);
  color: #160C08;
}
.btn--gold:hover {
  background: #e5a900;
  transform: translateY(-1px);
}

.btn--green {
  background: var(--green);
  color: #fff;
}
.btn--green:hover {
  background: #006b32;
  transform: translateY(-1px);
}

.btn--outline {
  background: #fff;
  color: var(--text-dark);
  border: 1.5px solid var(--border);
}
.btn--outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn--danger {
  background: rgba(195, 49, 48, 0.1);
  color: var(--primary);
}
.btn--danger:hover {
  background: var(--primary);
  color: #fff;
}

.btn--sm {
  padding: 7px 12px;
  font-size: 12.5px;
  border-radius: 9px;
}

.admin-content {
  padding: 28px;
  flex: 1;
}

.admin-panel {
  display: none;
}
.admin-panel.is-active {
  display: block;
}

/* =========================================================
   STATS CARDS & BULK TOOLS
   ========================================================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

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

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.stat-icon--red { background: rgba(195, 49, 48, 0.12); color: var(--primary); }
.stat-icon--gold { background: rgba(251, 186, 0, 0.2); color: #B88600; }
.stat-icon--green { background: rgba(0, 131, 62, 0.12); color: var(--green); }
.stat-icon--dark { background: rgba(29, 16, 11, 0.1); color: var(--bg-sidebar); }

.stat-info span {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.stat-info strong {
  font-family: var(--font-condensed);
  font-size: 30px;
  font-weight: 900;
  color: var(--text-dark);
  line-height: 1.1;
}

.card-box {
  background: var(--bg-card);
  border-radius: 20px;
  border: 1px solid var(--border);
  padding: 22px;
  margin-bottom: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.03);
}

.card-box__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.card-box__title {
  font-family: var(--font-display);
  font-size: 24px;
  text-transform: uppercase;
  color: var(--text-dark);
}

/* =========================================================
   PRODUCTS TABLE & INLINE EDITING
   ========================================================= */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.filter-bar .form-control {
  max-width: 280px;
}

.table-responsive {
  overflow-x: auto;
}

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

.admin-table th {
  text-align: left;
  padding: 12px 14px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  background: #FAF8F3;
  border-bottom: 2px solid var(--border);
}

.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: 14px;
}

.admin-table tr:hover td {
  background: #FDFBF7;
}

.prod-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.prod-thumb {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
  border: 1.5px solid var(--border);
  background: #1a100c;
  flex-shrink: 0;
}

.prod-meta strong {
  display: block;
  font-size: 14.5px;
  color: var(--text-dark);
}

.prod-meta small {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inline-price-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.inline-price-input {
  width: 96px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  font-family: var(--font-condensed);
  font-size: 17px;
  font-weight: 800;
  color: var(--primary);
  text-align: center;
  background: #fff;
}

.inline-price-input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--gold-light);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-badge--active { background: rgba(0, 131, 62, 0.12); color: var(--green); }
.status-badge--soldout { background: rgba(251, 186, 0, 0.22); color: #996E00; }
.status-badge--hidden { background: rgba(100, 98, 106, 0.15); color: var(--text-muted); }

/* =========================================================
   MODAL DIALOGS
   ========================================================= */
.admin-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(16, 8, 5, 0.72);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.admin-modal-overlay.is-open {
  display: flex;
}

.admin-modal {
  width: min(620px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--bg-card);
  border-radius: 22px;
  border: 2px solid var(--gold);
  padding: 26px;
  box-shadow: 0 28px 75px rgba(0, 0, 0, 0.5);
}

.admin-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.admin-modal__head h3 {
  font-family: var(--font-display);
  font-size: 26px;
  text-transform: uppercase;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.img-preview-box {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: 14px;
  background: #FAF8F4;
  border: 1.5px dashed var(--border);
}

.img-preview-box img {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  object-fit: cover;
  background: #1a100c;
}

/* Toast Notification */
.admin-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  background: #160C08;
  color: #fff;
  border: 2px solid var(--gold);
  padding: 14px 20px;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  transform: translateY(120%);
  opacity: 0;
  transition: all 0.3s ease;
}

.admin-toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 992px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    position: relative;
    height: auto;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
}
