/* ==========================================================================
   24 ГРАДУСА — ADMIN CMS STYLES
   ========================================================================== */

:root {
  --adm-bg: #f4f7f9;
  --adm-card-bg: #ffffff;
  --adm-border: rgba(22, 78, 135, 0.12);
  --adm-border-focus: #3caec9;
  --adm-text-main: #0c1926;
  --adm-text-muted: #5e6d7d;
  --adm-brand-blue: #164e87;
  --adm-brand-blue-hover: #113c68;
  --adm-brand-cyan: #3caec9;
  --adm-brand-ice: #edf7fa;
  --adm-success: #27ae60;
  --adm-warning: #f39c12;
  --adm-danger: #e74c3c;
  --adm-radius: 12px;
  --adm-radius-sm: 8px;
  --adm-radius-lg: 16px;
  --adm-shadow: 0 4px 20px rgba(12, 25, 38, 0.05);
  --adm-shadow-md: 0 8px 30px rgba(12, 25, 38, 0.08);
  --adm-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--adm-font);
  background-color: var(--adm-bg);
  color: var(--adm-text-main);
  line-height: 1.5;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* AUTH / LOGIN SCREEN */
.adm-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 20%, #e0f2f7 0%, #f4f7f9 70%);
}

.adm-login-card {
  width: 100%;
  max-width: 420px;
  background: var(--adm-card-bg);
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius-lg);
  padding: 40px;
  box-shadow: var(--adm-shadow-md);
  text-align: center;
}

.adm-login-logo {
  max-width: 190px;
  height: auto;
  margin: 0 auto 20px;
  display: block;
}

.adm-login-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--adm-brand-blue);
  margin-bottom: 6px;
}

.adm-login-sub {
  font-size: 13px;
  color: var(--adm-text-muted);
  margin-bottom: 28px;
}

/* TOPBAR */
.adm-topbar {
  background: #ffffff;
  border-bottom: 1px solid var(--adm-border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.adm-topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.adm-brand-box {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.adm-logo-img {
  height: 38px;
  width: auto;
}

.adm-brand-tag {
  background: var(--adm-brand-ice);
  color: var(--adm-brand-blue);
  border: 1px solid rgba(22, 78, 135, 0.2);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.adm-topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.adm-status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--adm-success);
  padding: 6px 12px;
  background: #edfbf2;
  border-radius: 20px;
  border: 1px solid rgba(39, 174, 96, 0.2);
  transition: all 0.2s ease;
}

.adm-status-indicator.saving {
  color: var(--adm-warning);
  background: #fff8e6;
  border-color: rgba(243, 156, 18, 0.3);
}

.adm-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

/* NAVIGATION TABS */
.adm-nav-wrap {
  background: #ffffff;
  border-bottom: 1px solid var(--adm-border);
}

.adm-nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
}

.adm-tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--adm-text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.adm-tab-btn:hover {
  color: var(--adm-brand-blue);
  background: rgba(22, 78, 135, 0.03);
}

.adm-tab-btn.active {
  color: var(--adm-brand-blue);
  border-bottom-color: var(--adm-brand-blue);
  font-weight: 700;
}

.adm-tab-badge {
  background: var(--adm-brand-ice);
  color: var(--adm-brand-blue);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}

/* LAYOUT & MAIN CONTAINER */
.adm-container {
  max-width: 1400px;
  margin: 28px auto;
  padding: 0 24px 80px;
}

.adm-panel {
  display: none;
}

.adm-panel.active {
  display: block;
}

.adm-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.adm-panel-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--adm-text-main);
}

.adm-panel-desc {
  font-size: 13px;
  color: var(--adm-text-muted);
  margin-top: 4px;
}

/* BUTTONS */
.adm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--adm-radius-sm);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.adm-btn-primary {
  background: var(--adm-brand-blue);
  color: #ffffff;
}

.adm-btn-primary:hover {
  background: var(--adm-brand-blue-hover);
  box-shadow: 0 4px 12px rgba(22, 78, 135, 0.25);
}

.adm-btn-cyan {
  background: var(--adm-brand-cyan);
  color: #ffffff;
}

.adm-btn-cyan:hover {
  background: #329bb4;
}

.adm-btn-secondary {
  background: #ffffff;
  color: var(--adm-text-main);
  border-color: var(--adm-border);
}

.adm-btn-secondary:hover {
  background: var(--adm-bg);
  border-color: var(--adm-text-muted);
}

.adm-btn-danger {
  background: #ffffff;
  color: var(--adm-danger);
  border-color: rgba(231, 76, 60, 0.3);
}

.adm-btn-danger:hover {
  background: var(--adm-danger);
  color: #ffffff;
}

.adm-btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
}

/* CARDS */
.adm-card {
  background: var(--adm-card-bg);
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius);
  padding: 24px;
  box-shadow: var(--adm-shadow);
  margin-bottom: 24px;
}

.adm-card-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--adm-brand-blue);
}

