body {
  margin: 0;
  /*padding: 0;*/
  font-family: 'Arial', sans-serif;
  background-color: #1e1e1e; /* Dark background */
  color: #e0e0e0;
  /*display: flex;*/
  justify-content: center;
  align-items: center;
  height: 100vh; /* Full height */ 
  /*height: 100%; */
  box-sizing: border-box;
  overflow: auto; /* Hide scrollbars */
}

/* Centering Flexbox only for the login page */
body.centered {
  display: flex; /* Flexbox for centering login box */
  justify-content: center;
  align-items: center;
  overflow: hidden; /* Prevent scrolling */
}

/* Header styles (logo and logout button) */
header {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: #2e2e2e;
  color: #fff;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  box-sizing: border-box;
}

header img {
  margin-left: 20px;
  width: 100px;
}

/* Container for the search input */
.search-container {
  position: relative;
  display: flex;
  justify-content: center;
  margin-top: 0px; /* Adjust margin based on your layout */
  gap: 10px;
}

/* Search input styling */
.search-box {
  width: 300px; /* Adjust width as needed */
  padding: 10px 40px 10px 20px;
  font-size: 16px;
  border: none;
  border-radius: 5px;
  background-color: #2a2a2a; /* Dark background to match the theme */
  color: #fff;
  transition: all 0.3s ease;
  outline: none;
  box-sizing: border-box;
}

.search-box::placeholder {
  color: #888; /* Light placeholder color */
}

.search-box:focus {
  background-color: #1e1e1e; /* Slightly darker on focus */
  outline: 2px solid #ff4c4c; /* Highlight border on focus */
}

/* Page counter styling */
.page-counter {
  font-size: 16px;
  color: #e0e0e0; /* Light text color to match the theme */
  background-color: #333; /* Dark background */
  padding: 10px 15px;
  border-radius: 5px;
  display: inline-block;
  margin-left: 10px;
  margin-right: 10px;
}

.search-container input:focus + .search-icon {
  color: #007bff; /* Change icon color on focus */
}

/* Button container for alignment */
.header-buttons {
  display: flex;
  gap: 10px; /* Spacing between buttons */
}

.queue-status-pill {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  justify-content: center;
  min-height: 36px;
  padding: 0 13px;
  white-space: nowrap;
}

.queue-status-pending {
  background: #374151;
  border-color: #4b5563;
  color: #e5e7eb;
}

.queue-status-ok {
  background: #166534;
  border-color: #22c55e;
  color: #dcfce7;
}

.queue-status-warning {
  background: #92400e;
  border-color: #f59e0b;
  color: #fef3c7;
}

.queue-status-alert {
  background: #991b1b;
  border-color: #ef4444;
  color: #fee2e2;
}

/* Logout and Settings buttons */
.add-button, .settings-button {
    background-color: #ff4c4c;
    color: white;
    border: none;
    padding: 10px 10px;
    cursor: pointer;
    border-radius: 5px;
  }

/* Logout and Settings buttons */
.logout-button, .settings-button {
  background-color: #ff4c4c;
  color: white;
  border: none;
  padding: 10px 10px;
  cursor: pointer;
  border-radius: 5px;
  width: 80px;
}

/* Logout and Settings buttons */
.save-button {
  background-color: #ff4c4c;
  color: white;
  border: none;
  padding: 10px 10px;
  cursor: pointer;
  border-radius: 5px;
  width: 105px;
  margin-top: 2px;
}

.pagination-button {
  background-color: #ff4c4c;
  color: white;
  border: none;
  padding: 0px 0px;
  cursor: pointer;
  border-radius: 5px;
  width: 40px;
}

.logout-button:hover, .settings-button:hover, .pagination-button:hover, .save-button:hover {
  background-color: #ff1f1f;
}

/* Settings button with a gear icon */
.settings-button {
  align-items: center;
}


/* Pagination container */
.pagination {
  display: flex;
  justify-content: center; /* Center the pagination */
  align-items: center;
  margin-top: 0px;
  gap: 10px; /* Space between the buttons */
}

.pagination-button:disabled {
  background-color: #777; /* Disabled state styling */
  cursor: not-allowed;
}

