@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg-main: #f9f9f9;
  --header-footer: #97cbf9;
  --tab-active: #319eff;
  --text: #000000;
  --text-muted: #757575;
  --text-light: #ffffff;
  --btn-primary: #165a96;
  --btn-danger: #f07d88;
  --card-1: #97cbf9;
  --card-2: #ffb3ba;
  --card-3: #f9af97;
  --card-4: #f8d489;
  --card-5: #57d8cc;
  --card-6: #96bb94;
  --card-7: #ac97f9;
  --panel-border: #d0d0d0;
  --content-max: 1320px;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-main);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container-app {
  max-width: var(--content-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.site-header {
  background: transparent;
  border-bottom: 0;
}

.site-brand-bar {
  background: var(--header-footer);
  border: 1px solid #b8d8f1;
}

.site-header .header-top {
  min-height: 64px;
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

.site-header .brand-main {
  font-weight: 300;
  font-style: italic;
  font-size: 2rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.site-nav-frame {
  margin-top: 1rem;
  background: #e6f0f9;
  border-radius: 1rem;
  padding: 0.65rem 0.75rem;
}

.site-tools-bar {
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
  background: #e6f0f9;
  border-radius: 0.75rem;
  padding: 0.45rem 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.tools-bar-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-left: auto;
}

.tools-bar-greeting {
  text-align: left;
  line-height: 1.25;
}

.tools-bar-greeting .greeting-label,
.tools-bar-greeting .greeting-name {
  font-size: 1.05rem;
  font-weight: 300;
  font-style: italic;
  color: var(--text);
}

.tools-bar-greeting .greeting-label {
  margin-right: 0.35rem;
}

.site-tools-bar .tools-link {
  color: var(--text);
  font-weight: 500;
  font-size: 1rem;
  text-decoration: none;
}

.site-tools-bar .tools-link.active {
  color: var(--btn-primary);
  font-weight: 600;
}

.tools-link-trash {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.trash-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #000;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1;
}

.nav-tabs-custom {
  border-bottom: none;
  gap: 0.65rem;
  flex-wrap: nowrap;
  width: 100%;
  margin-bottom: 0;
}

.nav-tabs-custom .nav-item {
  padding: 0 0.2rem;
}

.nav-tabs-custom .nav-link {
  color: var(--text);
  border: none;
  border-radius: 0.7rem;
  padding: 0.55rem 0.85rem;
  font-size: 1.15rem;
  font-weight: 300;
  font-style: italic;
  text-align: center;
  background: transparent;
  width: 100%;
  white-space: nowrap;
}

.nav-tabs-custom .nav-link:hover {
  background: rgba(255, 255, 255, 0.45);
}

.nav-tabs-custom .nav-link.active {
  background: var(--tab-active);
  color: var(--text-light);
  font-weight: 300;
}

.site-footer {
  background: var(--header-footer);
  margin-top: auto;
  padding: 1rem 0;
  font-size: 0.9rem;
  border-top: 2px solid var(--tab-active);
}

main {
  flex: 1;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}

@media (min-width: 992px) {
  .page-title {
    font-size: 2rem;
  }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.85rem;
}

.stat-card {
  border: none;
  border-radius: 0.75rem;
  aspect-ratio: 3 / 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.5rem 0.4rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.stat-card .stat-label {
  font-size: clamp(0.95rem, 1.35vw, 1.15rem);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.2;
  margin-bottom: 0.55rem;
}

.stat-card .stat-value {
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  font-weight: 700;
  line-height: 1.05;
  color: #fff;
  margin-top: 0.1rem;
}

.stat-c-0 { background: var(--card-1); }
.stat-c-1 { background: var(--card-2); }
.stat-c-2 { background: var(--card-3); }
.stat-c-3 { background: var(--card-4); }
.stat-c-4 { background: var(--card-5); }
.stat-c-5 { background: var(--card-6); }
.stat-c-6 { background: var(--card-7); }

.btn-create {
  background: var(--btn-primary);
  border-color: var(--btn-primary);
  color: var(--text-light);
  font-weight: 600;
  border-radius: 0.5rem;
  padding: 0.55rem 1.25rem;
}

.btn-create:hover {
  background: #0f4578;
  border-color: #0f4578;
  color: var(--text-light);
}

.btn-cancel {
  background: var(--btn-danger);
  border-color: var(--btn-danger);
  color: var(--text-light);
  font-weight: 600;
  border-radius: 0.5rem;
}

.btn-cancel:hover {
  background: #d96570;
  border-color: #d96570;
  color: var(--text-light);
}

.view-mode-group .btn {
  border-color: var(--tab-active);
  color: var(--btn-primary);
  font-weight: 500;
}

.view-mode-group .btn-check:checked + .btn {
  background: var(--tab-active);
  border-color: var(--tab-active);
  color: var(--text-light);
}

.achievements-page {
  width: 100%;
  padding-bottom: 2rem;
}

.achievements-shell {
  background: #ced9e3;
  border-radius: 0.75rem;
  padding: 0.5rem;
}

.achievements-segment {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
}

.view-mode-group.achievements-segment .btn {
  border: 0;
  border-radius: 0.5rem 0.5rem 0 0;
  background: transparent;
  color: #1f1f1f;
  font-size: 2rem;
  font-weight: 300;
  font-style: italic;
  padding: 0.6rem 0.75rem;
  text-align: center;
}

.view-mode-group.achievements-segment .btn-check:checked + .btn {
  background: var(--tab-active);
  color: #fff;
  font-weight: 300;
}

.filters-toolbar {
  background: #cfd9e3;
  border-radius: 0 0 0.6rem 0.6rem;
  padding: 0.65rem;
}

.filters-toolbar-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1.4fr 0.7fr;
  gap: 0.65rem;
  align-items: stretch;
}

.filters-toolbar .form-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.filters-toolbar .search-wrap {
  width: 100%;
}

.filters-toolbar .search-wrap .form-control {
  border: 0;
  border-radius: 0.45rem 0 0 0.45rem;
}

.filters-toolbar .search-wrap .input-group-text {
  border: 0;
  border-radius: 0 0.45rem 0.45rem 0;
  background: #fff;
}

.filters-toolbar .filter-select,
.filters-toolbar .filter-year {
  width: 100%;
  border: 0;
  border-radius: 0.45rem;
  background-color: #fff;
  min-height: 2.5rem;
}

/* Выпадающие списки — визуально отличаются от текстовых полей */
select.app-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  padding-right: 2.35rem !important;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1.5 7 7.5 13 1.5' fill='none' stroke='%23165a96' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"),
    linear-gradient(to left, #dce4ec 2.1rem, transparent 2.1rem);
  background-repeat: no-repeat, no-repeat;
  background-position: right 0.65rem center, right top;
  background-size: 14px 9px, 2.1rem 100%;
}

select.app-select:hover {
  background-color: #f8fbff;
}

select.app-select:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(22, 90, 150, 0.25);
}

.achievement-card {
  border-radius: 0.6rem;
  border: 1px solid #7ab9ef;
  background: #b9dcf7;
  transition: box-shadow 0.2s;
  min-height: 340px;
  display: flex;
  flex-direction: column;
}

.achievement-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.35rem 0.75rem 0.65rem;
  min-height: 0;
}

.achievement-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0.5rem 0;
}

.ach-icon-btn {
  border: none;
  background: transparent;
  color: #6b6b6b;
  font-size: 1.2rem;
  line-height: 1;
  cursor: default;
  padding: 0;
}

.ach-icon-btn.btn-trash,
.ach-icon-btn.btn-edit {
  cursor: pointer;
}

.achievement-mark-box {
  width: 112px;
  height: 112px;
  border: 2px solid #3094ff;
  border-radius: 0.55rem;
  background: #fff;
  margin: 0.15rem auto 0.55rem;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.achievement-mark-letter {
  font-size: 3.1rem;
  font-weight: 500;
}

.app-icon {
  display: block;
  object-fit: contain;
}

.app-icon-notification,
.app-icon-action {
  width: 2.35rem;
  height: 2.35rem;
  min-width: 2.35rem;
  min-height: 2.35rem;
}

.app-icon-delete {
  width: 2.7rem;
  height: 2.7rem;
  min-width: 2.7rem;
  min-height: 2.7rem;
}

.app-icon-status-mark {
  position: absolute;
  top: -11px;
  right: -11px;
  width: 2.55rem;
  height: 2.55rem;
  min-width: 2.55rem;
  min-height: 2.55rem;
}

.app-icon-status-approved {
  width: 2.85rem;
  height: 2.85rem;
  min-width: 2.85rem;
  min-height: 2.85rem;
  top: -12px;
  right: -12px;
}

.app-icon-search {
  width: 1.5rem;
  height: 1.5rem;
}

.icon-slot-search {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  background: #fff;
  border: 0;
}

.ach-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.35rem;
  min-height: 2.35rem;
}

.ach-icon-btn.btn-trash,
.ach-icon-btn.btn-edit {
  min-width: 2.7rem;
  min-height: 2.7rem;
}

.ach-icon-btn-disabled {
  display: inline-block;
  min-width: 2.7rem;
  min-height: 2.7rem;
  visibility: hidden;
}

.achievement-info {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 0;
  padding: 0 0.15rem;
}

.achievement-title {
  font-style: italic;
  font-weight: 300;
  text-align: center;
  line-height: 1.12;
  margin-bottom: 0.35rem;
  width: 100%;
  word-break: break-word;
  hyphens: auto;
}

.achievement-title.title-xl { font-size: 1.65rem; }
.achievement-title.title-lg { font-size: 1.4rem; }
.achievement-title.title-md { font-size: 1.2rem; }
.achievement-title.title-sm { font-size: 1.05rem; }
.achievement-title.title-xs { font-size: 0.9rem; line-height: 1.18; }

.achievement-status-wrap {
  margin-bottom: 0.35rem;
}

.achievement-meta {
  text-align: center;
  color: #333;
  font-size: 0.92rem;
  line-height: 1.2;
  margin-bottom: 0.2rem;
}

.achievement-meta-last {
  margin-bottom: 0.45rem;
}

.achievement-details-btn {
  border: 1px solid #3394ef;
  background: #fff;
  color: #3b3b3b;
  border-radius: 999px;
  font-size: 0.78rem;
  padding: 0.28rem 0.95rem;
  display: block;
  margin: 0;
  flex-shrink: 0;
  margin-top: auto;
}

.add-achievement-sticky-wrap {
  position: sticky;
  bottom: 0.75rem;
  z-index: 20;
  padding: 1.25rem 0 0.5rem;
  margin-top: 1rem;
  pointer-events: none;
}

.add-achievement-sticky-wrap .add-achievement-btn {
  pointer-events: auto;
}

.add-achievement-btn.btn-create {
  border-radius: 0.45rem;
  min-width: 300px;
  font-style: italic;
  font-size: 1.5rem;
  font-weight: 300;
  padding: 0.4rem 1.5rem;
  box-shadow: 0 6px 20px rgba(22, 90, 150, 0.35);
}

.achievement-card:hover {
  box-shadow: 0 6px 16px rgba(22, 90, 150, 0.12);
}

.badge-status-pending { background: #97cbf9; color: #000; font-weight: 500; }
.badge-status-approved { background: #96bb94; color: #000; font-weight: 500; }
.badge-status-rejected { background: #ffb3ba; color: #000; font-weight: 500; }

@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .filters-toolbar-grid {
    grid-template-columns: 1fr 1fr;
  }
  .nav-tabs-custom .nav-link {
    font-size: 1rem;
  }
  .view-mode-group.achievements-segment .btn {
    font-size: 1.3rem;
  }
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .filters-toolbar-grid {
    grid-template-columns: 1fr;
  }
}

.notification-bell {
  position: relative;
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  font-size: 0.65rem;
}

.notification-dropdown {
  width: 320px;
  max-height: 400px;
  overflow-y: auto;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, var(--header-footer) 0%, var(--bg-main) 50%);
}

.login-card {
  max-width: 440px;
  width: 100%;
  border-radius: 1rem;
  border: none;
  background: #fff;
  box-shadow: 0 12px 32px rgba(22, 90, 150, 0.18);
}

.login-card .login-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--btn-primary);
}

