/* Админ-панель ДEMETRA — в одной линии с основным сайтом */

.admin-body {
  font-family: "Inter", sans-serif;
  margin: 0;
  min-height: 100vh;
  background: var(--admin-bg);
  color: #2d2d2d;
  --admin-bg: #eef1ec;
  --admin-sidebar: #1e2419;
  --admin-sidebar-hover: #2a3224;
  --admin-accent: #d4a574;
  --admin-border: rgba(0, 0, 0, 0.08);
  --admin-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.admin-app {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--admin-sidebar);
  color: #e8ebe6;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  align-self: flex-start;
  min-height: 100vh;
  z-index: 1020;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
}

.admin-sidebar-brand {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-sidebar-brand a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.admin-sidebar-brand .logo-img {
  width: 44px;
  height: 44px;
}

.admin-sidebar-title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0;
  line-height: 1.2;
  color: #fff;
}

.admin-sidebar-sub {
  font-size: 0.7rem;
  opacity: 0.55;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.2rem;
}

.admin-nav {
  padding: 1rem 0.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.admin-nav-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.4);
  padding: 0.5rem 0.75rem 0.35rem;
}

.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.admin-nav-link:hover {
  background: var(--admin-sidebar-hover);
  color: #fff;
}

.admin-nav-link.active {
  background: linear-gradient(90deg, rgba(212, 165, 116, 0.22), transparent);
  color: var(--admin-accent);
  border-left: 3px solid var(--admin-accent);
  margin-left: -3px;
  padding-left: calc(0.85rem + 3px);
}

.admin-nav-icon {
  width: 20px;
  height: 20px;
  opacity: 0.9;
  flex-shrink: 0;
}

.admin-sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
}

.admin-sidebar-footer a {
  color: var(--admin-accent);
  text-decoration: none;
}

.admin-sidebar-footer a:hover {
  text-decoration: underline;
}

/* Main column */
.admin-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.admin-topbar {
  background: #fff;
  border-bottom: 1px solid var(--admin-border);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 1010;
  box-shadow: var(--admin-shadow);
}

.admin-topbar-title {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0;
  color: #1a1a1a;
}

.admin-breadcrumb {
  font-size: 0.8rem;
  color: #6c757d;
  margin: 0.15rem 0 0;
}

.admin-topbar-date {
  font-size: 0.8rem;
  color: #6c757d;
  max-width: 220px;
  text-align: right;
  line-height: 1.3;
  text-transform: capitalize;
}

.admin-notify-wrap {
  position: relative;
}

.admin-notify-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  background: #fff;
  color: #444;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.admin-notify-btn:hover {
  background: #f8f9f7;
  border-color: rgba(212, 165, 116, 0.45);
  color: #1a1a1a;
}

.admin-notify-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #c45c4a;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.admin-notify-menu {
  min-width: 280px;
  padding-top: 0.35rem;
  border-radius: 12px;
  border: 1px solid var(--admin-border);
}

.admin-notify-item {
  font-size: 0.85rem;
  white-space: normal;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.admin-topbar-spacer {
  flex: 1;
  min-width: 8px;
}

.admin-search {
  position: relative;
  min-width: 200px;
  max-width: 320px;
  flex: 1;
}

.admin-search input {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2.25rem;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  font-size: 0.875rem;
  background: #f8f9f7;
}

.admin-search input:focus {
  outline: none;
  border-color: rgba(212, 165, 116, 0.6);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.2);
}

.admin-search-icon {
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.45;
  pointer-events: none;
  font-size: 0.9rem;
}

.admin-user {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.5rem 0.35rem 0.35rem;
  border-radius: 999px;
  background: #f3f5f1;
  border: 1px solid var(--admin-border);
}

.admin-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3d4a35, #5a6b4f);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.admin-user-meta {
  line-height: 1.2;
  padding-right: 0.35rem;
}

.admin-user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #333;
}

.admin-user-role {
  font-size: 0.7rem;
  color: #888;
}