/* FORMS & INPUTS */
.adm-form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.adm-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.adm-field label {
  font-size: 12px;
  font-weight: 700;
  color: var(--adm-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.adm-input,
.adm-select,
.adm-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius-sm);
  background: #ffffff;
  font-family: inherit;
  font-size: 14px;
  color: var(--adm-text-main);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.adm-input:focus,
.adm-select:focus,
.adm-textarea:focus {
  border-color: var(--adm-brand-cyan);
  box-shadow: 0 0 0 3px rgba(60, 174, 201, 0.15);
}

.adm-textarea {
  min-height: 90px;
  resize: vertical;
}

.adm-field-hint {
  font-size: 11px;
  color: var(--adm-text-muted);
  margin-top: 2px;
}

/* PRODUCTS GRID */
.adm-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.adm-product-card {
  background: #ffffff;
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--adm-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.adm-product-card:hover {
  box-shadow: var(--adm-shadow-md);
  border-color: rgba(60, 174, 201, 0.3);
}

.adm-product-img-box {
  height: 190px;
  background: #fdfdfd;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border-bottom: 1px solid var(--adm-border);
}

.adm-product-img-box img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}

.adm-product-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.adm-product-tag.cyan {
  background: var(--adm-brand-cyan);
  color: #ffffff;
}

.adm-product-tag.dark {
  background: var(--adm-text-main);
  color: #ffffff;
}

.adm-product-body {
  padding: 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.adm-product-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
}

.adm-product-price {
  font-size: 16px;
  font-weight: 800;
  color: var(--adm-brand-blue);
  margin-bottom: 12px;
}

.adm-product-specs-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: var(--adm-bg);
  padding: 10px;
  border-radius: 8px;
  font-size: 11px;
  margin-bottom: 16px;
}

.adm-product-actions {
  margin-top: auto;
  display: flex;
  gap: 8px;
  border-top: 1px solid var(--adm-border);
  padding-top: 14px;
}

/* GALLERY GRID */
.adm-gallery-dropzone {
  border: 2px dashed rgba(22, 78, 135, 0.3);
  background: var(--adm-brand-ice);
  border-radius: var(--adm-radius);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 24px;
}

.adm-gallery-dropzone:hover,
.adm-gallery-dropzone.dragover {
  border-color: var(--adm-brand-cyan);
  background: #e0f4f9;
}

.adm-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.adm-gallery-item {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: var(--adm-radius-sm);
  overflow: hidden;
  border: 1px solid var(--adm-border);
  background: #000000;
}

.adm-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.adm-gallery-item:hover img {
  transform: scale(1.05);
  opacity: 0.85;
}

.adm-gallery-del-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(231, 76, 60, 0.9);
  color: #ffffff;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  opacity: 0;
  transition: all 0.2s ease;
}

.adm-gallery-item:hover .adm-gallery-del-btn {
  opacity: 1;
}

.adm-gallery-del-btn:hover {
  background: var(--adm-danger);
  transform: scale(1.1);
}

/* REVIEWS */
.adm-reviews-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.adm-review-card {
  background: #ffffff;
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius);
  padding: 20px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.adm-review-main {
  flex: 1;
}

.adm-review-author {
  font-size: 15px;
  font-weight: 700;
}

.adm-review-meta {
  font-size: 12px;
  color: var(--adm-text-muted);
  margin-top: 2px;
  margin-bottom: 8px;
}

.adm-review-stars {
  color: #f1c40f;
  font-size: 16px;
  margin-bottom: 10px;
}

.adm-review-text {
  font-size: 13px;
  line-height: 1.6;
  color: #2c3e50;
}

.adm-review-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* SERVICES */
.adm-services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
}

.adm-service-card {
  background: #ffffff;
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
}

/* MODAL */
.adm-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 25, 38, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.adm-modal-backdrop.active {
  display: flex;
}

.adm-modal-box {
  background: #ffffff;
  border-radius: var(--adm-radius-lg);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--adm-shadow-md);
  animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.adm-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--adm-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.adm-modal-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--adm-brand-blue);
}

.adm-modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--adm-text-muted);
  cursor: pointer;
  padding: 4px;
}

.adm-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.adm-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--adm-border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: var(--adm-bg);
  border-radius: 0 0 var(--adm-radius-lg) var(--adm-radius-lg);
}

/* TOAST NOTIFICATION */
.adm-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 3000;
}

.adm-toast {
  background: var(--adm-text-main);
  color: #ffffff;
  padding: 12px 20px;
  border-radius: var(--adm-radius-sm);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  animation: toastSlideIn 0.25s ease;
}

.adm-toast.success {
  background: #1b5e20;
}

.adm-toast.error {
  background: #c62828;
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

/* PREVIEW UPLOAD THUMBNAIL */
.adm-thumb-preview {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  border: 1px solid var(--adm-border);
  object-fit: contain;
  background: #f9f9f9;
}