.login-card .login-heading {
  font-size: 1.75rem;
  font-weight: 700;
}

.chart-panel,
.profile-card,
.content-panel {
  background: #fff;
  border-radius: 0.75rem;
  padding: 1.25rem;
  border: 1px solid var(--panel-border);
}

.profile-section-title {
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--header-footer);
}

.nav-reports-tabs .nav-link {
  font-weight: 600;
  color: var(--text);
}

.nav-reports-tabs .nav-link.active {
  background: var(--tab-active);
  color: var(--text-light);
}

.stat-view-tabs .nav-link {
  font-weight: 600;
  color: var(--btn-primary);
}

.stat-view-tabs .nav-link.active {
  background: var(--tab-active);
  color: var(--text-light);
}

/* —— Страница «Статистика» (вровень с панелью навигации) —— */
.statistics-page {
  width: 100%;
  padding-bottom: 1.5rem;
}

.statistics-frame {
  width: 100%;
  max-width: 100%;
  background: #e6f0f9;
  border-radius: 1rem;
  padding: 0.65rem 0.75rem;
  box-sizing: border-box;
}

.statistics-toolbar-shell {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.statistics-frame .achievements-shell {
  width: 100%;
  box-sizing: border-box;
}

.statistics-body {
  margin-top: 0.75rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.filters-toolbar-statistics {
  width: 100%;
  min-height: 4.25rem;
  box-sizing: border-box;
}

.stat-filters-panel--charts {
  display: grid;
  grid-template-columns: 32% 68%;
  gap: 0.65rem;
  align-items: end;
  width: 100%;
}

.stat-filters-panel--charts .stat-filter-field {
  min-width: 0;
  width: 100%;
}

.stat-filters-panel--charts .stat-filter-visibility {
  align-self: stretch;
}

.stat-filters-panel--charts,
.stat-filters-panel--tables {
  width: 100%;
  max-width: 100%;
  min-height: 3.85rem;
  box-sizing: border-box;
}

.stat-filters-panel--tables {
  display: flex;
  align-items: flex-end;
}

.stat-filters-panel--tables .stat-filter-field {
  width: 100%;
  min-width: 0;
}

.stat-filters-panel--tables .stat-filter-visibility {
  width: 100%;
}

.stat-filters-panel--tables .stat-show-group {
  width: 100%;
  justify-content: flex-start;
  box-sizing: border-box;
}

.stat-filter-field .form-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
  font-weight: 500;
}

.stat-filter-field .filter-select {
  width: 100%;
  border: 0;
  border-radius: 0.45rem;
  background-color: #fff;
  min-height: 2.5rem;
}

.stat-show-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  width: 100%;
  min-height: 2.5rem;
  align-items: center;
  padding: 0.35rem 0.65rem;
  background: #fff;
  border-radius: 0.45rem;
  box-sizing: border-box;
}

