/* ========================================
   BIZOMAX TILES — Admin Panel Styles
   ======================================== */

/* ── Admin Login ── */
.admin-login-page {
  display: flex;
  min-height: 100vh;
}

.admin-login-left {
  width: 50%;
  background: var(--primary);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px;
  overflow: hidden;
}

.admin-login-left::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('https://images.unsplash.com/photo-1615971677499-5467cbab01c0?w=800');
  background-size: cover;
  opacity: 0.12;
}

.admin-login-left > * {
  position: relative;
  z-index: 2;
}

.admin-logo-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 20px;
}

.admin-login-left h1 {
  color: var(--accent);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.admin-login-left .divider {
  width: 60px;
  height: 2px;
  background: var(--accent);
  margin-bottom: 16px;
}

.admin-login-left h2 {
  color: var(--white);
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 24px;
}

.admin-features li {
  color: rgba(255,255,255,0.8);
  font-size: 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-features li span {
  color: var(--accent);
}

.floating-tile {
  position: absolute;
  width: 30px;
  height: 30px;
  border: 2px solid rgba(201,168,76,0.2);
  border-radius: 4px;
  animation: floatTile 6s infinite;
}

.floating-tile:nth-child(1) { top: 10%; left: 10%; animation-delay: 0s; }
.floating-tile:nth-child(2) { top: 20%; right: 15%; animation-delay: 1s; width: 20px; height: 20px; }
.floating-tile:nth-child(3) { bottom: 15%; left: 20%; animation-delay: 2s; width: 25px; height: 25px; }
.floating-tile:nth-child(4) { bottom: 25%; right: 10%; animation-delay: 3s; }

.admin-login-right {
  width: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  background: var(--white);
}

.login-card {
  width: 100%;
  max-width: 420px;
}

.login-card h1 {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.login-card .subtitle {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 24px;
}

.login-card .gold-line {
  width: 60px;
  height: 2px;
  background: var(--accent);
  margin-bottom: 30px;
}

.input-group {
  position: relative;
  margin-bottom: 20px;
}

.input-group .icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-lighter);
  font-size: 16px;
}

.input-group input {
  width: 100%;
  padding: 14px 14px 14px 42px;
  border: 1px solid var(--border-gray);
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.3s;
}

.input-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.1);
}

.input-group .toggle-pass {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-lighter);
  cursor: pointer;
  font-size: 16px;
}

.remember-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

.remember-row input {
  accent-color: var(--accent);
}

.remember-row label {
  font-size: 13px;
  color: var(--text-light);
}

.btn-login {
  width: 100%;
  padding: 16px;
  background: var(--accent);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-login:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(201,168,76,0.3);
}

.login-hint {
  text-align: center;
  font-size: 12px;
  color: var(--text-lighter);
  margin-top: 16px;
}

.login-error {
  display: none;
  background: #fee;
  color: #e74c3c;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  border: 1px solid #fcc;
}

.login-error.show {
  display: block;
}

.login-success-overlay {
  position: fixed;
  inset: 0;
  background: var(--accent);
  z-index: 100000;
  display: none;
}

.login-success-overlay.show {
  display: block;
  animation: goldSweep 0.6s ease forwards;
}

@media (max-width: 768px) {
  .admin-login-page { flex-direction: column; }
  .admin-login-left { width: 100%; min-height: 40vh; padding: 40px; }
  .admin-login-right { width: 100%; padding: 40px 20px; }
}