.admin-btn-logout {
  padding: 0.45rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid var(--admin-border);
  background: #fff;
  color: #444;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.admin-btn-logout:hover {
  background: #fafafa;
  border-color: #ccc;
  color: #222;
}

.admin-content {
  padding: 1.5rem;
  flex: 1;
}

.admin-page-head {
  margin-bottom: 1.25rem;
}

.admin-page-head h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
  color: #1a1a1a;
}

.admin-page-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.admin-page-head-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.admin-btn-icon {
  padding: 0.45rem 0.55rem;
}

.admin-page-lead {
  margin: 0;
  font-size: 0.9rem;
  color: #666;
  max-width: 52rem;
}

/* Stat cards */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.admin-stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.1rem 1.15rem;
  border: 1px solid var(--admin-border);
  box-shadow: var(--admin-shadow);
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.admin-stat-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.admin-stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  flex-shrink: 0;
}

.admin-stat-icon svg {
  display: block;
}

.admin-stat-icon--new {
  background: rgba(90, 141, 90, 0.15);
  color: #2d5a2d;
}

.admin-stat-icon--work {
  background: rgba(184, 134, 11, 0.15);
  color: #8a6500;
}

.admin-stat-icon--cat {
  background: rgba(107, 90, 58, 0.12);
  color: #5c4d32;
}

.admin-stat-icon--doc {
  background: rgba(55, 90, 120, 0.12);
  color: #375a78;
}

.admin-stat-trend {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
}

.admin-stat-trend--up {
  background: rgba(90, 141, 90, 0.18);
  color: #2d5a2d;
}

.admin-stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888;
  margin-bottom: 0.35rem;
}

.admin-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.2;
}

.admin-stat-hint {
  font-size: 0.75rem;
  color: #5a8d5a;
  margin-top: 0.35rem;
}

.admin-stat-hint--warn {
  color: #b8860b;
}

/* Panels */
.admin-panel {
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--admin-border);
  box-shadow: var(--admin-shadow);
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.admin-panel-header {
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.admin-panel-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  color: #222;
}

.admin-panel-badge {
  margin-left: auto;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6c757d;
  background: #f0f2ed;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
}

.admin-panel-tools {
  margin-left: auto;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.admin-btn {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.admin-btn-primary {
  background: linear-gradient(180deg, #c9a06a, #b8945f);
  color: #1a1408;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.admin-btn-primary:hover {
  filter: brightness(1.05);
  color: #1a1408;
}

.admin-btn-ghost {
  background: #f3f5f1;
  color: #444;
  border: 1px solid var(--admin-border);
}

.admin-btn-ghost:hover {
  background: #e8ebe6;
  color: #222;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  margin: 0;
  font-size: 0.875rem;
}

.admin-table thead th {
  background: #f6f8f4;
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #666;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--admin-border);
  white-space: nowrap;
}

.admin-table tbody td {
  padding: 0.75rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--admin-border);
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

.admin-table tbody tr:hover {
  background: #fafbf9;
}

.admin-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-badge--new {
  background: #e3f0e3;
  color: #2d5a2d;
}

.admin-badge--proc {
  background: #fff3e0;
  color: #9a6b00;
}

.admin-badge--done {
  background: #e8e8e8;
  color: #555;
}

.admin-link-action {
  color: #6b5a3a;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.8rem;
}

.admin-link-action:hover {
  text-decoration: underline;
  color: #4a3d28;
}

.admin-two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.admin-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}

.admin-activity {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0 0.25rem;
}

.admin-activity-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 1.15rem;
  border-bottom: 1px solid var(--admin-border);
}

.admin-activity-item:last-child {
  border-bottom: none;
}

.admin-activity-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 0.35rem;
  flex-shrink: 0;
}

.admin-activity-dot--ok {
  background: #5a8d5a;
  box-shadow: 0 0 0 3px rgba(90, 141, 90, 0.2);
}

.admin-activity-dot--muted {
  background: #adb5bd;
}