.stat-show-check {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.stat-show-check .form-check-input {
  margin: 0;
  cursor: pointer;
}

.statistics-charts-stage {
  width: 100%;
  min-height: 360px;
  box-sizing: border-box;
}

.statistics-charts-grid {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.75rem;
  width: 100%;
  min-height: 340px;
}

.statistics-chart-col {
  flex: 1 1 0;
  min-width: 0;
  max-width: 100%;
}

.statistics-chart-col--hidden {
  display: none !important;
}

.statistics-tables-stage {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.statistics-tables-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 100%;
}

.statistics-table-block {
  width: 100%;
  max-width: 100%;
  background: #fff;
  border-radius: 0.75rem;
  border: 1px solid var(--panel-border);
  padding: 1rem 1.25rem;
  box-sizing: border-box;
}

.statistics-table-block .table-responsive {
  width: 100%;
  max-width: 100%;
}

.statistics-table-block .achievements-quick-table {
  width: 100%;
  margin-bottom: 0;
}

.statistics-table-block .achievements-quick-table thead th {
  font-size: 0.95rem;
}

.statistics-table-block .achievements-quick-table td,
.statistics-table-block .achievements-quick-table th {
  padding: 0.55rem 0.75rem;
}

.statistics-chart-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  margin-bottom: 0;
}