/* ── Admin Dashboard ── */
.admin-dashboard {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
  width: 240px;
  background: var(--white);
  box-shadow: 2px 0 15px rgba(0,0,0,0.08);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px dashed var(--accent);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo .logo-circle {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 800;
  font-size: 16px;
}

.sidebar-logo span {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
}

.sidebar-admin {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
}

.admin-avatar {
  width: 44px;
  height: 44px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 700;
  font-size: 18px;
}

.admin-info {
  font-size: 13px;
}

.admin-info strong {
  display: block;
  color: var(--primary);
  font-weight: 600;
}

.admin-info .clock {
  color: var(--text-lighter);
  font-size: 11px;
}

/* Nav Items */
.sidebar-nav {
  flex: 1;
  padding: 10px 0;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.sidebar-nav-item:hover {
  border-left-color: var(--accent);
  color: var(--accent);
  background: rgba(201,168,76,0.05);
}

.sidebar-nav-item.active {
  background: var(--accent);
  color: var(--white);
  border-left-color: var(--accent-dark);
}

.sidebar-nav-item .icon {
  width: 20px;
  text-align: center;
}

.sidebar-separator {
  height: 1px;
  background: var(--border-gray);
  margin: 8px 20px;
}

.sidebar-nav-item.view-site {
  color: var(--accent);
}

.sidebar-nav-item.logout {
  color: #e74c3c;
}

/* Main Content */
.admin-main {
  margin-left: 240px;
  flex: 1;
  background: var(--light-gray);
  min-height: 100vh;
}

.admin-header {
  height: 65px;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

.admin-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

.admin-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-badge {
  padding: 4px 12px;
  background: rgba(201,168,76,0.1);
  color: var(--accent);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.header-clock {
  font-size: 13px;
  color: var(--text-light);
}

.notification-bell {
  position: relative;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-light);
}

.notification-bell .badge-count {
  position: absolute;
  top: -4px;
  right: -6px;
  background: #e74c3c;
  color: var(--white);
  font-size: 9px;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Admin Sections */
.admin-section {
  padding: 30px;
  display: none;
}

.admin-section.active {
  display: block;
}

/* Stat Cards */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--white);
  padding: 24px;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 12px;
}

.stat-card .stat-icon.blue { background: rgba(52,152,219,0.1); }
.stat-card .stat-icon.orange { background: rgba(230,126,34,0.1); }
.stat-card .stat-icon.red { background: rgba(231,76,60,0.1); }
.stat-card .stat-icon.gold { background: rgba(201,168,76,0.1); }

.stat-card .stat-number {
  font-size: 32px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.stat-card .stat-label {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 4px;
}

.stat-card .stat-sub {
  font-size: 11px;
  color: var(--text-lighter);
  margin-top: 4px;
}

/* Tables */
.admin-table {
  width: 100%;
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

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

.admin-table th {
  background: var(--light-gray);
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
}

.admin-table td {
  padding: 12px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-gray);
  color: var(--text);
}

.admin-table tr:hover td {
  background: rgba(201,168,76,0.03);
}

.admin-table .thumb {
  width: 50px;
  height: 50px;
  border-radius: 6px;
  object-fit: cover;
}

.admin-table .btn-action {
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.btn-edit {
  background: rgba(52,152,219,0.1);
  color: #3498db;
}

.btn-edit:hover {
  background: #3498db;
  color: var(--white);
}

.btn-delete {
  background: rgba(231,76,60,0.1);
  color: #e74c3c;
}

.btn-delete:hover {
  background: #e74c3c;
  color: var(--white);
}

/* Quick Actions */
.quick-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.quick-action-btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  border: 1px solid var(--border-gray);
  background: var(--white);
  color: var(--primary);
}

.quick-action-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.quick-action-btn.primary {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
}

.quick-action-btn.primary:hover {
  background: var(--accent-dark);
}

/* Bar Chart */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 200px;
  padding: 20px;
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  margin-top: 24px;
}

.bar-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.bar {
  width: 100%;
  max-width: 40px;
  background: var(--accent);
  border-radius: 4px 4px 0 0;
  transition: height 0.5s ease;
  position: relative;
  cursor: pointer;
}

.bar:hover {
  background: var(--accent-dark);
}

.bar-label {
  font-size: 11px;
  color: var(--text-lighter);
  margin-top: 8px;
}

.bar-value {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 4px;
}

/* Product Form */
.product-form {
  background: var(--white);
  padding: 30px;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  display: none;
}

.product-form.show {
  display: block;
}

.product-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.product-form .form-group {
  margin-bottom: 0;
}

.product-form .image-upload {
  border: 2px dashed var(--border-gray);
  border-radius: 8px;
  padding: 30px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
}

.product-form .image-upload:hover {
  border-color: var(--accent);
}

.product-form .image-upload p {
  font-size: 13px;
  color: var(--text-lighter);
}

.product-form .image-preview {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
  margin-top: 12px;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

/* Settings Tabs */
.settings-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--border-gray);
  flex-wrap: wrap;
}

.settings-tab {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  border: none;
  background: none;
  position: relative;
  transition: color 0.3s;
}

.settings-tab::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s;
}

.settings-tab.active {
  color: var(--accent);
}

.settings-tab.active::after {
  width: 100%;
}