.admin-activity-dot--warn {
  background: #c9a227;
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.22);
}

.admin-activity-body {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.admin-activity-text {
  margin: 0;
  font-size: 0.875rem;
  color: #333;
  line-height: 1.4;
}

.admin-activity-time {
  font-size: 0.72rem;
  color: #888;
  white-space: nowrap;
}

.admin-footer {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--admin-border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: #888;
}

.admin-footer-meta {
  opacity: 0.85;
}

/* Toolbar (filters) */
.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.admin-toolbar-select {
  max-width: 200px;
  border-radius: 8px;
  border-color: var(--admin-border);
}

.admin-toolbar-search {
  flex: 1;
  min-width: 180px;
  max-width: 420px;
  border-radius: 8px;
  border-color: var(--admin-border);
}

/* Forms inside admin panels */
.admin-form {
  padding: 1rem 1.15rem 1.25rem;
}

@media (min-width: 768px) {
  .admin-form {
    padding: 1.25rem 1.5rem 1.5rem;
  }
}

.admin-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #444;
  margin-bottom: 0.35rem;
}

.admin-input:focus,
.admin-textarea:focus {
  border-color: rgba(212, 165, 116, 0.55);
  box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.2);
}

.admin-textarea {
  min-height: 96px;
  resize: vertical;
}

.admin-form-hint {
  font-size: 0.75rem;
  color: #888;
}

.admin-alert {
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.admin-alert--info {
  background: #e8f0fb;
  border: 1px solid rgba(55, 90, 120, 0.2);
  color: #2c4a62;
}

@media (max-width: 991.98px) {
  .admin-two-col {
    grid-template-columns: 1fr;
  }

  .admin-toolbar-search {
    max-width: none;
    width: 100%;
  }

  .admin-toolbar-select {
    max-width: none;
    width: 100%;
  }
}

.admin-quick-list {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
}

.admin-quick-list li {
  border-bottom: 1px solid var(--admin-border);
}

.admin-quick-list li:last-child {
  border-bottom: none;
}

.admin-quick-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.15rem;
  color: #333;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.12s;
}

.admin-quick-list a:hover {
  background: #f8f9f7;
}

.admin-quick-list span {
  color: #999;
  font-size: 0.8rem;
}

/* Mobile sidebar toggle */
.admin-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: #fff;
  color: #333;
  padding: 0;
}

.admin-offcanvas .offcanvas-header {
  border-bottom: 1px solid var(--admin-border);
}

.admin-offcanvas .admin-nav {
  padding-top: 0.5rem;
}

.admin-offcanvas .admin-nav-link {
  color: #333 !important;
}

.admin-offcanvas .admin-nav-link:hover {
  background: #eef1ec !important;
  color: #111 !important;
}

.admin-offcanvas .admin-nav-link.active {
  background: rgba(212, 165, 116, 0.2) !important;
  color: #4a3d28 !important;
  border-left: 3px solid var(--admin-accent);
  margin-left: 0;
}

.admin-offcanvas .admin-sidebar-brand a {
  color: inherit;
}

.admin-offcanvas .admin-sidebar-title {
  color: #1a1a1a;
}

.admin-offcanvas .admin-sidebar-sub {
  color: #6c757d;
  opacity: 1;
}

@media (max-width: 991.98px) {
  .admin-sidebar {
    display: none;
  }

  .admin-menu-toggle {
    display: inline-flex;
  }

  .admin-topbar-date {
    display: none;
  }

  .admin-search {
    max-width: none;
    order: 10;
    width: 100%;
    flex-basis: 100%;
  }

  .admin-notify-wrap {
    order: 2;
  }

  .admin-user {
    order: 3;
  }

  .admin-btn-logout {
    order: 4;
  }

  .admin-topbar {
    padding: 0.65rem 1rem;
  }

  .admin-content {
    padding: 1rem;
  }

  .admin-page-head-actions {
    width: 100%;
    justify-content: flex-end;
  }
}