.statistics-chart-canvas-wrap {
  position: relative;
  width: 100%;
  height: 340px;
  min-height: 300px;
}

.statistics-chart-canvas-wrap canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.statistics-panel-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.65rem;
}

.statistics-empty-hint {
  padding: 1.5rem 0.5rem;
  text-align: center;
}

@media (max-width: 992px) {
  .view-mode-group.achievements-segment .btn {
    font-size: 1.35rem;
  }

  .stat-filters-panel--charts {
    grid-template-columns: 1fr;
  }

  .statistics-charts-grid {
    flex-wrap: wrap;
  }

  .statistics-chart-col {
    flex: 1 1 100%;
  }
}

@media (max-width: 768px) {
  .statistics-chart-canvas-wrap {
    height: 280px;
    min-height: 260px;
  }

  .stat-show-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
  }
}

.table-prototype thead th {
  background: var(--header-footer);
  font-weight: 600;
}

#tableView .achievements-quick-table,
.trash-table-view .achievements-quick-table {
  table-layout: fixed;
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #b8d4e8;
}

#tableView .achievements-quick-table .col-t-type { width: 12%; }
#tableView .achievements-quick-table .col-t-title { width: 34%; }
#tableView .achievements-quick-table .col-t-level { width: 15%; }
#tableView .achievements-quick-table .col-t-date { width: 12%; }
#tableView .achievements-quick-table .col-t-status { width: 17%; }
#tableView .achievements-quick-table .col-t-result { width: 10%; }