.settings-panel {
  display: none;
  background: var(--white);
  padding: 30px;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.settings-panel.active {
  display: block;
}

/* Status badge */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.status-new { background: #fee; color: #e74c3c; }
.status-read { background: #eef; color: #3498db; }
.status-replied { background: #efe; color: #27ae60; }

/* Filter tabs */
.filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-gray);
  background: var(--white);
  color: var(--text);
  transition: all 0.2s;
}

.filter-tab.active, .filter-tab:hover {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
}

/* Confirmation Modal */
.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0,0,0,0.6);
  display: none;
  align-items: center;
  justify-content: center;
}

.confirm-modal.show {
  display: flex;
}

.confirm-modal-card {
  background: var(--white);
  padding: 30px;
  border-radius: 12px;
  max-width: 400px;
  width: 90%;
  text-align: center;
}

.confirm-modal-card h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
}

.confirm-modal-card p {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 24px;
}

.confirm-modal-card .btn-row {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* Catalogue Upload */
.upload-zone {
  border: 2px dashed var(--accent);
  border-radius: 12px;
  padding: 60px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  background: rgba(201,168,76,0.03);
}

.upload-zone:hover {
  background: rgba(201,168,76,0.08);
}

.upload-zone .icon {
  font-size: 48px;
  color: var(--accent);
  margin-bottom: 12px;
}

.upload-zone p {
  font-size: 14px;
  color: var(--text-light);
}

/* Pagination */
.pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 24px;
}

.page-btn {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: 1px solid var(--border-gray);
  background: var(--white);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.page-btn.active, .page-btn:hover {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
  display: inline-block;
}

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #ccc;
  border-radius: 26px;
  transition: 0.3s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: var(--white);
  border-radius: 50%;
  transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
}

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

/* Danger Zone */
.danger-zone {
  border: 2px solid #e74c3c;
  border-radius: 12px;
  padding: 24px;
  margin-top: 30px;
}

.danger-zone h4 {
  color: #e74c3c;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
}

.btn-danger {
  padding: 10px 20px;
  background: #e74c3c;
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  margin-right: 12px;
}

.btn-danger:hover {
  background: #c0392b;
}

/* Mobile sidebar */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 18px;
  left: 16px;
  z-index: 1001;
  background: var(--accent);
  color: var(--white);
  border: none;
  border-radius: 8px;
  width: 40px;
  height: 40px;
  font-size: 20px;
  cursor: pointer;
}

/* ── Website Editor ── */
.we-images-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px;
}
.we-img-card {
  background: #fff; border: 1px solid var(--border-gray); border-radius: 10px;
  overflow: hidden; transition: box-shadow 0.3s;
}
.we-img-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.1); }
.we-img-card .we-img-preview {
  width: 100%; height: 160px; object-fit: cover; display: block; background: #f0f0f0;
}
.we-img-card .we-img-body { padding: 12px; }
.we-img-card .we-img-label {
  font-size: 12px; font-weight: 600; color: var(--accent); text-transform: uppercase;
  letter-spacing: 0.05em; margin-bottom: 8px; display: block;
}
.we-img-card .we-img-input {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border-gray); border-radius: 6px;
  font-size: 12px; margin-bottom: 8px; outline: none; transition: border 0.3s;
}
.we-img-card .we-img-input:focus { border-color: var(--accent); }
.we-img-card .we-img-save {
  padding: 6px 14px; background: var(--accent); color: #fff; border: none; border-radius: 4px;
  font-size: 12px; font-weight: 600; cursor: pointer; transition: background 0.3s;
}
.we-img-card .we-img-save:hover { background: var(--accent-dark); }

.we-content-list { display: flex; flex-direction: column; gap: 16px; }
.we-content-item {
  background: #fff; border: 1px solid var(--border-gray); border-radius: 10px; padding: 16px;
}
.we-content-item label {
  font-size: 12px; font-weight: 600; color: var(--accent); text-transform: uppercase;
  letter-spacing: 0.05em; margin-bottom: 8px; display: block;
}
.we-content-item input,
.we-content-item textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border-gray); border-radius: 6px;
  font-size: 14px; outline: none; transition: border 0.3s; font-family: inherit;
}
.we-content-item input:focus,
.we-content-item textarea:focus { border-color: var(--accent); }


@media (max-width: 768px) {
  .admin-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s;
  }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .sidebar-toggle { display: flex; align-items: center; justify-content: center; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .product-form .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .stat-cards { grid-template-columns: 1fr; }
}
