/* assets/css/admin.css */

/* ----------------------
   Client / orders UI
-------------------------*/
.client-empty,
.client-order-empty {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.client-orders {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.client-order-card {
  padding: 1.4rem 1.3rem;
  border-radius: 1.1rem;
  background: rgba(7, 7, 12, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.8),
    0 14px 28px rgba(0, 0, 0, 0.9);
}

.client-order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 0.9rem;
}

.client-order-header h2 {
  font-size: 1.55rem;
  margin-bottom: 0.1rem;
}

.client-order-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 1.6rem; /* keeps text vertically centered inside the pill */
}

.status-pill--pending {
  background: rgba(226, 169, 241, 0.08);
  color: var(--accent);
}

.status-pill--in_progress {
  background: rgba(76, 201, 240, 0.12);
  color: #4cc9f0;
}

.status-pill--complete {
  background: rgba(94, 228, 127, 0.12);
  color: #5ee47f;
}

.status-pill--on_hold {
  background: rgba(255, 211, 105, 0.12);
  color: #ffd369;
}

.status-pill--cancelled {
  background: rgba(255, 99, 132, 0.12);
  color: #ff6384;
}

.client-order-items {
  list-style: none;
  padding: 0;
  margin: 0.4rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.client-order-item {
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.client-order-item-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.25rem;
}

.client-order-item-name {
  font-size: 0.9rem;
}

.client-order-item-notes {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: left;
}

.client-item-delete {
  padding-inline: 1rem;
  margin-top: 0.4rem;
  font-size: 0.85rem;
}

.client-logout-button {
  width: 20%;
  align-self: flex-start;
  margin-top: 0;
  background: linear-gradient(135deg, #ff5c7a, #ff3b55);
  color: #050507;
}

/* Admin tweaks */
.admin-subtitle {
  font-size: 1rem;
  margin-bottom: 0.6rem;
}

/* Admin two-column layout */
.admin-layout {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
}

.admin-column {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.admin-column--left {
  flex: 0 0 36%;
  max-width: 380px;
  margin-top: 2.95rem;
}

.admin-column--right {
  flex: 1 1 0;
  padding-top: 3.3rem;
}

/* Stack columns on smaller screens */
@media (max-width: 900px) {
  .admin-layout {
    flex-direction: row;
  }

  .admin-column--left,
  .admin-column--right {
    max-width: 100%;
  }
}

.admin-form select,
.admin-item-status {
  border-radius: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.09);
  padding: 0.5rem 0.8rem;
  font-size: 0.9rem;
  outline: none;
  transition:
    background-color 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease;
}

/* Base look for status selects */
.admin-item-status {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: rgb(43, 43, 43);
  padding-right: 2rem; /* space for arrow */
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 8px 8px;
  /* custom dark-gray arrow (SVG) */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath fill='none' stroke='%236a6a6a' stroke-width='1.5' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
}

/* Optional: slightly stronger arrow on hover, no white flash */
.admin-item-status:hover {
  border-color: rgba(226, 169, 241, 0.6);
}

/* Optional: accent border when focused */
.admin-item-status:focus {
  border-color: var(--accent);
}

/* Match client status-pill colors on admin dropdowns (text + border) */
.admin-item-status--pending {
  background-color: rgb(43, 43, 43);
  color: var(--accent);
  border-color: rgba(226, 169, 241, 0.6);
}

.admin-item-status--in_progress {
  background-color: rgb(43, 43, 43);
  color: #4cc9f0;
  border-color: rgba(76, 201, 240, 0.7);
}

.admin-item-status--complete {
  background-color: rgb(43, 43, 43);
  color: #5ee47f;
  border-color: rgba(94, 228, 127, 0.7);
}

.admin-item-status--on_hold {
  background-color: rgb(43, 43, 43);
  color: #ffd369;
  border-color: rgba(255, 211, 105, 0.7);
}

.admin-item-status--cancelled {
  background-color: rgb(43, 43, 43);
  color: #ff6384;
  border-color: rgba(255, 99, 132, 0.7);
}

.admin-item-notes {
  width: 100%;
  border-radius: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(6, 6, 12, 0.9);
  padding: 0.6rem 0.8rem;
  font-size: 0.9rem;
  color: var(--text-main);
  resize: none;
  overflow-y: hidden;
}

.admin-item-save {
  margin-top: 0.6rem;
  align-self: flex-start;
}

.admin-item-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.6rem;
}

.admin-item-actions .admin-item-save {
  margin-top: 0;
  align-self: auto;
  font-size: 0.85rem;
}

.admin-item-actions .admin-item-delete {
  margin-left: auto;
}

.admin-orders {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  margin-top: 0.6rem;
}

.admin-order-card {
  /* shares styling with .client-order-card */
}

.admin-order-items {
  margin-top: 0.6rem;
  border-top: 1px solid rgb(194 29 233 / 37%);
}

.admin-order-items-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.admin-order-item {
  border-top: 1px solid rgb(194 29 233 / 37%);
  padding-top: 0.6rem;
}

.admin-add-item-card {
  margin-top: 2rem;
  padding: 1.6rem 1.4rem;
  border-radius: 1.1rem;
  background: rgba(7, 7, 12, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.8),
    0 14px 28px rgba(0, 0, 0, 0.9);
}

.admin-add-item-title {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: var(--accent);
  text-align: left;
}

.admin-item-form {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.admin-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
}

.auth-messages--notice {
  background: rgba(76, 201, 240, 0.12);
  border: 1px solid rgba(76, 201, 240, 0.7);
  color: #b5f1ff;
}

.admin-orders-overview .admin-orders-list,
.admin-orders-overview .client-empty {
  margin-top: 1.4rem;
  padding-top: 1.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-orders-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.6rem;
}

.admin-orders-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 0.9rem;
  border-radius: 0.8rem;
  background: rgba(7, 7, 12, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.05);
  text-decoration: none;
  color: var(--text-main);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease,
    transform 0.12s ease;
}

