/* ==========================================================================
   LEZZETCİM RESTORAN — ADMIN DASHBOARD STYLES
   ========================================================================== */

:root {
  --admin-bg: #f3f5f8;
  --admin-card-bg: #ffffff;
  --admin-sidebar-bg: #14171c;
  --admin-header-bg: #1a1e24;
  --admin-primary: #486720;
  --admin-primary-hover: #374e18;
  --admin-text-main: #1e242d;
  --admin-text-muted: #647082;
  --admin-border: #e2e7ee;
  --admin-danger: #d93838;
  --admin-success: #28a745;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--admin-bg);
  color: var(--admin-text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   LOGIN VIEW
   ========================================================================== */

.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, #222922 0%, #121418 100%);
  padding: 1.5rem;
}

.login-card {
  background-color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 20px 45px rgba(0,0,0,0.4);
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid var(--admin-primary);
  margin: 0 auto 0.75rem;
  background-color: #000;
}

.login-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #12151a;
  letter-spacing: 0.04em;
}

.login-sub {
  color: var(--admin-text-muted);
  font-size: 0.9rem;
}

.login-footer {
  margin-top: 1.75rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--admin-text-muted);
  border-top: 1px solid var(--admin-border);
  padding-top: 1.25rem;
}

.login-footer code {
  background: #eef2f6;
  padding: 2px 6px;
  border-radius: 4px;
  color: #111;
}

.login-back-link {
  color: var(--admin-primary);
  text-decoration: underline;
  display: inline-block;
  margin-top: 0.5rem;
  font-weight: 600;
}

/* Alert Error */
.alert-error {
  background-color: #fde8e8;
  border: 1px solid #f8b4b4;
  color: var(--admin-danger);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}

/* ==========================================================================
   DASHBOARD LAYOUT
   ========================================================================== */

.dashboard-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.dash-topbar {
  background-color: var(--admin-header-bg);
  color: #ffffff;
  padding: 0.75rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.dash-topbar-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.dash-topbar-logo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--admin-primary);
}

.dash-topbar-title {
  font-size: 1.1rem;
  font-weight: 800;
  display: block;
}

.dash-topbar-sub {
  font-size: 0.75rem;
  color: #9ba3af;
}

.dash-topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dash-main-layout {
  display: flex;
  flex-grow: 1;
}

.dash-sidebar {
  width: 250px;
  background-color: var(--admin-sidebar-bg);
  border-right: 1px solid rgba(255,255,255,0.06);
  padding: 1.5rem 0.75rem;
  flex-shrink: 0;
}

@media (max-width: 850px) {
  .dash-main-layout {
    flex-direction: column;
  }
  .dash-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 0.75rem;
    overflow-x: auto;
  }
  .dash-nav {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
  }
}

.dash-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.dash-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: none;
  border: none;
  color: #adb5bd;
  font-weight: 600;
  font-size: 0.92rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  white-space: nowrap;
}

.dash-nav-item:hover {
  background-color: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.dash-nav-item.active {
  background-color: var(--admin-primary);
  color: #ffffff;
}

.dash-content {
  flex-grow: 1;
  padding: 2rem;
  max-width: 1100px;
}

.dash-tab-pane {
  display: none;
}

.dash-tab-pane.active {
  display: block;
}

.dash-pane-header {
  margin-bottom: 1.75rem;
}

.dash-pane-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--admin-text-main);
  margin-bottom: 0.25rem;
}

.dash-pane-header p {
  color: var(--admin-text-muted);
  font-size: 0.9rem;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   CARDS & FORMS
   ========================================================================== */

.admin-card {
  background-color: var(--admin-card-bg);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 600px) {
  .form-grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: #2e3845;
  margin-bottom: 0.4rem;
}

.req {
  color: var(--admin-danger);
}

.field-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--admin-text-muted);
  margin-top: 0.25rem;
}

.admin-input, .admin-select, .admin-textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  color: var(--admin-text-main);
  background-color: #ffffff;
  transition: border-color 0.15s;
}

.admin-input:focus, .admin-select:focus, .admin-textarea:focus {
  outline: none;
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px rgba(72, 103, 32, 0.15);
}

