@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

.main {
  min-height: calc(100vh - var(--header-height));
  padding-bottom: 60px;
}

.header {
  height: var(--header-height);
  background: var(--bg-page);
  border-bottom: 1px solid var(--bg-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--accent);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.logo-text {
  font-size: 31px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: "IBM Plex Sans", sans-serif;
  letter-spacing: -0.5px;
}

.logo-badge {
  height: 40px;
  padding: 0 12px;
  background: var(--bg-elevated);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  font-family: "IBM Plex Sans", sans-serif;
  display: flex;
  align-items: center;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border-radius: 10px;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.btn-icon:hover {
  background: var(--bg-border);
  color: var(--text-primary);
}

.role-toggle {
  display: flex;
  align-items: center;
  height: 40px;
  background: var(--bg-elevated);
  border-radius: 40px;
  padding: 0 4px;
}

.role-toggle__option {
  padding: 6px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 36px;
  cursor: pointer;
  transition: all var(--transition);
}

.role-toggle__option--active {
  background: var(--bg-border);
  color: var(--text-primary);
}

.btn {
  padding: 0 20px;
  height: 40px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
}

.btn--primary {
  background: var(--accent);
  color: var(--accent-text);
}

.btn--primary:hover {
  background: var(--accent-hover);
}

.search-section {
  margin-top: 32px;
}

.search {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--bg-border);
  border-radius: 16px;
  padding: 0 20px;
  height: 56px;
  transition: all var(--transition);
}

.search:focus-within {
  border-color: var(--accent);
}

.search:focus-within .search__icon {
  color: var(--accent);
}

.search__icon {
  color: var(--text-tertiary);
  flex-shrink: 0;
  transition: color var(--transition);
}

.search__input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 16px;
  font-weight: 400;
  color: var(--text-primary);
}

.search__input::placeholder {
  color: var(--text-tertiary);
}

.search__input:focus {
  color: var(--text-primary);
}

.tabs-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 32px 0;
}

.tabs {
  display: flex;
  gap: 12px;
  margin: 0;
}

.btn-add-material {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px;
  height: 48px;
  background: var(--accent);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent-text);
  font-family: "IBM Plex Sans", sans-serif;
  transition: all var(--transition);
  cursor: pointer;
}

.btn-add-material:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px;
  height: 48px;
  background: var(--bg-card);
  border-radius: 12px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.tab:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.tab--active {
  background: var(--accent);
  color: var(--accent-text);
}

.tab--active:hover {
  background: var(--accent-hover);
  color: var(--accent-text);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px 20px;
  margin-top: 32px;
  transition: opacity 0.3s ease;
}

.cards-grid--fade-out {
  animation: fadeOut 0.3s ease forwards;
}

.card {
  animation: slideUp 0.4s ease;
  animation-fill-mode: both;
}

.card:nth-child(1) {
  animation-delay: 0.05s;
}
.card:nth-child(2) {
  animation-delay: 0.1s;
}
.card:nth-child(3) {
  animation-delay: 0.15s;
}
.card:nth-child(4) {
  animation-delay: 0.2s;
}
.card:nth-child(5) {
  animation-delay: 0.25s;
}
.card:nth-child(6) {
  animation-delay: 0.3s;
}
.card:nth-child(7) {
  animation-delay: 0.35s;
}
.card:nth-child(8) {
  animation-delay: 0.4s;
}
.card:nth-child(9) {
  animation-delay: 0.45s;
}
.card:nth-child(10) {
  animation-delay: 0.5s;
}
.card:nth-child(11) {
  animation-delay: 0.55s;
}
.card:nth-child(12) {
  animation-delay: 0.6s;
}

.card {
  max-width: 285px;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--bg-border);
  border-radius: var(--card-radius);
  padding: 16px;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.card__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 16px;
  font-family: "IBM Plex Sans", sans-serif;
  word-break: break-word;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: calc(1.4em * 2);
}

.card__fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
  flex: 1;
}

.card-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.4;
  font-family: "IBM Plex Sans", sans-serif;
}

.card-field__icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-secondary);
}

.card-field__text {
  word-break: break-word;
  overflow-wrap: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: 3em;
  line-height: 1.5;
  white-space: normal;
}