.admin-orders-list-item:hover {
  border-color: rgba(226, 169, 241, 0.6);
  background: rgba(13, 13, 20, 0.98);
  box-shadow:
    0 0 0 1px rgba(226, 169, 241, 0.4),
    0 12px 24px rgba(0, 0, 0, 0.9);
  transform: translateY(-1px);
}

.admin-orders-list-item--active {
  border-color: rgba(226, 169, 241, 0.9);
  box-shadow:
    0 0 0 1px rgba(226, 169, 241, 0.7),
    0 12px 28px rgba(0, 0, 0, 1);
}

.admin-orders-list-main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.admin-orders-list-title {
  font-size: 0.95rem;
  font-weight: 500;
}

.admin-orders-list-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.admin-order-detail {
  margin-top: 2.2rem;
  padding-top: 1.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-order-detail-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.admin-order-status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
}

.admin-order-status-form .auth-button {
  margin-top: 0;
  padding-inline: 1.1rem;
  font-size: smaller;
}

.admin-complete-button {
  background: linear-gradient(135deg, #5ee47f, #3ac36a);
  color: #050507;
}

/* Destructive actions */
.admin-delete-button,
.admin-item-delete {
  background: linear-gradient(135deg, #ff5c7a, #ff3b55);
  color: #050507;
}

.admin-item-delete {
  padding-inline: 1rem;
  margin-top: 0rem;
  font-size: 0.85rem;
}

.admin-reset-separator {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.admin-logout-button {
  width: 100%;
  align-self: flex-start;
  margin-top: 0;
}

.admin-layout-toolbar {
  display: flex;
  margin-top: 0.6rem;
}

/* Ban IP modal */
.admin-ban-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.admin-ban-modal[hidden] {
  display: none;
}

.admin-ban-modal-inner {
  width: 100%;
  max-width: 480px;
  padding: 1.6rem 1.4rem;
  border-radius: 1.1rem;
  background: rgba(7, 7, 12, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.8),
    0 22px 44px rgba(0, 0, 0, 1);
}

.admin-ban-modal-title {
  font-size: 1.2rem;
  margin-bottom: 0.4rem;
}

.admin-ban-modal-meta {
  margin-bottom: 1rem;
}

.admin-ban-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 0.8rem;
}

/* Ensures modal buttons match in size */
.admin-ban-modal-actions .auth-button {
    padding: 0.45rem 1.2rem;     /* same for both buttons */
    font-size: 0.9rem;
    min-width: 110px;           /* ensures equal width visually */
}

/* Keep the red destructive look but NOT the wider padding */
.admin-ban-modal-actions .admin-item-delete {
    padding: 0.45rem 1.2rem !important;
}

/* Small pill toggle button */
.admin-sidebar-toggle {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(10, 10, 18, 0.9);
  color: var(--text-main);
  font-size: 0.8rem;
  padding: 0.35rem 0.9rem;
  cursor: pointer;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.admin-sidebar-toggle:hover {
  border-color: var(--accent);
}

/* Collapsed state: hide left, let right expand */
.admin-layout.admin-layout--collapsed .admin-column--left {
  display: none;
}

.admin-layout.admin-layout--collapsed .admin-column--right {
  flex: 1 1 100%;
  max-width: 100%;
}

/* Responsive tweaks */
@media (max-width: 720px) {
  .client-order-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .client-logout-button {
    width: 40%;
  }

  .admin-item-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-order-detail-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-order-status-actions {
    font-size: small;
  }
}

@media (max-width: 650px) {
  .admin-order-status-actions {
    font-size: 11px;
  }
}

/* Simple styling for the login audits table */
.admin-audit-table-wrap {
  margin-top: 1rem;
  overflow-x: auto;
}

.admin-audit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.admin-audit-table th,
.admin-audit-table td {
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  text-align: left;
}

.admin-audit-table th {
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.75rem;
}

.admin-audit-success {
  white-space: nowrap;
}