/* ============ Admin styles ============ */

.admin-body {
  background: #f1f5f9;
  margin: 0;
  min-height: 100vh;
}

.admin-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.admin-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.admin-header h1 {
  font-size: 1.15rem;
  margin: 0;
  color: var(--text);
}

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

.admin-user {
  font-size: 0.875rem;
  color: var(--muted);
}

.link-btn {
  text-decoration: none;
  color: var(--primary);
  font-size: 0.875rem;
  padding: 6px 12px;
  border-radius: 6px;
  transition: background 0.15s;
}

.link-btn:hover {
  background: rgba(37, 99, 235, 0.08);
}

.admin-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
}

button.small {
  padding: 6px 12px;
  font-size: 0.85rem;
}

button.danger {
  background: var(--error);
  color: #fff;
}

button.danger:hover:not(:disabled) {
  background: #dc2626;
}

/* Filters */

.filters {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 240px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 0.9rem;
  font-family: inherit;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.filter-select {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
}

/* Table */

.table-wrap {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: auto;
}

.customer-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.customer-table th {
  background: #f8fafc;
  text-align: left;
  padding: 10px 12px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.customer-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.customer-table tbody tr {
  cursor: pointer;
  transition: background 0.1s;
}

.customer-table tbody tr:hover {
  background: #f8fafc;
}

.col-avatar {
  width: 56px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e2e8f0 center/cover no-repeat;
  display: block;
}

.code-mono {
  font-family: "SF Mono", "Monaco", "Courier New", monospace;
  color: var(--primary);
  font-weight: 600;
}

.type-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.type-new      { background: #e0f2fe; color: #0369a1; }
.type-regular  { background: #d1fae5; color: #047857; }
.type-vip      { background: #fef3c7; color: #92400e; }
.type-blacklist{ background: #fee2e2; color: #b91c1c; }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 32px;
}

.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  font-size: 0.875rem;
  color: var(--muted);
}

/* Modal wide */

.modal-wide {
  max-width: 880px;
  width: 100%;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 50%;
}

.modal-close:hover {
  background: var(--surface-2);
  color: var(--text);
}

.d-meta {
  color: var(--muted);
  font-size: 0.875rem;
  margin-bottom: 16px;
}

.d-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 720px) {
  .d-grid { grid-template-columns: 1fr; }
}

.d-info h3, .d-photos h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  color: var(--text);
}

.kv {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 6px 12px;
  margin: 0 0 16px;
  font-size: 0.875rem;
}

.kv dt {
  color: var(--muted);
}

.kv dd {
  margin: 0;
  color: var(--text);
  word-break: break-word;
}

.type-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.type-actions .label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-right: 4px;
}

.chip {
  padding: 4px 12px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--text);
}

.chip:hover {
  background: var(--secondary);
}

.chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.chip.danger.active {
  background: var(--error);
  border-color: var(--error);
}

.photos-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.photos-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}

.photo-item {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-item .dl {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  text-decoration: none;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
  opacity: 0;
  transition: opacity 0.15s;
}

.photo-item:hover .dl {
  opacity: 1;
}

.modal-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-start;
}

.warn {
  background: #fef3c7;
  color: #92400e;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  border: 1px solid #fde68a;
}

/* Login page */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

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

.login-card h1 {
  margin: 0 0 4px;
  font-size: 1.4rem;
  text-align: center;
}

.login-sub {
  text-align: center;
  color: var(--muted);
  margin: 0 0 20px;
  font-size: 0.875rem;
}

.login-btn {
  width: 100%;
}