.card-field__text strong {
  font-weight: 600;
  color: var(--text-primary);
}

.card__actions {
  display: flex;
  margin-top: auto;
}

.card__actions--guest {
  width: 100%;
}

.card__actions--admin {
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.card__actions--admin .btn-card {
  flex: 1;
}

.card__action-buttons {
  display: flex;
  gap: 8px;
  width: 100%;
}

.card__actions--guest .card__action-buttons {
  flex-direction: column;
}

.card__actions--admin .card__action-buttons {
  flex: 1;
}

.btn-card--outline {
  background: transparent;
  border: 1px solid var(--bg-border);
  color: var(--text-secondary);
}

.btn-card--outline:hover {
  background: var(--bg-elevated);
  border-color: var(--text-tertiary);
}

.btn-card-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border-radius: 8px;
  color: var(--text-secondary);
  transition: all var(--transition);
  cursor: pointer;
  flex-shrink: 0;
}

.btn-card-icon:hover {
  background: var(--bg-border);
  color: var(--text-primary);
}

.btn-card-icon--danger:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

.btn-card {
  width: 100%;
  padding: 0 16px;
  height: 32px;
  background: var(--accent);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-text);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  font-family: "IBM Plex Sans", sans-serif;
}

.btn-card--full {
  width: 100%;
}

.card__admin-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-card:hover {
  background: var(--accent-hover);
}

.role-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: 40px;
  background: var(--bg-elevated);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  font-family: "IBM Plex Sans", sans-serif;
  transition: all var(--transition);
  cursor: pointer;
}

.role-btn:hover {
  background: var(--bg-border);
  color: var(--text-primary);
}

.role-btn svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease;
}

.modal__content {
  position: relative;
  background: var(--bg-page);
  border-radius: 20px;
  width: 400px;
  max-width: 90%;
  box-shadow: 0 20px 35px -10px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--bg-border);
  animation: scaleIn 0.3s ease;
}

.modal__content--wide {
  width: 500px;
  max-width: 90%;
}

.modal__content--horizontal {
  width: 1200px;
  max-width: calc(100% - 40px);
  max-height: calc(100% - 40px);
  overflow-y: auto;
}

.modal__content--horizontal .modal__body {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.modal__content--horizontal .modal__field {
  margin-bottom: 0;
}

.modal__content--horizontal .modal__field:nth-child(5),
.modal__content--horizontal .modal__field:nth-child(6) {
  grid-column: span 2;
}

.modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--bg-border);
}

.modal__title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: "IBM Plex Sans", sans-serif;
}

.modal__body {
  padding: 24px;
}

.modal__field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.modal__field label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  font-family: "IBM Plex Sans", sans-serif;
}

.modal__field input {
  height: 44px;
  padding: 0 16px;
  background: var(--bg-card);
  border: 1px solid var(--bg-border);
  border-radius: 10px;
  font-size: 14px;
  color: var(--text-primary);
  font-family: "IBM Plex Sans", sans-serif;
  outline: none;
  transition: all var(--transition);
}

.modal__field input:focus {
  border-color: var(--accent);
}

.modal__field select {
  height: 44px;
  padding: 0 16px;
  background: var(--bg-card);
  border: 1px solid var(--bg-border);
  border-radius: 10px;
  font-size: 14px;
  color: var(--text-primary);
  font-family: "IBM Plex Sans", sans-serif;
  outline: none;
  transition: all var(--transition);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
  padding-right: 40px;
}

.modal__field select:focus {
  border-color: var(--accent);
}

.type-toggle {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.type-toggle__btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 16px;
  background: var(--bg-card);
  border: 1px solid var(--bg-border);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  font-family: "IBM Plex Sans", sans-serif;
  cursor: pointer;
  transition: all var(--transition);
  outline: none;
}

.type-toggle__btn:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.type-toggle__btn--active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.type-toggle__btn--active:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: white;
}

.type-toggle__btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Скрыть браузерную стрелку у input с list (на всякий случай) */
#materialTeacher::-webkit-calendar-picker-indicator {
  display: none !important;
}
#materialTeacher::-webkit-list-button {
  display: none !important;
}
#materialTeacher::-webkit-clear-button {
  display: none !important;
}

