/* ==========================================================================
   PROLITE COMMUNICATION ADMIN PANEL - STYLESHEET
   Clean Corporate Dashboard with Fast Interactivity & High Productivity
   ========================================================================== */

:root {
  --admin-red: #e31e24;
  --admin-red-dark: #b9151a;
  --sidebar-bg: #0f172a;
  --sidebar-text: #94a3b8;
  --body-bg: #f8fafc;
  --card-bg: #ffffff;
  --border-color: #e2e8f0;
  --text-dark: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--body-bg);
  color: var(--text-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ----------------- LOGIN SCREEN ----------------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0b0f19 0%, #1e293b 100%);
  padding: 1.5rem;
}

.login-box {
  background-color: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  max-width: 440px;
  width: 100%;
  padding: 2.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

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

.login-logo h1 {
  font-size: 1.875rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.5px;
}

.login-logo h1 span {
  color: var(--admin-red);
}

.login-logo p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 4px;
}

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

.login-form label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.login-form input {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  font-size: 0.9375rem;
  outline: none;
  transition: all 0.2s ease;
}

.login-form input:focus {
  border-color: var(--admin-red);
  box-shadow: 0 0 0 3px rgba(227, 30, 36, 0.12);
}

.btn-login {
  width: 100%;
  padding: 11px;
  background-color: var(--admin-red);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: background 0.2s ease;
  margin-top: 0.5rem;
}

.btn-login:hover {
  background-color: var(--admin-red-dark);
}

.demo-credentials {
  background-color: #f1f5f9;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-top: 1.5rem;
  font-size: 0.8125rem;
}

.demo-credentials p {
  margin-bottom: 4px;
  color: var(--text-dark);
}

.demo-credentials code {
  background-color: #e2e8f0;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  color: var(--admin-red);
}

.btn-auto-fill {
  background: transparent;
  border: none;
  color: var(--admin-red);
  font-weight: 700;
  cursor: pointer;
  margin-top: 6px;
  display: inline-block;
  font-size: 0.8125rem;
}

/* ----------------- ADMIN DASHBOARD LAYOUT ----------------- */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
  width: 260px;
  background-color: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.2s ease;
}

.sidebar-header {
  height: 70px;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
}

.sidebar-brand span {
  color: var(--admin-red);
}

.sidebar-nav {
  padding: 1.5rem 0.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-heading {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 1px;
  padding: 0.75rem 0.75rem 0.25rem;
}

.sidebar-nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: #94a3b8;
  font-size: 0.875rem;
  font-weight: 600;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

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

.sidebar-nav-btn.active {
  background-color: var(--admin-red);
  color: #ffffff;
}

.sidebar-nav-btn i {
  font-size: 1rem;
  width: 20px;
  text-align: center;
}

.sidebar-nav-btn .badge-count {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 0.75rem;
  padding: 2px 7px;
  border-radius: 10px;
}

.sidebar-footer {
  padding: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--admin-red);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
}

.admin-user-name {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #ffffff;
}

.admin-user-role {
  font-size: 0.6875rem;
  color: #64748b;
}

.btn-logout {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
}

.btn-logout:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

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

.admin-topbar {
  height: 70px;
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-title h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-dark);
}

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

.btn-view-site {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background-color: #f1f5f9;
  color: #334155;
  font-size: 0.8125rem;
  font-weight: 600;
  border: 1px solid var(--border-color);
  transition: all 0.15s ease;
}

.btn-view-site:hover {
  background-color: var(--text-dark);
  color: #ffffff;
}

/* Page Body */
.admin-body {
  padding: 2rem;
  flex: 1;
}

.tab-pane {
  display: none;
}

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

/* ----------------- DASHBOARD CARDS ----------------- */
.stats-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 2rem;
}

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

