/* ===== Admin dashboard – professional green & white theme ===== */

.admin-body {
  /* Palette used throughout the admin (also referenced by inline styles in admin.html) */
  --green-950: #04261b;
  --green-900: #0b3d2e;
  --green-800: #0f5240;
  --green-700: #116b50;
  --green-600: #0f8a62;
  --green-500: #12b981;
  --green-200: #bfe8d4;
  --green-100: #dcf3e7;
  --green-50: #f0f9f4;
  --slate-900: #0f1f19;
  --slate-700: #2f4239;
  --slate-500: #62756c;
  --slate-300: #c9d8d0;
  --slate-100: #e6efea;
  --slate-50: #f6faf8;

  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--slate-50);
  color: var(--slate-900);
  min-height: 100vh;
}

/* Buttons – solid green with white text inside the admin */
.admin-body .btn {
  padding: 0.7rem 1.35rem;
  border-radius: 8px;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
}
.admin-body .btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.83rem;
}
.admin-body .btn-primary {
  background: var(--green-700);
  color: white;
  box-shadow: 0 1px 2px rgba(11, 61, 46, 0.2);
}
.admin-body .btn-primary:hover {
  background: var(--green-800);
  transform: none;
  box-shadow: 0 4px 12px rgba(11, 61, 46, 0.2);
}
.admin-body .btn-outline {
  background: white;
  border: 1.5px solid var(--slate-300);
  color: var(--slate-700);
}
.admin-body .btn-outline:hover {
  border-color: var(--green-600);
  color: var(--green-800);
  background: var(--green-50);
}
.admin-body .btn-danger {
  background: white;
  color: #b91c1c;
  border: 1.5px solid #f3c4c4;
  border-radius: 8px;
  font-weight: 600;
}
.admin-body .btn-danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  color: white;
}

/* Form fields */
.admin-body .form-group label {
  color: var(--slate-700);
  font-size: 0.8rem;
  font-weight: 600;
}
.admin-body .form-group input,
.admin-body .form-group select,
.admin-body .form-group textarea {
  background: white;
  border: 1px solid var(--slate-300);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  font-size: 0.92rem;
  color: var(--slate-900);
}
.admin-body .form-group input:focus,
.admin-body .form-group select:focus,
.admin-body .form-group textarea:focus {
  border-color: var(--green-600);
  box-shadow: 0 0 0 3px rgba(15, 138, 98, 0.15);
}

/* Login */
#loginScreen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background:
    radial-gradient(circle at 15% 20%, rgba(18, 185, 129, 0.25), transparent 45%),
    linear-gradient(145deg, var(--green-950), var(--green-800));
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: white;
  padding: 2.75rem 2.5rem;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  text-align: center;
  border-top: 5px solid var(--green-500);
}
.login-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: white;
  background: linear-gradient(145deg, var(--green-700), var(--green-900));
  border-radius: 16px;
}
.login-card h1 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.3rem;
  color: var(--green-900);
}
.login-card > p {
  color: var(--slate-500);
  margin-bottom: 1.75rem;
  font-size: 0.92rem;
}
.login-error {
  color: #b91c1c;
  font-size: 0.88rem;
  margin-top: 0.85rem;
  display: none;
}
.login-hint {
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: var(--slate-500);
}
.back-link {
  display: inline-block;
  margin-top: 1.25rem;
  color: var(--green-700);
  font-size: 0.88rem;
  font-weight: 600;
}
.back-link:hover { text-decoration: underline; }

/* Header */
.admin-header {
  background: linear-gradient(90deg, var(--green-950), var(--green-900));
  color: white;
  padding: 0.8rem 0;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 10px rgba(4, 38, 27, 0.25);
  border-bottom: 3px solid var(--green-500);
}
.admin-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}
.admin-brand span:first-child {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--green-500);
  color: var(--green-950);
  border-radius: 8px;
  font-size: 1.1rem;
}
.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.btn-preview {
  background: white;
  color: var(--green-900);
  padding: 0.45rem 0.95rem;
  border-radius: 8px;
  font-size: 0.83rem;
  font-weight: 600;
  transition: background 0.15s;
}
.btn-preview:hover { background: var(--green-100); }
.btn-logout {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.35);
  color: white;
  padding: 0.42rem 0.9rem;
  border-radius: 8px;
  font-size: 0.83rem;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.15s;
}
.btn-logout:hover { background: rgba(255,255,255,0.12); }