#materialTeacher {
  width: 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
  padding-right: 40px;
  cursor: pointer;
}

.modal__field input[type="file"] {
  padding: 8px 0;
  background: transparent;
  border: none;
}

.modal__field input[type="file"]::file-selector-button {
  padding: 6px 12px;
  background: var(--bg-elevated);
  border: none;
  border-radius: 8px;
  color: var(--text-primary);
  cursor: pointer;
}

#fileNameDisplay {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

.file-drop-area {
  border: 2px dashed var(--bg-border);
  border-radius: 12px;
  padding: 20px 24px;
  text-align: center;
  background: var(--bg-card);
  transition: all var(--transition);
  position: relative;
  cursor: pointer;
}

.file-drop-area:hover,
.file-drop-area.dragover {
  border-color: var(--accent);
  background: var(--bg-elevated);
}

.file-drop-icon {
  margin-bottom: 8px;
  color: var(--text-tertiary);
  display: flex;
  justify-content: center;
}

.file-drop-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.file-drop-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  font-family: "IBM Plex Sans", sans-serif;
}

.file-drop-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}

.file-drop-browse {
  background: none;
  border: none;
  color: var(--accent);
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.file-drop-browse:hover {
  color: var(--accent-hover);
}

.file-drop-input {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  opacity: 0;
  cursor: pointer;
}

.file-drop-hint {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 12px;
}

.file-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-elevated);
  border-radius: 10px;
  padding: 12px 16px;
  margin-top: 16px;
  animation: slideUp 0.3s ease;
}

.file-preview-icon {
  color: var(--accent);
}

.file-preview-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.file-preview-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  font-family: "IBM Plex Sans", sans-serif;
}

.file-preview-size {
  font-size: 12px;
  color: var(--text-tertiary);
}

.file-preview-remove {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-border);
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.file-preview-remove:hover {
  background: var(--danger);
  color: white;
}

.modal__error {
  margin-top: 12px;
  font-size: 13px;
  color: var(--danger);
  font-family: "IBM Plex Sans", sans-serif;
}

.modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px 24px;
  border-top: 1px solid var(--bg-border);
}

.modal__btn {
  padding: 0 20px;
  height: 40px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  font-family: "IBM Plex Sans", sans-serif;
  cursor: pointer;
  transition: all var(--transition);
}

.modal__btn--secondary {
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

.modal__btn--secondary:hover {
  background: var(--bg-border);
  color: var(--text-primary);
}

.modal__btn--primary {
  background: var(--accent);
  color: var(--accent-text);
}

.modal__btn--primary:hover {
  background: var(--accent-hover);
}

.search__input,
#adminPassword {
  caret-color: var(--accent);
}

.search__input:focus,
#adminPassword:focus {
  outline: none;
  box-shadow: none;
}

button {
  user-select: none;
  -webkit-user-select: none;
}

button:active {
  transform: scale(0.98);
}

.field-hint {
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.3;
  margin-top: 4px;
}

.autocomplete-hint {
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.3;
  margin-top: 4px;
}

.autocomplete-wrapper {
  position: relative;
}

.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-page);
  border: 1px solid var(--bg-border);
  border-radius: 10px;
  margin-top: 4px;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  animation: slideUp 0.2s ease;
}

.autocomplete-option {
  padding: 10px 16px;
  font-size: 14px;
  color: var(--text-primary);
  font-family: "IBM Plex Sans", sans-serif;
  cursor: pointer;
  transition: background-color var(--transition);
}

.autocomplete-option:hover,
.autocomplete-option.selected {
  background-color: var(--bg-elevated);
}

.autocomplete-option:not(:last-child) {
  border-bottom: 1px solid var(--bg-border);
}

@media (max-width: 1200px) {
  .cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .tabs-wrapper {
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
  }

  .btn-add-material {
    justify-content: center;
  }
}