#tableView .achievements-quick-table th,
#tableView .achievements-quick-table td,
.trash-table-view .achievements-quick-table th,
.trash-table-view .achievements-quick-table td {
  border: 1px solid #b8d4e8 !important;
  vertical-align: middle;
  padding: 0.65rem 0.85rem;
}

/* Сетка ячеек (Bootstrap по умолчанию рисует только горизонтальные линии) */
#tableView .table.table-bordered > :not(caption) > * > *,
.trash-table-view .table.table-bordered > :not(caption) > * > * {
  border-width: 1px;
  border-color: #b8d4e8;
}

#tableView .achievements-quick-table thead th,
.trash-table-view .achievements-quick-table thead th {
  background: var(--header-footer);
  font-weight: 600;
  text-align: center;
}

#tableView .achievements-quick-table tbody td,
.trash-table-view .achievements-quick-table tbody td {
  background: #fff;
}

/* —— Страница «Корзина» (в стиле «Достижения») —— */
.trash-page {
  width: 100%;
}

.trash-shell {
  padding: 0.5rem;
  margin-bottom: 0;
}

.trash-table-view {
  width: 100%;
  overflow-x: auto;
}

.trash-table-view .trash-table .col-trash-title { width: 40%; }
.trash-table-view .trash-table .col-trash-date { width: 14%; }
.trash-table-view .trash-table .col-trash-status { width: 18%; }
.trash-table-view .trash-table .col-trash-actions { width: 28%; }

.trash-table-view .achievements-quick-table thead th {
  font-style: italic;
  font-weight: 300;
  font-size: 1.05rem;
}

.trash-table-view .achievements-quick-table tbody td {
  text-align: center;
}

.trash-table-view .trash-table tbody td:first-child {
  text-align: left;
  font-style: italic;
}

.trash-table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
}

.trash-table-actions .btn {
  font-weight: 300;
  font-style: italic;
  border-radius: 0.45rem;
  padding: 0.35rem 0.85rem;
  white-space: nowrap;
}

.trash-empty-row td {
  padding: 2rem 1rem !important;
  text-align: center !important;
  color: var(--text-muted);
  font-style: italic;
}

@media (max-width: 768px) {
  .trash-table .col-trash-title { width: 36%; }
  .trash-table .col-trash-date { width: 22%; }
  .trash-table .col-trash-status { width: 22%; }
  .trash-table .col-trash-actions { width: 20%; }

  .trash-table-actions {
    flex-direction: column;
  }

  .trash-table-actions .btn {
    width: 100%;
  }
}

.modal-header {
  border-bottom: 2px solid var(--header-footer);
}

.modal-title {
  font-weight: 700;
  font-size: 1.35rem;
}

.form-text-muted {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* —— Модальное окно «Создание достижения» —— */
#addAchievementModal .modal-dialog.modal-create-achievement-dialog {
  max-width: min(52rem, 92vw);
  width: 100%;
  max-height: calc(100dvh - 1rem);
  margin: 0.5rem auto;
}

.ach-create-modal {
  border: none;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 32px rgba(25, 45, 73, 0.16);
  max-height: calc(100dvh - 1rem);
  display: flex;
  flex-direction: column;
}