/* Layout */
.admin-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 1.5rem;
  padding: 1.75rem 0 3rem;
  align-items: start;
}
.admin-sidebar {
  background: white;
  border: 1px solid var(--slate-100);
  border-radius: 12px;
  padding: 0.85rem;
  box-shadow: 0 1px 3px rgba(11, 61, 46, 0.05);
  position: sticky;
  top: 84px;
}
.sidebar-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--green-700);
  padding: 0.5rem 0.85rem 0.6rem;
}
.admin-nav-btn {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.62rem 0.85rem;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.88rem;
  color: var(--slate-700);
  cursor: pointer;
  margin-bottom: 0.15rem;
  transition: background 0.15s, color 0.15s;
}
.admin-nav-btn:hover {
  background: var(--green-50);
  color: var(--green-800);
}
.admin-nav-btn.active {
  background: var(--green-100);
  color: var(--green-900);
  font-weight: 600;
}
.admin-nav-btn.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  border-radius: 3px;
  background: var(--green-600);
}
.sidebar-divider {
  border: none;
  border-top: 1px solid var(--slate-100);
  margin: 0.75rem 0;
}

.admin-main {
  background: white;
  border: 1px solid var(--slate-100);
  border-radius: 12px;
  padding: 2rem 2.25rem;
  box-shadow: 0 1px 3px rgba(11, 61, 46, 0.05);
  min-height: 480px;
}
.admin-panel { display: none; }
.admin-panel.active { display: block; }

.panel-header {
  margin-bottom: 1.75rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--slate-100);
}
.panel-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--green-900);
  margin-bottom: 0.3rem;
  letter-spacing: -0.01em;
}
.panel-header p {
  color: var(--slate-500);
  font-size: 0.92rem;
}

.form-section-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin: 1.75rem 0 1rem;
  color: var(--green-800);
}

.cms-form .form-group { margin-bottom: 1.1rem; }
.cms-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.cms-form .form-row.three {
  grid-template-columns: 1fr 1fr;
}
.admin-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Nested card editors */
.editor-card {
  background: var(--slate-50);
  border-radius: 10px;
  padding: 1.15rem 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid var(--slate-100);
  border-left: 3px solid var(--green-500);
}
.editor-card h4 {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--green-800);
}
.editor-card .remove-btn {
  float: right;
  background: none;
  border: none;
  color: #b91c1c;
  cursor: pointer;
  font-size: 0.83rem;
  font-weight: 600;
}

/* Toast */
.status-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--green-900);
  color: white;
  padding: 0.85rem 1.25rem;
  border-radius: 10px;
  border-left: 4px solid var(--green-500);
  font-weight: 500;
  font-size: 0.92rem;
  box-shadow: 0 12px 30px rgba(4, 38, 27, 0.25);
  z-index: 200;
  animation: slideUp 0.3s ease;
}
.status-toast.error {
  background: #7f1d1d;
  border-left-color: #f87171;
}
@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Photo upload */
.photo-upload-area {
  border: 2px dashed var(--green-200);
  border-radius: 12px;
  padding: 2.25rem;
  text-align: center;
  margin-bottom: 1.25rem;
  transition: all 0.2s;
  background: var(--green-50);
}
.photo-upload-area.dragover {
  border-color: var(--green-600);
  background: var(--green-100);
}
.photo-upload-area input[type="file"] { display: none; }
.upload-title {
  font-weight: 600;
  color: var(--green-900);
  margin-bottom: 0.35rem;
}
.upload-hint {
  font-size: 0.85rem;
  color: var(--slate-500);
  margin-bottom: 1rem;
}

.photo-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}
.photo-preview-card {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--slate-100);
  background: white;
  box-shadow: 0 1px 3px rgba(11, 61, 46, 0.06);
}
.photo-preview-card img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
}
.photo-preview-card .photo-meta {
  padding: 0.5rem 0.65rem;
  font-size: 0.78rem;
  color: var(--slate-500);
}
.photo-preview-card .delete-photo {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(185, 28, 28, 0.9);
  color: white;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Tables */
.admin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 1.5rem;
  border: 1px solid var(--slate-100);
  border-radius: 10px;
  overflow: hidden;
}
.admin-table th,
.admin-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--slate-100);
  font-size: 0.88rem;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table th {
  background: var(--green-900);
  color: white;
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.admin-table tbody tr:nth-child(even) td { background: var(--slate-50); }
.admin-table tbody tr:hover td { background: var(--green-50); }
.admin-table .actions {
  display: flex;
  gap: 0.4rem;
}

.reset-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

@media (max-width: 900px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.75rem;
  }
  .sidebar-label, .sidebar-divider { display: none; }
  .admin-nav-btn {
    width: auto;
    font-size: 0.8rem;
    padding: 0.5rem 0.7rem;
  }
  .admin-nav-btn.active::before { display: none; }
  .cms-form .form-row {
    grid-template-columns: 1fr;
  }
  .admin-main {
    padding: 1.25rem;
  }
  .admin-table { display: block; overflow-x: auto; }
}