/* Main content styles */
.container {
  margin-top: 20px; /* Offset for fixed header */
  padding: calc(100vh - 80px);
  overflow-y: auto;
  padding: 20px;
  /*max-height: calc(100vh - 80px);*/
  box-sizing: border-box;
  overflow-x: hidden; /* Hide horizontal scrollbar */
}

input[type="text"] {
  width: 100%;
  padding: 12px 20px;
  margin-bottom: 0px;  /* Adjusted to remove space from the bottom of the painting modal */
  box-sizing: border-box;
  border: none;
  border-radius: 4px;
  background-color: #2A2A2A;
  color: #FFFFFF;
  font-size: 16px;
}

input[type="text"]::placeholder {
  color: #B0B0B0;
}

/* Table styles */
table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  background-color: #1e1e1e;
  color: #e0e0e0;
  box-sizing: border-box;
}

table th, table td {
  padding: 10px 15px;
  border: 1px solid #333;
  text-align: left;
  word-wrap: break-word;
  max-width: 400px;
  box-sizing: border-box;
}

table tr {
  transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

table tr:hover {
  background-color: #2a2a2a;
  transform: scale(1.02);
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.5);
}

table thead tr:hover {
  background-color: #2e2e2e;
  transform: scale(1.00);
  box-shadow: 0px 0px 0px rgba(0, 0, 0, 0);
}

table thead tr {
  background-color: #2e2e2e;
}

table tbody tr:nth-child(odd) {
  background-color: #252525;
}

table tbody tr:nth-child(even) {
  background-color: #1e1e1e;
}

/* Pagination styles */
.pagination {
  margin: 20px 0;
  text-align: center;
}

.pagination button {
  background-color: #333;
  color: #fff;
  border: none;
  padding: 10px 15px;
  margin: 0 5px;
  cursor: pointer;
  border-radius: 3px;
}

.pagination button:hover {
  background-color: #555;
}

.pagination button.disabled {
  background-color: #777;
  cursor: not-allowed;
}

/* Container for the login box */
.login-container {
  background-color: #2e2e2e; /* Slightly lighter background for contrast */
  padding: 40px;
  border-radius: 10px;
  box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.5); /* Subtle shadow for depth */
  width: 350px; /* Fixed width */
  text-align: center;
  
}

/* Logo styles */
.login-container img {
  width: 120px;
  margin-bottom: 20px;
}

/* Input field styles */
.login-container input[type="text"] {
  width: 100%;
  padding: 10px;
  margin-bottom: 20px;
  background-color: #444;
  border: 1px solid #555;
  border-radius: 5px;
  color: #fff;
  font-size: 16px;
  box-sizing: border-box;
  outline: none;
  transition: background-color 0.3s ease;
}

/* Input field focus effect */
.login-container input[type="text"]:focus {
  background-color: #555;
}

/* Login button styles */
.login-container button {
  width: 100%;
  padding: 10px;
  background-color: #ff4c4c;
  border: none;
  border-radius: 5px;
  color: white;
  font-size: 18px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

/* Button hover effect */
.login-container button:hover {
  background-color: #ff1f1f;
}

.login-footer {
  margin-top: 20px;
  color: #777;
  font-size: 12px;
  text-align: center;
}

/* Style for sortable headers */
th.sortable {
  cursor: pointer;
  color: #ddd;
}

th.sortable:hover {
  color: #fff;
}

/* Indicator for sort direction */
th.sort-asc::after {
  content: " ▲"; /* Upward triangle */
}

th.sort-desc::after {
  content: " ▼"; /* Downward triangle */
}



/* Modal */
.modal {
  display: none; /* Hidden by default */
  position: fixed; /* Fixed position ensures it stays on the screen */
  z-index: 1000; /* High z-index to overlay above other elements */
  left: 0;
  top: 0;
  width: 100%; /* Full width */
  height: 100%; /* Full height */
  background-color: rgba(0, 0, 0, 0.8); /* Dark background with transparency */
  justify-content: center;
  align-items: center;
  overflow: hidden; /* Prevents background content from being scrolled */
  animation: fadeIn 0.3s ease; /* Fade-in animation */
}

/* Modal content */
.modal-content {
  background-color: #2e2e2e;
  padding: 20px;
  border-radius: 10px;
  max-width: 90%;
  max-height: 95%;
  display: flex;
  gap: 20px;
  box-sizing: border-box;
  overflow: auto;
  color: #e0e0e0;
  position: relative;
}

/* Modal body with left (image) and right (attributes) sections 
.modal-body {
  display: flex;
  gap: 20px;
  width: 100%;
}
*/
/*
.modal-left {
  flex: 1;
  display: flex;
  justify-content: center;  /* Horizontally centers the image 
  align-items: flex-start;   /* Aligns the image to the top 
  height: 100%;              /* Ensures it takes the full height of the modal */

/*  
.modal-left {
  display: flex;
  flex-direction: column; /* Stack the image and chip vertically 
  align-items: center;    /* Center the image and chip horizontally 
  justify-content: flex-start; /* Align them at the top of the container 
}
*/

.modal-left img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}
/*
.modal-right {
  flex: 2;
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* Grid layout for the attributes 
.painting-details {
  display: grid;
  grid-template-columns: 1fr 1fr; /* Two equal-width columns 
  gap: 20px; /* Space between form fields 
  width: 100%;
}
*/

