/* ============================
   Admin Panel Styles
   ============================ */

.admin-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 30px;
  min-height: calc(100vh - 200px);
}

/* Sidebar */
.admin-sidebar {
  background: rgba(10, 10, 15, 0.9);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(16px);
  height: fit-content;
  position: sticky;
  top: 100px;
}

.admin-sidebar-header {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.admin-sidebar-header h2 {
  margin: 0 0 12px;
  font-size: 20px;
  color: #fff;
}

.admin-site-link {
  display: inline-block;
  font-size: 12px;
  color: var(--primary);
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.admin-site-link:hover {
  opacity: 1;
}

.admin-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.admin-nav li {
  margin-bottom: 4px;
}

.admin-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all 0.2s;
  font-size: 14px;
}

.admin-nav a:hover {
  background: rgba(255,255,255,0.05);
  color: #fff;
}

.admin-nav a.active {
  background: rgba(197, 150, 91, 0.15);
  color: var(--primary);
  font-weight: 500;
}

.nav-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.badge {
  background: #ff9800;
  color: #000;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
  margin-left: auto;
}

.nav-logout {
  color: #f44336 !important;
}

.nav-logout:hover {
  background: rgba(244, 67, 54, 0.1) !important;
}

.nav-divider {
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 12px 0;
}

/* Main Content */
.admin-main {
  flex: 1;
}

.admin-main h1 {
  font-size: 32px;
  margin: 0 0 30px;
  color: #fff;
}

/* Cards */
.admin-card {
  background: rgba(10, 10, 15, 0.8);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(16px);
}

.admin-card h2 {
  font-size: 22px;
  margin: 0 0 24px;
  color: #fff;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

/* Forms */
.contact-form {
  display: grid;
  gap: 20px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-row label {
  font-size: 14px;
  font-weight: 500;
  color: #fff;
}

.form-row input,
.form-row textarea,
.form-row select {
  padding: 12px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s;
}

.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(255,255,255,0.08);
}

.form-row textarea {
  resize: vertical;
  min-height: 100px;
}

.form-row-inline {
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.form-row-inline label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.form-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-note code {
  background: rgba(255,255,255,0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
}

/* Buttons */
.btn-primary,
.btn-danger,
.btn-ghost,
.btn-small {
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  background: var(--primary);
  color: #000;
}

.btn-primary:hover {
  background: #d4a866;
  transform: translateY(-1px);
}

.btn-danger {
  background: #f44336;
  color: #fff;
}

.btn-danger:hover {
  background: #d32f2f;
}

.btn-ghost {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.btn-ghost:hover {
  background: rgba(255,255,255,0.15);
}

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
}

/* Tables */
.admin-table-wrapper {
  overflow-x: auto;
  margin-top: 20px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table thead {
  background: rgba(255,255,255,0.05);
}

.admin-table th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  color: #fff;
  border-bottom: 2px solid rgba(255,255,255,0.1);
}

.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  color: var(--text-muted);
}

.admin-table tbody tr:hover {
  background: rgba(255,255,255,0.03);
}

.admin-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.1);
}

/* Edit Forms */
.admin-edit-details {
  margin-bottom: 8px;
}

.admin-edit-details summary {
  cursor: pointer;
  color: var(--primary);
  font-size: 13px;
  padding: 6px 0;
  user-select: none;
}

.admin-edit-details summary:hover {
  color: #d4a866;
}

.admin-inline-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  padding: 16px;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-md);
  margin-top: 8px;
}

.admin-inline-form textarea {
  grid-column: 1 / -1;
}

/* Search */
.search-form {
  margin-bottom: 20px;
}

.search-form input {
  width: 100%;
  max-width: 400px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 14px;
}

.search-form input:focus {
  outline: none;
  border-color: var(--primary);
}

/* Stats Grid */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.admin-stat-card {
  background: rgba(10, 10, 15, 0.8);
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(16px);
}

.admin-stat-card > div:first-child {
  font-size: 36px;
  font-weight: bold;
  color: var(--primary);
  margin-bottom: 8px;
}

.admin-stat-card > div:last-child {
  color: var(--text-muted);
  font-size: 14px;
}

/* Collapsible Forms */
.collapsible-form {
  margin-bottom: 24px;
}

.collapsible-form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.collapsible-form-header:hover {
  background: rgba(255,255,255,0.05);
}

.collapsible-form-header h3 {
  margin: 0;
  font-size: 18px;
  color: #fff;
}

.collapsible-form-header .toggle-icon {
  color: var(--primary);
  font-size: 14px;
  transition: transform 0.2s;
}

.collapsible-form.active .collapsible-form-header .toggle-icon {
  transform: rotate(180deg);
}

.collapsible-form-content {
  display: none;
  padding: 24px;
  background: rgba(255,255,255,0.02);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.collapsible-form.active .collapsible-form-content {
  display: block;
}

/* Action Buttons Group */
.action-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 968px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }
  
  .admin-sidebar {
    position: static;
  }
  
  .admin-nav ul {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
  }
}