/* ===== User badge in header ===== */
.user-badge {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-right: 0.5rem;
  line-height: 1.25;
}
.user-badge-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: white;
}
.user-badge-role {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--green-200);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ===== Login demo accounts ===== */
.login-accounts {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--slate-100);
  text-align: left;
}
.login-demo-table {
  width: 100%;
  font-size: 0.8rem;
  margin-top: 0.5rem;
  border-collapse: collapse;
}
.login-demo-table td {
  padding: 0.3rem 0.4rem;
  color: var(--slate-500);
}
.login-demo-table code {
  background: var(--green-50);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.78rem;
  color: var(--green-800);
}

/* ===== Roles legend ===== */
.roles-legend {
  margin-bottom: 1.5rem;
}
.roles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}
.role-card {
  background: white;
  border-radius: 10px;
  padding: 0.95rem 1rem;
  border: 1px solid var(--slate-100);
  border-top: 3px solid var(--green-600);
}
.role-card-title {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
  color: var(--green-900);
}
.role-card-desc {
  font-size: 0.78rem;
  color: var(--slate-500);
  margin-bottom: 0.5rem;
}
.role-card-panels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.perm-chip {
  font-size: 0.65rem;
  background: var(--green-50);
  color: var(--green-800);
  border: 1px solid var(--green-100);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-weight: 500;
}

/* ===== Role & status badges ===== */
.role-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
}
.role-badge.role-superadmin { background: var(--green-900); color: white; }
.role-badge.role-admin { background: var(--green-600); color: white; }
.role-badge.role-editor { background: var(--green-100); color: var(--green-900); }
.role-badge.role-prices { background: white; color: var(--green-800); box-shadow: inset 0 0 0 1px var(--green-200); }

.status-active {
  color: var(--green-600);
  font-weight: 600;
  font-size: 0.85rem;
}
.status-inactive {
  color: #b91c1c;
  font-weight: 600;
  font-size: 0.85rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
  font-weight: 500;
}
.checkbox-label input {
  width: auto;
  accent-color: var(--green-600);
}

@media (max-width: 640px) {
  .user-badge { display: none; }
  .roles-grid { grid-template-columns: 1fr; }
}

/* ===== Messages inbox ===== */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  margin-left: 0.35rem;
  background: var(--green-600);
  color: white;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  vertical-align: middle;
}
.messages-toolbar {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.messages-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.message-card {
  border: 1px solid var(--slate-100);
  border-radius: 10px;
  padding: 1.15rem 1.25rem;
  background: white;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.message-card.message-unread {
  background: var(--green-50);
  border-color: var(--green-200);
  border-left: 4px solid var(--green-600);
  box-shadow: 0 2px 10px rgba(15, 138, 98, 0.08);
}
.message-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.message-name {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--green-900);
  margin-bottom: 0.25rem;
}
.message-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.8rem;
  color: var(--slate-500);
}
.message-tag {
  background: var(--green-100);
  color: var(--green-800);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-weight: 600;
  text-transform: capitalize;
}
.message-new {
  background: var(--green-600);
  color: white;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.message-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}
.message-body {
  font-size: 0.93rem;
  line-height: 1.6;
  color: var(--slate-700);
  white-space: pre-wrap;
  margin-bottom: 0.85rem;
  padding: 0.75rem 0.9rem;
  background: white;
  border-radius: 8px;
  border: 1px solid var(--slate-100);
}
.message-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.88rem;
  color: var(--slate-700);
}
.message-contact a {
  color: var(--green-800);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.message-contact a:hover { color: var(--green-600); }
.messages-empty {
  text-align: center;
  color: var(--slate-500);
  padding: 2.5rem 1rem;
  background: var(--green-50);
  border-radius: 12px;
  border: 1px dashed var(--green-200);
}