.modal-body {
  display: flex;
  gap: 20px;
  width: 100%;
  justify-content: space-between; /* Ensure space between image and right columns */
}

.modal-left {
  flex: 0 0 25%; /* Fixed 30% width for the image container */
  display: flex;
  flex-direction: column; /* Stack the image and chip vertically */
  align-items: center;    /* Center the image and chip horizontally */
  justify-content: flex-start; /* Align them at the top of the container */
}

.modal-right {
  width: 75%; /* Ensure the right side takes up 60% of the modal */
  display: flex;
  flex-direction: column;
}

.painting-details {
  display: grid;
  grid-template-columns: 1fr 1fr; /* Two equal-width columns */
  gap: 20px; /* Space between form fields */
  width: 100%;
}

.painting-details .attribute {
  display: flex;
  flex-direction: column;
}

.painting-details label {
  margin-left: 2px;
  margin-top: 5px;
  color: #e0e0e0;
  font-size: 14px;
}

.painting-details input[type="text"],
.painting-details select,
.painting-details textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #444;
  border-radius: 5px;
  background-color: #1e1e1e;
  color: #e0e0e0;
  font-size: 16px;
  box-sizing: border-box;
}

.painting-details textarea {
  resize: vertical;
  min-height: 120px; /* Set minimum height for text area */
}

.painting-details select:focus,
.painting-details input[type="text"]:focus,
.painting-details textarea:focus {
  background-color: #2a2a2a;
  border: 1px solid #ff4c4c;
}

.close {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 30px;
  cursor: pointer;
  color: #fff;
}

/* Make sure the modal content scrolls if it overflows */
.modal-content {
  overflow-y: auto;
}

@media (max-width: 768px) {
  .painting-details {
    grid-template-columns: 1fr; /* On smaller screens, switch to a single column */
  }
}

/* Fade-in effect */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
/* Style the chip container */
.chip-container {
  margin-top: 10px;
  text-align: center;
  width: 100%;
}