.stat-card-info p {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card-info h3 {
  font-size: 1.875rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-top: 4px;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

.stat-icon.red { background: rgba(227, 30, 36, 0.1); color: var(--admin-red); }
.stat-icon.blue { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.stat-icon.green { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.stat-icon.amber { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }

/* ----------------- DATA TABLE CONTAINER ----------------- */
.data-panel {
  background-color: var(--card-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

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

.panel-filters {
  display: flex;
  gap: 12px;
  align-items: center;
}

.panel-filters input, .panel-filters select {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  font-size: 0.875rem;
  outline: none;
}

.panel-filters input:focus, .panel-filters select:focus {
  border-color: var(--admin-red);
}

.btn-admin-add {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background-color: var(--admin-red);
  color: #ffffff;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.875rem;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-admin-add:hover {
  background-color: var(--admin-red-dark);
}

.data-table-wrap {
  overflow-x: auto;
}

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

.data-table th {
  background-color: #f8fafc;
  padding: 12px 18px;
  font-weight: 700;
  color: var(--text-dark);
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.data-table tr:hover {
  background-color: #f8fafc;
}

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

.table-prod-cell img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: #f1f5f9;
}

.table-prod-details h4 {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-dark);
}

.table-prod-details p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.badge-status {
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
}

.status-new { background: #dbeafe; color: #1e40af; }
.status-progress { background: #fef3c7; color: #92400e; }
.status-resolved { background: #d1fae5; color: #065f46; }
.status-active { background: #d1fae5; color: #065f46; }

.table-actions {
  display: flex;
  gap: 6px;
}

.btn-tbl-action {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: var(--text-body);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-tbl-action:hover {
  background-color: #f1f5f9;
  color: var(--admin-red);
}

.btn-tbl-action.delete:hover {
  background-color: #fee2e2;
  color: #ef4444;
  border-color: #fca5a5;
}

/* ----------------- MODAL FORMS ----------------- */
.admin-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

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

.admin-modal {
  background-color: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 760px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

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

.admin-modal-head h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-dark);
}

.admin-modal-body {
  padding: 1.75rem;
  overflow-y: auto;
  flex: 1;
}

.admin-modal-foot {
  padding: 1rem 1.75rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background-color: #f8fafc;
}

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

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

.form-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  font-size: 0.875rem;
  outline: none;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--admin-red);
  box-shadow: 0 0 0 3px rgba(227, 30, 36, 0.1);
}

.form-help {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Upload Dropzone Preview */
.upload-preview-box {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-top: 8px;
}

.upload-preview-img {
  width: 70px;
  height: 70px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border-color);
  background-color: #f1f5f9;
}

/* Dynamic Key Value Specs list */
.dynamic-row {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}

.dynamic-row input {
  flex: 1;
}

.btn-remove-row {
  background: transparent;
  border: 1px solid #fee2e2;
  color: #ef4444;
  border-radius: var(--radius-sm);
  width: 36px;
  cursor: pointer;
}

/* Toast */
.admin-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background-color: #0f172a;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  border-left: 4px solid var(--admin-red);
  z-index: 3000;
}

/* ==========================================================================
   MOBILE & MULTI-DEVICE RESPONSIVE STYLES FOR ADMIN PANEL
   ========================================================================== */

.mobile-sidebar-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-dark);
  font-size: 1.15rem;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mobile-sidebar-toggle:hover {
  background-color: #f1f5f9;
}

.mobile-sidebar-close {
  display: none;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
}

.mobile-sidebar-close:hover {
  color: #ffffff;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
  z-index: 1040;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.sidebar-backdrop.show {
  display: block;
  opacity: 1;
}

/* Laptops & Tablets (<= 1024px) */
@media (max-width: 1024px) {
  .mobile-sidebar-toggle {
    display: inline-flex;
  }

  .mobile-sidebar-close {
    display: inline-block;
  }

  .admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1050;
    transform: translateX(-100%);
    box-shadow: 10px 0 25px rgba(0, 0, 0, 0.35);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .admin-sidebar.open {
    transform: translateX(0);
  }

  .admin-main {
    width: 100%;
    min-width: 0;
  }

  .stats-cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .admin-body {
    padding: 1.5rem;
  }

  .form-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile Screens (<= 768px) */
@media (max-width: 768px) {
  .admin-topbar {
    padding: 0 1rem;
    height: 60px;
  }

  .topbar-title h2 {
    font-size: 1.05rem;
  }

  .topbar-actions .btn-view-site span,
  .topbar-actions .btn-admin-add span {
    display: none;
  }

  .btn-view-site {
    padding: 7px 10px;
  }

  .btn-admin-add {
    padding: 8px 12px;
  }

  .admin-body {
    padding: 1rem;
  }

  .stats-cards-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .stat-card {
    padding: 1rem;
  }

  .stat-card-info h3 {
    font-size: 1.5rem;
  }

  .stat-icon {
    width: 44px;
    height: 44px;
    font-size: 1.15rem;
  }

  .panel-header {
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    gap: 10px;
  }

  .panel-filters {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .panel-filters input, .panel-filters select {
    width: 100%;
  }

  .form-grid-2, .form-grid-3 {
    grid-template-columns: 1fr !important;
  }

  .admin-modal-box {
    width: 95% !important;
    max-width: 95% !important;
    max-height: 92vh;
    padding: 1.25rem !important;
  }

  .login-box {
    padding: 1.75rem 1.25rem;
  }

  .login-logo h1 {
    font-size: 1.5rem;
  }

  .data-table-wrap {
    -webkit-overflow-scrolling: touch;
  }

  .data-table th, .data-table td {
    padding: 10px 12px;
    font-size: 0.8125rem;
    white-space: nowrap;
  }

  .table-prod-cell {
    gap: 8px;
  }

  .table-prod-cell img {
    width: 36px;
    height: 36px;
  }

  .admin-toast {
    left: 16px;
    right: 16px;
    bottom: 16px;
    text-align: center;
  }
}

/* Small Mobile (<= 480px) */
@media (max-width: 480px) {
  .admin-sidebar {
    width: 82vw;
  }

  .topbar-title h2 {
    font-size: 0.95rem;
    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