/* Success/Error Messages */
.alert {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.alert-success {
  background: rgba(76, 175, 80, 0.2);
  border: 1px solid rgba(76, 175, 80, 0.3);
  color: #4caf50;
}

.alert-error {
  background: rgba(244, 67, 54, 0.2);
  border: 1px solid rgba(244, 67, 54, 0.3);
  color: #f44336;
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.status-pending {
  background: rgba(255, 152, 0, 0.2);
  color: #ff9800;
}

.status-in-progress {
  background: rgba(33, 150, 243, 0.2);
  color: #2196f3;
}

.status-completed {
  background: rgba(76, 175, 80, 0.2);
  color: #4caf50;
}

.status-cancelled {
  background: rgba(244, 67, 54, 0.2);
  color: #f44336;
}

/* Order Cards */
.orders-grid {
  display: grid;
  gap: 20px;
  margin-top: 20px;
}

.order-card {
  background: rgba(10, 10, 15, 0.8);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(16px);
  transition: all 0.3s ease;
}

.order-card:hover {
  border-color: rgba(255,255,255,0.2);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.order-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.order-header-left {
  flex: 1;
}

.order-id {
  font-size: 18px;
  font-weight: bold;
  color: var(--primary);
  margin-bottom: 8px;
}

.order-client strong {
  display: block;
  font-size: 16px;
  color: #fff;
  margin-bottom: 8px;
}

.order-contact {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.contact-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
}

.contact-link:hover {
  color: var(--primary);
}

.order-header-right {
  text-align: right;
}

.order-total {
  margin-bottom: 12px;
}

.total-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.total-amount {
  font-size: 24px;
  font-weight: bold;
  color: var(--primary);
}

.order-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.order-date {
  font-size: 12px;
  color: var(--text-muted);
}

.order-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.order-details {
  margin: 16px 0;
}

.order-details-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-md);
  cursor: pointer;
  user-select: none;
  color: var(--primary);
  font-weight: 500;
  transition: all 0.2s;
  list-style: none;
}

.order-details-toggle:hover {
  background: rgba(255,255,255,0.08);
}

.order-details-toggle::-webkit-details-marker {
  display: none;
}

.toggle-icon {
  transition: transform 0.3s;
  font-size: 12px;
}

.order-details[open] .toggle-icon {
  transform: rotate(180deg);
}

.order-details-content {
  padding: 20px 0;
  display: grid;
  gap: 24px;
}

.order-section {
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid rgba(255,255,255,0.05);
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.products-list {
  display: grid;
  gap: 12px;
}

.product-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-md);
}

.product-image {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.1);
}

.product-info {
  flex: 1;
}

.product-name {
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  margin-bottom: 6px;
}

.product-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.product-meta strong {
  color: var(--primary);
  font-weight: 600;
}

.product-name-simple {
  font-size: 14px;
  color: #fff;
  padding: 12px;
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-md);
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.detail-value {
  font-size: 14px;
  color: #fff;
  font-weight: 500;
}

.price-breakdown {
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 16px;
}

.breakdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.breakdown-item:last-child {
  border-bottom: none;
}

.breakdown-label {
  font-size: 14px;
  color: var(--text-muted);
}

.breakdown-value {
  font-size: 14px;
  color: #fff;
  font-weight: 500;
}

.breakdown-total {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 2px solid rgba(255,255,255,0.1);
}

.breakdown-total .breakdown-label {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

.breakdown-total .breakdown-value {
  font-size: 18px;
  font-weight: bold;
  color: var(--primary);
}

.total-section {
  background: rgba(197, 150, 91, 0.1);
  border: 1px solid rgba(197, 150, 91, 0.2);
}

.total-breakdown {
  background: transparent;
  padding: 0;
  margin: 0;
}

.order-message {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  white-space: pre-wrap;
  padding: 12px;
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-md);
}

.order-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.status-form {
  display: inline-block;
}

.status-select {
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: rgba(10, 10, 15, 0.9);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  font-size: 13px;
  cursor: pointer;
  min-width: 150px;
  transition: all 0.2s;
}

.status-select:hover {
  border-color: var(--primary);
}

.status-select:focus {
  outline: none;
  border-color: var(--primary);
}

.delete-btn {
  color: #f44336;
  text-decoration: none;
  font-size: 13px;
  padding: 8px 16px;
  background: rgba(244, 67, 54, 0.1);
  border-radius: var(--radius-md);
  transition: all 0.2s;
  display: inline-block;
}

.delete-btn:hover {
  background: rgba(244, 67, 54, 0.2);
  transform: translateY(-1px);
}

/* Responsive */
@media (max-width: 768px) {
  .order-header {
    flex-direction: column;
    gap: 16px;
  }
  
  .order-header-right {
    text-align: left;
  }
  
  .order-meta {
    align-items: flex-start;
  }
  
  .details-grid {
    grid-template-columns: 1fr;
  }
  
  .order-actions {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }
  
  .status-select {
    width: 100%;
  }
  
  .delete-btn {
    text-align: center;
  }
}