.ach-create-header {
  flex-shrink: 0;
  background: #e6f0f9;
  padding: 0.75rem 1.25rem;
  text-align: center;
}

.ach-create-title {
  margin: 0;
  font-size: clamp(1.05rem, 2.5vw, 1.35rem);
  font-weight: 300;
  font-style: italic;
  color: #354256;
  line-height: 1.25;
}

.ach-create-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.85rem 1.25rem 0.5rem;
  -webkit-overflow-scrolling: touch;
}

.ach-create-footer {
  flex-shrink: 0;
  padding: 0.65rem 1.25rem 1rem;
  background: #fff;
  border-top: 1px solid #e8eef4;
}

.ach-create-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem 1rem;
}

.ach-field-full {
  grid-column: 1 / -1;
}

.ach-field-label {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.78rem;
  font-weight: 300;
  font-style: italic;
  color: rgba(25, 45, 73, 0.63);
  line-height: 1.2;
}

.ach-field-hint {
  font-size: 0.92em;
  font-weight: 200;
  color: rgba(25, 45, 73, 0.45);
}

.ach-field-required {
  color: #d45a66;
  font-weight: 400;
  font-style: normal;
}

.ach-create-required-note {
  margin: 0 0 0.65rem;
  font-size: 0.75rem;
  font-weight: 300;
  font-style: italic;
  color: rgba(25, 45, 73, 0.55);
}

.ach-form-error {
  display: none;
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  background: #fff0f1;
  border: 1px solid #f07d87;
  color: #8b3040;
  font-size: 0.85rem;
  font-style: italic;
  line-height: 1.35;
}

.ach-form-error.is-visible {
  display: block;
}

.ach-field-invalid .ach-field-control,
.ach-field-invalid.ach-field-file-block .ach-file-upload {
  border-color: #f07d87;
  box-shadow: 0 0 0 2px rgba(240, 125, 135, 0.22);
}

.ach-field--required > .ach-field-label .ach-field-required {
  margin-left: 0.1em;
}

.ach-field-control {
  position: relative;
  background: #f4f4f4;
  border-radius: 10px;
  min-height: 2.5rem;
  display: flex;
  align-items: center;
}

.ach-field-input {
  width: 100%;
  border: none;
  background: transparent;
  color: #192d49;
  font-family: inherit;
  font-style: italic;
  padding: 0.4rem 2rem 0.4rem 0.85rem;
  min-height: 2.5rem;
  font-size: 0.9rem;
  line-height: 1.25;
}

.ach-field-input:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(49, 158, 255, 0.45);
  border-radius: 10px;
}

.ach-field-text {
  font-weight: 400;
  color: #464646;
  font-size: 0.88rem;
}

.ach-field-text::placeholder {
  color: rgba(70, 70, 70, 0.45);
}

.ach-field-select-wrap {
  border: 1px solid #d8dde3;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ach-field-select-wrap:hover {
  border-color: #b8c9da;
  background: #efefef;
}

.ach-field-select-wrap:focus-within {
  border-color: #319eff;
  box-shadow: 0 0 0 2px rgba(49, 158, 255, 0.18);
}

.ach-field-select-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 2.35rem;
  border-left: 1px solid #d0d0d0;
  background-color: #e0e0e0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1.5 7 7.5 13 1.5' fill='none' stroke='%23165a96' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px 9px;
  pointer-events: none;
  border-radius: 0 10px 10px 0;
}

.ach-field-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  text-transform: none;
  padding-right: 2.75rem !important;
}

.ach-field-select option {
  font-style: normal;
  text-transform: none;
  color: #192d49;
}

.ach-field-select option[value=''] {
  color: rgba(25, 45, 73, 0.5);
}

.ach-field-select:has(option[value='']:checked) {
  color: rgba(25, 45, 73, 0.5);
}

/* Текстовые поля без зоны списка */
.ach-field-control:not(.ach-field-select-wrap):not(.ach-field-date-wrap) {
  border: 1px solid transparent;
}

.ach-field-control:not(.ach-field-select-wrap):not(.ach-field-date-wrap):focus-within {
  border-color: #d8dde3;
}

.ach-field-date-wrap .ach-field-date {
  padding-right: 2.5rem;
}

