/* ==========================================================================
   italianartdecor - Admin Dashboard Stylesheet
   Clean, Modern, Intuitive Turkish Management Panel
   Touch-First & Mobile-Responsive Architecture per /mobile-design & /ui-ux-pro-max
   ========================================================================== */

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

:root {
  --admin-bg: #0f0e0c;
  --admin-sidebar: #171513;
  --admin-card: #1f1c18;
  --admin-card-hover: #26221e;
  --admin-border: rgba(255, 255, 255, 0.08);
  --admin-border-focus: rgba(212, 175, 55, 0.5);
  --admin-gold: #d4af37;
  --admin-text-main: #faf8f5;
  --admin-text-muted: #a19d95;
  --admin-danger: #ef4444;
  --admin-success: #22c55e;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body.admin-body {
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
  background-color: var(--admin-bg);
  color: var(--admin-text-main);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  touch-action: manipulation;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Layout Wrapper */
.admin-wrapper {
  display: flex;
  width: 100%;
  min-height: 100vh;
  position: relative;
}

/* Mobile Sidebar Backdrop */
.admin-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.admin-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* Sidebar */
.admin-sidebar {
  width: 260px;
  background-color: var(--admin-sidebar);
  border-right: 1px solid var(--admin-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1200;
}

.admin-sidebar-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-sidebar-logo {
  height: 40px;
  width: auto;
  border-radius: 6px;
  background: #fff;
  padding: 2px;
}

.admin-sidebar-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-sidebar-subtitle {
  font-size: 0.72rem;
  color: var(--admin-gold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.admin-sidebar-close {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  margin-left: auto;
  transition: all 0.2s;
}

.admin-sidebar-close:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--admin-gold);
  color: var(--admin-gold);
}

.admin-nav {
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  overflow-y: auto;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  min-height: 46px;
  border-radius: 8px;
  color: var(--admin-text-muted);
  font-weight: 600;
  font-size: 0.92rem;
  transition: all 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
}

.admin-nav-item:active {
  transform: scale(0.98);
}

.admin-nav-item:hover,
.admin-nav-item.active {
  color: #fff;
  background-color: rgba(212, 175, 55, 0.12);
}

.admin-nav-item.active {
  color: var(--admin-gold);
  border-left: 3px solid var(--admin-gold);
  border-radius: 0 8px 8px 0;
}

.admin-nav-svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.admin-badge-count {
  margin-left: auto;
  background-color: var(--admin-gold);
  color: #000;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
}

.admin-sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--admin-border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Main Content Area */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-y: auto;
}

.admin-topbar {
  height: 64px;
  background-color: var(--admin-sidebar);
  border-bottom: 1px solid var(--admin-border);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-shrink: 0;
}

/* Mobile Toggle in Topbar */
.admin-mobile-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
}

.admin-mobile-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--admin-gold);
}

.admin-mobile-toggle:active {
  transform: scale(0.95);
}

.admin-content {
  padding: 2rem;
  flex: 1;
}

/* Stat Cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background-color: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-value {
  font-size: 2.2rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  margin-top: 0.4rem;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--admin-text-muted);
  font-weight: 600;
}

.stat-icon {
  font-size: 2rem;
  color: var(--admin-gold);
}

/* Table Design */
.admin-card-box {
  background-color: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: 14px;
  padding: 1.75rem;
  margin-bottom: 2rem;
}

.admin-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.admin-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-left: -0.5rem;
  margin-right: -0.5rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.92rem;
  min-width: 540px;
}

.admin-table th {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--admin-border);
  color: var(--admin-text-muted);
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.admin-table td {
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.admin-table tr:hover td {
  background-color: rgba(255, 255, 255, 0.02);
}

/* Badges */
.badge-status {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-unread {
  background-color: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-read {
  background-color: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

/* Forms in Admin */
.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.admin-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--admin-text-main);
  margin-bottom: 0.4rem;
}

.admin-input,
.admin-select,
.admin-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: #12100e;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  color: #fff;
  font-size: 1rem; /* 16px minimum to eliminate iOS Safari viewport auto-zoom */
  transition: border-color 0.2s, box-shadow 0.2s;
}

.admin-input,
.admin-select {
  min-height: 48px;
}

.admin-input:focus,
.admin-select:focus,
.admin-textarea:focus {
  outline: none;
  border-color: var(--admin-gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

/* Action Buttons */
.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 0.9rem;
  min-height: 40px;
  min-width: 40px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
}

.btn-action:active {
  transform: scale(0.96);
}

.btn-action-primary {
  background-color: rgba(212, 175, 55, 0.15);
  color: var(--admin-gold);
  border-color: rgba(212, 175, 55, 0.3);
}

.btn-action-primary:hover {
  background-color: var(--admin-gold);
  color: #000;
}

.btn-action-danger {
  background-color: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-action-danger:hover {
  background-color: #ef4444;
  color: #fff;
}

.btn-action-whatsapp {
  background-color: rgba(37, 211, 102, 0.15);
  color: #25d366;
  border-color: rgba(37, 211, 102, 0.3);
}

.btn-action-whatsapp:hover {
  background-color: #25d366;
  color: #fff;
}

/* Login Card */
.admin-login-wrapper {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: radial-gradient(circle at top, #1c1815 0%, #0c0a09 100%);
}

.admin-login-box {
  width: 100%;
  max-width: 440px;
  background-color: var(--admin-card);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7);
}

@media (max-width: 480px) {
  .admin-login-box {
    padding: 1.75rem 1.25rem;
  }
}

/* ==========================================================================
   Responsive Media Queries (< 992px & < 640px)
   ========================================================================== */
@media (max-width: 992px) {
  .admin-sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    height: 100dvh;
    box-shadow: 10px 0 35px rgba(0, 0, 0, 0.85);
  }

  .admin-sidebar.mobile-open {
    left: 0;
  }

  .admin-sidebar-close {
    display: inline-flex;
  }

  .admin-mobile-toggle {
    display: inline-flex;
  }

  .admin-topbar {
    padding: 0 1rem;
    height: 60px;
  }

  .admin-content {
    padding: 1.25rem 1rem;
  }

  .admin-user-info {
    display: none;
  }
}

@media (max-width: 640px) {
  .admin-card-box {
    padding: 1.25rem 1rem;
    border-radius: 10px;
  }

  .stat-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .stat-card {
    padding: 1.25rem;
  }

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