.toggle-pills {
  display: grid;
  gap: 8px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.toggle-label {
  font-size: 12px;
  color: #9ca3af;
  text-align: left;
}

/* Basic chip styling */
.status-chip {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  background-color: #757575;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.toggle-pill {
  min-width: 72px;
  height: 36px;
  padding: 8px 12px;
  border-radius: 9999px;
  border: none;
  background: transparent;
  color: #d1d5db;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .01em;
  transition: background-color .2s ease, color .2s ease;
}

.toggle-pill:hover {
  background: rgba(75, 85, 99, 0.18);
}

.toggle-pill.on {
  background: rgba(239, 68, 68, 0.25);
  color: #fecaca;
}

.toggle-pill.off {
  background: transparent;
  color: #d1d5db;
}

.toggle-pill.pending {
  background: rgba(75, 85, 99, 0.2);
  color: #e5e7eb;
}

/* Chip appearance when status is off */
.status-chip.off {
  background-color: #dc3545; /* Red background for off */
  color: #fff;
}

/* Chip appearance when status is off */
.status-chip.on {
  background-color: #28a745; /* Red background for off */
  color: #fff;
}

/* Hover effect */
.status-chip:hover {
  opacity: 0.8; /* Slight transparency on hover */
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #dc3545;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999; /* Ensures it's on top */
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hidden {
    display: none;
}

.button-container {
  margin-top: 8px;
  margin-bottom: 6px;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.tier-links {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 10px;
}

.tier-links a {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  color: #f3f4f6;
  background: #1f2937;
  border: 1px solid #374151;
}

.tier-links a:hover {
  background: #111827;
}

.tier-links a.disabled {
  opacity: .4;
  pointer-events: none;
}

.rotate-button {
  width: 42px;
  height: 42px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  line-height: 1;
  font-weight: 700;
  background-color: #343434;
  color: #f5f5f5;
  border: 1px solid #505050;
  border-radius: 10px;
  cursor: pointer;
}

.rotate-button:hover {
  background-color: #424242;
  border-color: #666;
}


.delete-button {
    margin-top: auto; /* Push the button to the bottom */
    margin-bottom: 20px;
    padding: 10px 15px;
    font-size: 14px;
    color: #fff;
    background-color: #d9534f; /* Bootstrap danger color */
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.delete-button:hover {
    background-color: #c9302c; /* Darker danger color */
}
#artistModal .artist-modal-content {
  width: min(640px, 92vw) !important;
  max-width: 92vw !important;
  max-height: 94vh;
  display: block !important;
  padding: 14px;
  border: 1px solid #3a3a3a;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0,0,0,.45);
  background: #2e2e2e;
}

.artist-modal-title {
  margin: 0 0 10px;
  font-size: 18px;
  color: #e5e7eb;
}

.artist-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}

.artist-about {
  grid-column: 1 / -1;
}

.artist-details textarea {
  min-height: 120px;
}

.artist-actions {
  position: sticky;
  bottom: 0;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #3a3a3a;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: linear-gradient(to top, #2e2e2e 78%, rgba(46,46,46,0));
}

#artistModal .artist-actions .save-button {
  min-width: 0;
}

#edit_artist_select {
  width: 100%;
  border-radius: 8px;
  border: 1px solid #424242;
  padding: 9px 10px;
  font-size: 14px;
  background-color: #1e1e1e;
  color: #e0e0e0;
  box-sizing: border-box;
}

#edit_artist_select:focus {
  background-color: #2a2a2a;
  border: 1px solid #ff4c4c;
}

.edit-artist-picker {
  margin-bottom: 20px;
}

.edit-artist-picker-label {
  margin: 6px 2px 2px;
  color: #aeb4bd;
  font-size: 12px;
  letter-spacing: .2px;
}

#editArtistModal .artist-modal-content {
  width: min(640px, 92vw) !important;
}

@media (max-width: 980px) {
  .artist-fields { grid-template-columns: 1fr; }
}