.ach-field-date-wrap::after {
  content: '';
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.35rem;
  height: 1.35rem;
  pointer-events: none;
  opacity: 0.85;
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='50' height='50' viewBox='0 0 50 50'%3E%3Crect x='6' y='10' width='38' height='34' rx='4' fill='none' stroke='%23192d49' stroke-width='2'/%3E%3Cline x1='6' y1='18' x2='44' y2='18' stroke='%23192d49' stroke-width='2'/%3E%3Cline x1='16' y1='6' x2='16' y2='14' stroke='%23192d49' stroke-width='2'/%3E%3Cline x1='34' y1='6' x2='34' y2='14' stroke='%23192d49' stroke-width='2'/%3E%3C/svg%3E");
}

.ach-field-date::-webkit-calendar-picker-indicator {
  position: absolute;
  right: 0.5rem;
  width: 1.75rem;
  height: 1.75rem;
  opacity: 0;
  cursor: pointer;
}

.ach-field-file-block {
  margin-top: 0.75rem;
}

.ach-file-upload {
  display: flex;
  align-items: stretch;
  background: #f4f4f4;
  border-radius: 10px;
  min-height: 2.5rem;
  overflow: hidden;
}

.ach-file-pick {
  flex: 0 0 auto;
  min-width: 7.5rem;
  max-width: 42%;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #d2d2d2;
  border-radius: 10px;
  cursor: pointer;
  padding: 0 0.75rem;
  font-size: 0.82rem;
  font-weight: 200;
  font-style: italic;
  color: #192d49;
  text-align: center;
  transition: background 0.15s ease;
}

.ach-file-pick:hover {
  background: #c4c4c4;
}

.ach-file-display {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  font-size: 0.82rem;
  font-style: italic;
  color: #464646;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.ach-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.ach-create-format-hint {
  margin: 0.5rem 0 0;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 200;
  font-style: italic;
  color: #192d49;
}

.ach-create-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
}

.ach-create-btn {
  border: none;
  border-radius: 10px;
  min-height: 2.5rem;
  width: auto;
  min-width: 7.5rem;
  padding: 0.45rem 1.75rem;
  flex: 0 0 auto;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 300;
  font-style: italic;
  color: #fff;
  line-height: 1.2;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s ease, transform 0.1s ease;
}

.ach-create-btn:hover {
  filter: none;
}

.ach-create-btn:active {
  transform: scale(0.99);
}

.ach-create-btn-cancel {
  background: #f07d87;
}

.ach-create-btn-cancel:hover {
  background: #e86b76;
}

.ach-create-btn-submit {
  background: #165a96;
  box-shadow: 0 4px 12px rgba(22, 90, 150, 0.28);
}

.ach-create-btn-submit:hover {
  background: #0f4578;
}

#addAchievementModal .modal-backdrop.show {
  opacity: 0.35;
}

@media (max-width: 640px) {
  #addAchievementModal .modal-dialog.modal-create-achievement-dialog {
    max-width: 96vw;
    max-height: calc(100dvh - 0.5rem);
    margin: 0.25rem auto;
  }

  .ach-create-modal {
    max-height: calc(100dvh - 0.5rem);
    border-radius: 10px;
  }

  .ach-create-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .ach-create-scroll {
    padding: 0.65rem 0.85rem 0.35rem;
  }

  .ach-create-footer {
    padding: 0.5rem 0.85rem 0.75rem;
  }

  .ach-create-actions {
    gap: 0.5rem;
  }

  .ach-create-btn {
    min-width: 6rem;
    padding-left: 1rem;
    padding-right: 1rem;
    font-size: 0.88rem;
  }

  .ach-file-upload {
    flex-direction: column;
    min-height: auto;
  }

  .ach-file-pick {
    max-width: none;
    min-height: 2.25rem;
    border-radius: 10px 10px 0 0;
  }

  .ach-file-display {
    min-height: 2rem;
    padding: 0.35rem 0.75rem;
    white-space: normal;
    word-break: break-word;
  }
}

@media (max-height: 700px) {
  .ach-field-control,
  .ach-field-input {
    min-height: 2.15rem;
  }

  .ach-field-input {
    font-size: 0.85rem;
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
  }

  .ach-create-grid {
    gap: 0.45rem 0.75rem;
  }

  .ach-field-label {
    font-size: 0.72rem;
  }
}