@media (max-width: 600px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }

  .card {
    max-width: 100%;
  }

  .header__inner {
    flex-direction: row;
    flex-wrap: wrap;
    height: auto;
    padding: 8px 20px;
    gap: 12px;
    justify-content: space-between;
  }

  .header {
    height: auto;
  }

  .logo-group {
    justify-content: flex-start;
    flex-shrink: 0;
  }

  .logo-text {
    font-size: 24px;
  }

  .logo-badge {
    height: 32px;
    padding: 0 8px;
    font-size: 12px;
  }

  .header__actions {
    justify-content: flex-end;
    flex-shrink: 0;
    gap: 8px;
  }

  .btn-icon,
  .role-btn {
    width: 36px;
    height: 36px;
  }

  .role-btn {
    padding: 0;
    justify-content: center;
  }

  .role-btn span {
    display: none;
  }

  .search {
    height: 48px;
  }

  .tab {
    padding: 0 16px;
    height: 40px;
    font-size: 14px;
  }

  .modal__content {
    width: 95%;
    margin: 16px;
  }

  .modal__footer {
    flex-wrap: wrap;
  }

  .modal__btn {
    flex: 1;
  }
}

.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 40px;
  gap: 8px;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--btn-radius);
  border: 1px solid var(--bg-border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.pagination-btn:hover:not(:disabled) {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--text-tertiary);
}

.pagination-btn:active:not(:disabled) {
  transform: scale(0.95);
  transition: transform 0.1s ease;
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-btn--active {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}

.pagination-btn--active:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.pagination-prev,
.pagination-next {
  padding: 0 16px;
}

.pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  color: var(--text-tertiary);
  user-select: none;
}

@media (max-width: 768px) {
  .pagination-container {
    margin-top: 30px;
    gap: 6px;
  }

  .pagination-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    font-size: 13px;
  }

  .pagination-ellipsis {
    min-width: 36px;
    height: 36px;
  }
}

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--bg-border);
  border-radius: var(--btn-radius);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transform: translateX(100%);
  transition:
    opacity 0.3s,
    transform 0.3s;
  pointer-events: auto;
}

.toast--visible {
  opacity: 1;
  transform: translateX(0);
}

.toast--hiding {
  opacity: 0;
  transform: translateX(100%);
}

.toast__icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.toast--success .toast__icon {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.toast--error .toast__icon {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.toast--info .toast__icon {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.toast__message {
  flex: 1;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-primary);
}

.toast__close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.toast__close:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

@media (max-width: 1200px) {
  .modal__content--horizontal {
    width: 90%;
    max-width: 1000px;
  }
}

@media (max-width: 900px) {
  .modal__content--horizontal {
    width: 95%;
    max-width: 800px;
  }

  .modal__content--horizontal .modal__body {
    grid-template-columns: 1fr;
  }

  .modal__content--horizontal .modal__field:nth-child(5),
  .modal__content--horizontal .modal__field:nth-child(6) {
    grid-column: span 1;
  }
}

@media (max-width: 768px) {
  .toast-container {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }

  .toast {
    padding: 14px;
  }
}

.pwa-install-btn,
.pwa-update-btn {
  position: relative;
  transition: all 0.2s ease;
}

.pwa-install-btn:hover,
.pwa-update-btn:hover {
  background-color: var(--color-primary-light);
  transform: translateY(-2px);
}

.pwa-install-btn:active,
.pwa-update-btn:active {
  transform: translateY(0);
}

.pwa-install-btn svg,
.pwa-update-btn svg {
  stroke-width: 2;
}

.pwa-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  margin-left: 8px;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  transition: all 0.3s ease;
}

.pwa-status--installed {
  background-color: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
  color: rgb(34, 197, 94);
}

.pwa-status--available {
  background-color: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
  color: rgb(59, 130, 246);
}

.pwa-status--update {
  background-color: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
  color: rgb(245, 158, 11);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@media (max-width: 768px) {
  .pwa-status {
    display: none;
  }

  .pwa-install-btn,
  .pwa-update-btn {
    width: 36px;
    height: 36px;
  }
}

.logout-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border-radius: 10px;
  color: var(--text-secondary);
  transition: all var(--transition);
  cursor: pointer;
}

.logout-btn:hover {
  background: var(--bg-border);
  color: var(--danger);
}
