.admin-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #f4f4f4;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.login-card {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.password-container {
  position: relative;
  margin: 1rem 0;
}

.password-container input {
  width: 100%;
  padding: 12px;
  padding-right: 40px;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-sizing: border-box;
}

.password-container i {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #666;
}

#loginBtn {
  width: 100%;
  padding: 12px;
  background: #000;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}

.error-msg {
  color: #e74c3c;
  margin-top: 1rem;
  font-size: 0.9rem;
}

.admin-nav {
  background: #000;
  color: white;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.admin-nav-brand {
  font-weight: 800;
  font-size: 1.2rem;
}

.nav-btn {
  background: transparent;
  border: none;
  color: #aaa;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-weight: 600;
  transition: color 0.3s;
}

.nav-btn.active, .nav-btn:hover {
  color: white;
}

.nav-btn.logout {
  color: #e74c3c;
  margin-left: 1rem;
}

.admin-main {
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.tab-content {
  display: none;
}

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

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

.btn-primary {
  background: #000;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
}

.btn-primary:hover {
  background: #333;
}

.admin-table-container {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  overflow-x: auto;
}

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

th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid #eee;
}

th {
  background: #f9f9f9;
  font-weight: 700;
}

.admin-img-preview {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 4px;
}

.action-btns {
  display: flex;
  gap: 0.5rem;
}

.btn-edit {
  color: #3498db;
  cursor: pointer;
}

.btn-delete {
  color: #e74c3c;
  cursor: pointer;
}

.btn-view {
  color: #27ae60;
  cursor: pointer;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.order-details-modal {
  max-width: 800px;
}

.close-modal {
  position: absolute;
  right: 1.5rem;
  top: 1rem;
  font-size: 1.5rem;
  cursor: pointer;
}

.admin-form .form-group {
  margin-bottom: 1.2rem;
}

.admin-form label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.admin-form input, .admin-form select, .admin-form textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-sizing: border-box;
}

.admin-form textarea {
  height: 100px;
}

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

/* Dropzone & Gallery Styles */
.dropzone {
  border: 2px dashed #ddd;
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.3s, background 0.3s;
  margin-bottom: 1rem;
  position: relative;
}

.dropzone:hover, .dropzone.dragover {
  border-color: #000;
  background: #f9f9f9;
}

.dropzone i {
  font-size: 2rem;
  color: #aaa;
  margin-bottom: 0.5rem;
}

.dropzone p {
  margin: 0;
  color: #666;
}

.upload-spinner {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.upload-spinner i {
  font-size: 2rem;
  color: #000;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.image-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.preview-item {
  position: relative;
  width: 80px;
  height: 80px;
}

.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #eee;
}

.preview-item .remove-img {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #e74c3c;
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 2px solid white;
}

.gallery-management {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #eee;
}

.gallery-item-row {
  display: grid;
  grid-template-columns: 60px 1fr 1fr 40px;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
  background: #f9f9f9;
  padding: 8px;
  border-radius: 4px;
}

.gallery-item-row img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 4px;
}

.gallery-item-row input {
  padding: 5px;
  font-size: 0.9rem;
}

/* Orders Tab Styles */
.orders-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.search-input {
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  width: 300px;
  max-width: 100%;
}

.no-data-message {
  text-align: center;
  padding: 3rem;
  color: #999;
  font-size: 1.1rem;
}

/* Order Details Styles */
.order-details {
  background: #f9f9f9;
  padding: 1.5rem;
  border-radius: 8px;
}

.order-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid #eee;
}

.order-info-group {
  display: flex;
  flex-direction: column;
}

.order-info-label {
  font-weight: 700;
  color: #333;
  margin-bottom: 0.3rem;
}

.order-info-value {
  color: #666;
  font-size: 0.95rem;
}

.order-items {
  margin-bottom: 1.5rem;
}

.order-items-title {
  font-weight: 700;
  margin-bottom: 1rem;
  color: #333;
}

.order-item {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 1rem;
  padding: 1rem;
  background: white;
  border-radius: 4px;
  margin-bottom: 0.5rem;
  border: 1px solid #eee;
}

.order-item-image {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
}

.order-item-details {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.order-item-name {
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.order-item-specs {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 0.3rem;
}

.order-item-price {
  font-weight: 600;
  color: #000;
}

.order-totals {
  background: white;
  padding: 1rem;
  border-radius: 4px;
  border: 1px solid #eee;
}

.order-total-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #eee;
}

.order-total-row.final {
  border: none;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0;
  padding-bottom: 0;
}

.order-total-label {
  color: #666;
}

.order-total-value {
  color: #000;
  font-weight: 600;
}

.order-status {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
}

.order-status.pending {
  background: #fff3cd;
  color: #856404;
}

.order-status.completed {
  background: #d4edda;
  color: #155724;
}

.order-status.cancelled {
  background: #f8d7da;
  color: #721c24;
}

/* Responsive */
@media (max-width: 768px) {
  .tab-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .orders-actions {
    flex-direction: column;
    width: 100%;
  }

  .search-input {
    width: 100%;
  }

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

  .order-header {
    grid-template-columns: 1fr;
  }

  .order-item {
    grid-template-columns: 50px 1fr;
  }

  .order-item-image {
    width: 50px;
    height: 50px;
  }

  table {
    font-size: 0.9rem;
  }

  th, td {
    padding: 0.7rem;
  }
}