/* Order Acceptance Toggle Box */
.order-toggle-box {
  background-color: #f8faf5;
  border: 1px solid #dce8ce;
  border-radius: var(--radius-md);
  padding: 1.15rem 1.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.order-toggle-text strong {
  display: block;
  font-size: 1rem;
  color: var(--admin-primary);
  margin-bottom: 0.2rem;
}

.order-toggle-text p {
  font-size: 0.85rem;
  color: var(--admin-text-muted);
  line-height: 1.35;
}

/* Switch Slider */
.switch-toggle {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}

.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #cbd5e1;
  border-radius: 34px;
  transition: 0.3s;
}

.switch-slider::before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s;
}

input:checked + .switch-slider {
  background-color: var(--admin-primary);
}

input:checked + .switch-slider::before {
  transform: translateX(24px);
}

/* Buttons */
.admin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
}

.admin-btn-primary {
  background-color: var(--admin-primary);
  color: #fff;
}

.admin-btn-primary:hover {
  background-color: var(--admin-primary-hover);
}

.admin-btn-outline {
  background-color: transparent;
  border-color: var(--admin-border);
  color: var(--admin-text-main);
}

.admin-btn-outline:hover {
  background-color: #edf2f7;
}

.admin-btn-danger {
  background-color: #fee2e2;
  border-color: #fca5a5;
  color: var(--admin-danger);
}

.admin-btn-danger:hover {
  background-color: var(--admin-danger);
  color: #fff;
}

.admin-btn-block {
  width: 100%;
}

.dash-btn {
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
}

.dash-btn-outline {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border-color: rgba(255,255,255,0.2);
}

.dash-btn-outline:hover {
  background: rgba(255,255,255,0.18);
}

.dash-btn-danger {
  background: #dc2626;
  color: #fff;
}

.dash-btn-danger:hover {
  background: #b91c1c;
}

/* ==========================================================================
   TABLES
   ========================================================================== */

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

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: left;
}

.admin-table th {
  background-color: #f8fafc;
  color: #475569;
  font-weight: 700;
  padding: 0.85rem 1rem;
  border-bottom: 2px solid var(--admin-border);
}

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

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

.prod-thumb {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background-color: #000;
}

.status-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

.status-badge.in-stock {
  background-color: #dcfce7;
  color: #15803d;
}

.status-badge.out-of-stock {
  background-color: #fee2e2;
  color: #b91c1c;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-icon {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  font-weight: 600;
}

.btn-icon:hover {
  background: #e2e8f0;
}

.products-filter-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}

.products-filter-row select {
  max-width: 250px;
}

/* ==========================================================================
   NEIGHBORHOODS MANAGEMENT
   ========================================================================== */

.add-neighborhood-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  max-width: 500px;
}

.neighborhoods-manage-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.neighborhood-manage-card {
  background-color: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.btn-remove-chip {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

/* ==========================================================================
   ORDERS LOG
   ========================================================================== */

.order-log-card {
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1rem;
  background-color: #fdfdfd;
}

.order-log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--admin-border);
  padding-bottom: 0.5rem;
}

.order-log-id {
  font-weight: 800;
  color: var(--admin-primary);
}

.order-log-date {
  font-size: 0.8rem;
  color: var(--admin-text-muted);
}

.order-log-customer {
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.order-log-items {
  background-color: #f8fafc;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.order-log-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 800;
  font-size: 1rem;
}

/* ==========================================================================
   IMAGE UPLOAD PREVIEW
   ========================================================================== */

.image-upload-preview-wrap {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 0.35rem;
}

.modal-img-preview {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--admin-border);
  background-color: #000;
  flex-shrink: 0;
}

.upload-controls {
  flex-grow: 1;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.checkbox-label input {
  width: 18px;
  height: 18px;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(0,0,0,0.6);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop.is-open {
  display: flex;
}

.modal-dialog {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 540px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: #64748b;
}

.modal-form {
  padding: 1.5rem;
}

.modal-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
  border-top: 1px solid var(--admin-border);
  padding-top: 1rem;
}

/* Toast */
.admin-toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background-color: #1e293b;
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  z-index: 1200;
  display: none;
}

.admin-toast.show {
  display: block;
  animation: fadeIn 0.2s;
}

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