/* Step 1 UX polish: buttons + confirm dialog + toasts */
.btn {
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .12s ease, opacity .2s ease, background-color .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: #ff4c4c; color: #fff; }
.btn-primary:hover { background: #ff2f2f; }
.btn-secondary { background: #3b3b3b; color: #f0f0f0; }
.btn-secondary:hover { background: #4a4a4a; }
.btn-danger { background: #b4232f; color: #fff; }
.btn-danger:hover { background: #d62f3c; }

.confirm-content {
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  border-radius: 12px;
  width: min(520px, 92vw);
  padding: 18px;
  box-shadow: 0 12px 40px rgba(0,0,0,.45);
}
.confirm-content h3 { margin: 0 0 10px; font-size: 20px; }
.confirm-content p { margin: 0 0 16px; color: #cfcfcf; line-height: 1.45; }
.confirm-actions { display:flex; justify-content:flex-end; gap:10px; }

.toast-host {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  min-width: 240px;
  max-width: 360px;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  border: 1px solid transparent;
}
.toast-success { background:#12351f; border-color:#1c6f3a; color:#c9f5d8; }
.toast-error { background:#3a1518; border-color:#8f2a31; color:#ffd9dc; }
.toast-warn { background:#3a2d12; border-color:#8b6d2e; color:#ffeec5; }
.toast-info { background:#1a263a; border-color:#2f4c7f; color:#dbe9ff; }
.toast-hide { opacity: 0; transform: translateY(4px); transition: all .2s ease; }

/* Step 2: modal layout cleanup */
.modal-content {
  width: min(1320px, 96vw);
  max-height: 94vh;
  padding: 18px;
  border: 1px solid #3a3a3a;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0,0,0,.45);
}

.modal-left {
  flex: 0 0 28%;
  background: #242424;
  border: 1px solid #353535;
  border-radius: 12px;
  padding: 12px;
  gap: 10px;
}

.modal-right {
  width: 72%;
  background: #262626;
  border: 1px solid #353535;
  border-radius: 12px;
  padding: 12px;
  box-sizing: border-box;
}

.left-ai-actions {
  margin-top: auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.left-ai-actions .save-button {
  width: 100%;
  min-width: 0;
}

.painting-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
  width: 100%;
}

.painting-details label {
  margin: 6px 2px 0;
  color: #aeb4bd;
  font-size: 12px;
  letter-spacing: .2px;
}

.painting-details input[type="text"],
.painting-details select,
.painting-details textarea {
  border-radius: 8px;
  border: 1px solid #424242;
  padding: 9px 10px;
  font-size: 14px;
}

.painting-details textarea {
  min-height: 96px;
}

.modal-actions {
  position: sticky;
  bottom: 0;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #3a3a3a;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: linear-gradient(to top, #262626 78%, rgba(38,38,38,0));
}

.modal-actions-centered {
  grid-column: 1 / -1;
  justify-content: center;
  flex-wrap: wrap;
}

.save-button {
  width: auto;
  margin-top: 0;
  min-width: 180px;
}

.close {
  position: absolute;
  top: 10px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #353535;
  color: #f2f2f2;
  cursor: pointer;
  z-index: 2;
}

/* Step 3: dense gallery-like rows */
#sortable-table thead {
  display: none;
}

#sortable-table,
#sortable-table tbody,
#sortable-table tr,
#sortable-table td {
  display: block;
  width: 100%;
  border: none;
}

#sortable-table tr.dense-row {
  margin-bottom: 10px;
}

#sortable-table td.dense-cell {
  padding: 0;
  max-width: none;
}

.dense-card {
  display: flex;
  gap: 12px;
  background: #262626;
  border: 1px solid #393939;
  border-radius: 12px;
  padding: 10px;
  transition: border-color .2s ease, transform .15s ease;
}

.dense-row:hover .dense-card {
  border-color: #515151;
  transform: translateY(-1px);
}

.dense-thumb {
  width: 108px;
  height: 108px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #444;
  flex: 0 0 auto;
}

.dense-main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dense-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dense-title { display:flex; justify-content:space-between; gap:10px; font-size:15px; font-weight:700; color:#f3f3f3; }
.dense-price { color:#ffd39c; font-weight:700; }
.dense-subtle { color:#b9bec8; font-size:13px; }
.dense-chips { display:flex; gap:8px; flex-wrap:wrap; margin-top:2px; }

/* Step 4: readable cards + sortable/filterable toolbar */
.toolbar-inline {
  gap: 8px;
  align-items: center;
}

.compact-select {
  background: #2a2a2a;
  color: #ececec;
  border: 1px solid #4a4a4a;
  border-radius: 7px;
  padding: 7px 9px;
  font-size: 13px;
}

.dense-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
}

.dense-subtle {
  color: #d0d4dc;
  font-size: 14px;
  line-height: 1.35;
}

.dense-chips .status-chip {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .35px;
}

.dense-chips .status-chip.off {
  background-color: #4a4f57;
}

.dense-chips .status-chip.on {
  background-color: #1f8f49;
}

/* Step 5: block cards optimized for horizontal scanning */
.block-card {
  display: grid;
  grid-template-columns: 1.35fr 1fr 0.85fr 0.85fr;
  gap: 10px;
  align-items: stretch;
}

.card-block {
  background: #2b2b2b;
  border: 1px solid #3e3e3e;
  border-radius: 10px;
  padding: 10px;
  min-width: 0;
}

.block-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: #98a2b3;
  margin-bottom: 8px;
}

.block-identity {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 10px;
}

.id-meta { min-width: 0; }
.dense-title { font-size: 16px; font-weight: 700; line-height: 1.3; }
.dense-subtitle { font-size: 14px; color: #cfd5df; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dense-subtle { font-size: 12px; color: #b1b7c0; line-height: 1.35; }

.kv { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; font-size: 13px; }
.kv span { color: #9da5b3; }
.kv b { color: #edf1f7; font-weight: 600; text-align: right; }

.dense-chips.vertical { flex-direction: column; align-items: flex-start; }
.block-state .dense-price { margin-top: 8px; font-size: 15px; color: #ffd39c; }

@media (max-width: 1500px) {
  .block-card { grid-template-columns: 1fr 1fr; }
}

/* Revert to grid view with multi-line cell content */
#sortable-table thead { display: table-header-group !important; }
#sortable-table, #sortable-table tbody, #sortable-table tr, #sortable-table td {
  display: revert !important;
  width: auto !important;
  border: 1px solid #333 !important;
}

.cell-sub {
  margin-top: 2px;
  font-size: 11px;
  color: #aeb4bd;
  line-height: 1.2;
}

#sortable-table td {
  font-size: 13px;
}

.date-cell,
.date-cell div,
.date-cell .cell-sub {
  white-space: nowrap;
}

.grid-filters {
  display: flex;
  gap: 10px;
  margin: 10px 0 14px;
  align-items: center;
}

.site-input, .site-select {
  background: #1f2937;
  color: #e5e7eb;
  border: 1px solid #374151;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 14px;
  outline: none;
}
.site-input { min-width: 340px; }
.site-input:focus, .site-select:focus { border-color: #6b7280; box-shadow: 0 0 0 2px rgba(107,114,128,.25); }

.site-select { min-width: 180px; }

/* Main-site-like controls */
.add-button, .logout-button, .save-button, .pagination-button, .delete-button, .settings-button {
  background: #111827 !important;
  color: #f9fafb !important;
  border: 1px solid #374151 !important;
  border-radius: 999px !important;
  padding: 9px 14px !important;
  box-shadow: none !important;
}
.add-button:hover, .logout-button:hover, .save-button:hover, .pagination-button:hover, .delete-button:hover, .settings-button:hover {
  background: #1f2937 !important;
  border-color: #4b5563 !important;
}

.badge-pair { display:flex; flex-direction:column; gap:4px; align-items:center; justify-content:center; }
.tiny-badge {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:36px;
  padding:4px 8px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
  text-decoration: none;
}
.tiny-badge.on { background:#1f8f49; color:#fff; }
.tiny-badge.off { background:#4b5563; color:#e5e7eb; }
.publication-badge { cursor: default; }

.site-publish-controls {
  --publication-pill-width: 72px;
  display: grid;
  gap: 5px;
}
.site-publish-controls .toggle-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--publication-pill-width);
}
.site-publish-controls .toggle-pill {
  box-sizing: border-box;
  width: var(--publication-pill-width);
  min-width: var(--publication-pill-width);
}
.yandex-feed-control { display: grid; gap: 3px; }
.yandex-feed-note {
  margin: 0;
  color: #768093;
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
}

.site-visibility-note {
  margin: 0;
  color: #f0b35a;
  font-size: 12px;
  line-height: 1.4;
  text-align: left;
}

.availability-cell.unavailable {
  background: #5b1d2c !important;
  color: #ffe4ea;
}

/* Main-site visual tone */
body {
  background: #0f172a !important;
  color: #e5e7eb;
}

header.top-nav {
  background: #111827 !important;
  border-bottom: 1px solid #1f2937;
  padding: 12px 18px;
}

.container {
  background: transparent;
}

.grid-filters {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin: 8px 0 14px;
}

.pager-row {
  display: flex;
  justify-content: center;
  width: 100%;
  margin: 10px 0 14px;
  clear: both;
}

.site-pagination {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.page-counter {
  background: #111827;
  border: 1px solid #374151;
  border-radius: 999px;
  color: #e5e7eb;
  padding: 8px 12px;
  font-size: 14px;
}

table thead tr { background: #111827 !important; }
table th, table td { border-color: #243041 !important; }
table tbody tr:nth-child(odd) { background: #121a2a !important; }
table tbody tr:nth-child(even) { background: #0f172a !important; }
table tr:hover { background: #162238 !important; transform:none !important; box-shadow:none !important; }

/* Layout tune per request */
main.container {
  width: 95vw;
  max-width: 95vw;
  margin: 0 auto;
}

.grid-filters { margin-top: 14px; margin-bottom: 12px; }

#sortable-table {
  width: 100%;
  margin: 0 auto;
}

/* Safari dropdown + pager parity */
.site-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #9ca3af 50%), linear-gradient(135deg, #9ca3af 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 30px;
}

.site-pagination .pagination-button {
  min-width: 38px;
  height: 36px;
  padding: 0 10px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.site-pagination .pagination-button.active {
  background: #374151 !important;
  border-color: #6b7280 !important;
}

/* Upload modal UX refresh */
.add-painting-modal-content {
  width: min(620px, 94vw) !important;
  max-width: 94vw !important;
  max-height: 92vh;
  display: block !important;
  padding: 20px;
  border: 1px solid #334155;
  border-radius: 16px;
  background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
  box-shadow: 0 24px 56px rgba(0, 0, 0, .5);
}

.add-painting-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.add-painting-subtitle {
  margin: 2px 0 4px;
  color: #cbd5e1;
  font-size: 14px;
  line-height: 1.5;
}

.upload-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.upload-rule-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .2px;
  color: #dbeafe;
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(96, 165, 250, 0.35);
}

.upload-dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 190px;
  padding: 18px;
  border-radius: 14px;
  border: 1.5px dashed #475569;
  background: radial-gradient(120% 120% at 50% 0%, rgba(30, 41, 59, .9), rgba(15, 23, 42, .92));
  cursor: pointer;
  transition: border-color .2s ease, box-shadow .2s ease, transform .15s ease;
}

.upload-dropzone:hover {
  border-color: #64748b;
  box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.2);
}

.upload-dropzone.drag-over {
  border-color: #60a5fa;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, .25);
  transform: translateY(-1px);
}

.upload-dropzone input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-drop-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.16);
  border: 1px solid rgba(96, 165, 250, 0.32);
}

.upload-drop-label {
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  color: #f8fafc;
}

.upload-drop-hint {
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
}

.upload-selected-file {
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(15, 23, 42, 0.64);
}

.upload-selected-file.has-file {
  border-color: #3b82f6;
  background: rgba(30, 58, 138, 0.2);
}

.upload-selected-file-name {
  color: #e2e8f0;
  font-weight: 600;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-selected-file-meta {
  margin-top: 3px;
  color: #94a3b8;
  font-size: 12px;
}

.upload-progress {
  display: flex;
  align-items: center;
  gap: 10px;
}

.upload-progress-track {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #1e293b;
  border: 1px solid #334155;
}

.upload-progress-bar {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #3b82f6, #22d3ee);
  transition: width .22s ease;
}

.upload-progress-text {
  min-width: 42px;
  text-align: right;
  color: #bfdbfe;
  font-weight: 700;
  font-size: 13px;
}

#submitAddPaintingButton:disabled {
  opacity: .55;
  cursor: not-allowed;
}

/* Painting edit tabs: language-specific fields and independent image replicas. */
#paintingModal { --painting-modal-height: 60vh; }
#paintingModal .modal-content { width: min(1240px, 96vw); height: var(--painting-modal-height); max-height: var(--painting-modal-height); overflow: hidden; }
#paintingModal .modal-body { flex-wrap: nowrap; align-items: flex-start; height: 100%; min-height: 0; }
#paintingModal .modal-left { flex: 0 0 25%; height: 100%; min-height: 0; overflow-y: auto; box-sizing: border-box; }
#paintingModal .modal-right { width: 75%; min-width: 0; height: 100%; min-height: 0; }
#paintingModal .painting-details { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-right: 4px; box-sizing: border-box; }
#paintingModal .modal-actions { flex: 0 0 auto; }
.painting-modal-tabs { display: flex; gap: 8px; margin-bottom: 16px; padding-right: 36px; box-sizing: border-box; border-bottom: 1px solid #3a3a3a; }
.painting-modal-tab { border: 0; border-bottom: 2px solid transparent; background: transparent; color: #aeb4bd; padding: 9px 12px; font: inherit; font-weight: 700; cursor: pointer; }
.painting-modal-tab:hover, .painting-modal-tab.is-active { color: #f4f4f5; border-bottom-color: #ff4c4c; }
#paintingModalBody[data-active-tab="en"] .painting-details,
#paintingModalBody[data-active-tab="ru"] .painting-details { display: flex; flex-direction: column; gap: 14px; }
#paintingModalBody[data-active-tab="en"] .painting-details .attribute,
#paintingModalBody[data-active-tab="ru"] .painting-details .attribute { width: 100%; }
#paintingModalBody[data-active-tab="en"] .painting-details .attribute[data-field-id="description"],
#paintingModalBody[data-active-tab="ru"] .painting-details .attribute[data-field-id="description_ru"] { flex: 1 1 auto; min-height: 0; }
#paintingModalBody[data-active-tab="en"] .painting-details .attribute[data-field-id="description"] textarea,
#paintingModalBody[data-active-tab="ru"] .painting-details .attribute[data-field-id="description_ru"] textarea { min-height: 30vh; height: 100%; }
#paintingModalBody[data-active-tab="attributes"] .painting-details { align-content: start; align-items: start; }
.image-tier-panel { display: none; width: 100%; box-sizing: border-box; overflow-y: auto; }
#paintingModalBody[data-active-tab="images"] .painting-details { display: none; }
#paintingModalBody[data-active-tab="images"] .image-tier-panel { display: block; }
#paintingModalBody[data-active-tab="en"] .attribute[data-field-locale="ru"],
#paintingModalBody[data-active-tab="en"] .attribute[data-field-locale="attributes"],
#paintingModalBody[data-active-tab="ru"] .attribute[data-field-locale="en"],
#paintingModalBody[data-active-tab="ru"] .attribute[data-field-locale="attributes"],
#paintingModalBody[data-active-tab="attributes"] .attribute[data-field-locale="en"],
#paintingModalBody[data-active-tab="attributes"] .attribute[data-field-locale="ru"] { display: none; }
.image-tier-intro { margin: 0 0 12px; color: #b7bdc7; font-size: 13px; }
.image-tier-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.image-tier-card { min-width: 0; margin: 0; padding: 10px; border: 1px solid #3a3a3a; border-radius: 10px; background: #202020; }
.image-tier-frame { position: relative; display: grid; place-items: center; height: calc(min(24.2vh, 209px) + 10px); overflow: hidden; border-radius: 7px; background-color: #111; background-repeat: no-repeat; background-position: center; background-size: contain; }
.image-tier-frame img { visibility: hidden; position: absolute; inset: 0; width: 100%; height: 100%; }
.image-tier-card figcaption { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.image-tier-details { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.image-tier-label { color: #e5e7eb; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; font-weight: 800; }
.image-tier-metadata { color: #aeb4bd; font-size: 11px; white-space: nowrap; }
.image-tier-controls { display: flex; gap: 6px; }
.image-tier-rotate { width: 34px; height: 34px; font-size: 19px; }
.image-tier-rotate:disabled { cursor: wait; opacity: .5; }
@media (max-width: 680px) {
  #paintingModal .modal-content { height: 90vh; max-height: 90vh; overflow-y: auto; }
  #paintingModal .modal-body { flex-wrap: wrap; height: auto; }
  #paintingModal .modal-left, #paintingModal .modal-right { flex: 0 0 100%; width: 100%; height: auto; overflow: visible; }
  #paintingModal .painting-details { overflow: visible; }
  .image-tier-grid { grid-template-columns: 1fr; }
}

