/* ОБЩИЕ СТИЛИ */
:root {
  --bg-color: #ffffff;
  --text-color: #000000;

  --card-bg: #ffffff;
  --border-color: #000000;

  --input-bg: #ffffff;
  --input-border: #000000;

  --button-bg: #000000;
  --button-text: #ffffff;

  --placeholder-color: #cccccc;
}

body.dark-theme {
  --bg-color: #111111;
  --text-color: #ffffff;

  --card-bg: #1d1d1d;
  --border-color: #ffffff;

  --input-bg: #111111;
  --input-border: #ffffff;

  --button-bg: #ffffff;
  --button-text: #000000;

  --placeholder-color: #888888;
}

body.dark-theme .slider::after {
  background-color: #fff;
}
body.dark-theme .filter-reset:hover {
    background: rgba(255, 255, 255, 0.05);
}
body.dark-theme .search-input:focus {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}
body.dark-theme .logout-btn:hover::before {
  background: rgba(255, 100, 100, 0.2);
}
@font-face {
  font-family: 'OCRA RUS';
  src: url('media/ocra(RUS BY LYAJKA).woff2') format('woff2'),
       url('media/ocra(RUS BY LYAJKA).woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'OCRA RUS', monospace;
  background: var(--bg-color);
  color: var(--text-color);
}

/* СТРАНИЦА АВТОРИЗАЦИИ */
body.auth-page {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.greeting-text {
      opacity: 1;
      transition: opacity 0.8s ease-in-out;
    }
.greeting-text.fade {
      opacity: 0;
    }

.auth-page .container {
  width: 100%;
  max-width: 500px; 
  position: relative;
}

.login-card {
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  padding: 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
}

.login-card h1 {
  color: var(--text-color);
  font-size: 32px;
  margin-bottom: 40px;
  font-weight: normal;
}

.input-group {
  position: relative; 
  width: 100%;
  margin-bottom: 20px;
}

.input-group .icon {
  position: absolute;
  left: 5px; 
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  pointer-events: none;
}

.input-group .icon img {
  display: block;
  width: 36px;
  height: 36px;
  filter: grayscale(100%) contrast(200%); 
}

.input-group input {
  width: 100%;
  height: 50px; 
  padding: 0 20px 0 70px; 
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--text-color);
  font-size: 24px;
  font-family: 'OCRA RUS', monospace;
}

.input-group input::placeholder {
  color: var(--placeholder-color);
  font-size: 24px;
}

.login-btn {
  width: 100%;
  height: 50px;
  background: var(--button-bg);
  border: none;
  color: var(--button-text);
  font-size: 24px;
  font-family: 'OCRA RUS', monospace;
  cursor: pointer;
  transition: background 0.3s ease;
}

.login-btn:hover {
  background: #333;
}

.auth-theme-switch {
  position: fixed;
  top: 30px;
  right: 30px;
  z-index: 100;
}

.auth-theme-switch .switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 30px;
}

.auth-theme-switch .switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.auth-theme-switch .slider {
  position: absolute;
  cursor: pointer;
  background-color: #ccc;
  border: 2px solid var(--border-color);
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  transition: .3s;
  border-radius: 30px;
}

.auth-theme-switch .slider::after {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  background-color: #000;
}

.auth-theme-switch .slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 2px;
  background-image: url("media/icons/sun-black.svg"); 
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  transition: .3s;
}

.auth-theme-switch input:checked + .slider {
  background-color: #000;
}

.auth-theme-switch input:checked + .slider:before {
  transform: translateX(28px);
  background-image: url("media/icons/moon-white.svg"); 
}

body.dark-theme .auth-theme-switch .slider::after {
  background-color: #fff;
}

/* ПЕРЕКЛЮЧАТЕЛЬ */
.main-page .main-theme-switch {
  position: absolute;
  top: 30px;
  right: 30px;
  z-index: 100;
}

.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 30px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  background-color: #ccc;
  border: 2px solid var(--border-color);
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  transition: .3s;
  border-radius: 30px;
}

.slider::after {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  background-color: #000;
}

.slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 2px;
  background-image: url("media/icons/sun-black.svg"); 
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  transition: .3s;
}

input:checked + .slider {
  background-color: #000;
}

input:checked + .slider:before {
  transform: translateX(28px);
  background-image: url("media/icons/moon-white.svg"); 
}

body.dark-theme .slider::after {
  background-color: #fff;
}
/* ОБЩИЕ ДЛЯ MAIN */
body.main-page {
  height: 100vh;
  overflow: hidden;
  display: flex;
  background: var(--bg-color); 
  color: var(--text-color);  
}

/* САЙДБАР */
.main-page .sidebar {
  width: 80px; 
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0;
  background: transparent;
  border-right: 2px solid var(--border-color);
}

.main-page .sidebar-header {
  margin-bottom: 40px;
}

.main-page .sidebar-header img {
  width: 40px;
  height: 40px;
}
.main-page .sidebar-header span {
  display: none;
}
.main-page .nav-item {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 2px solid transparent;
  text-decoration: none;
  transition: all 0.25s ease;
}
.main-page .nav-item {
  position: relative;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.main-page .nav-item.active::before {
  content: "";
  position: absolute;
  left: -20px;
  width: 3px;
  height: 32px;
  border-radius: 2px;
  background: var(--text-color);
}
.main-page .nav-item:hover img {
  transform: scale(1.08);
}
.main-page .nav-item img {
  transition: 0.2s ease;
}
.main-page .sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0;
}

.logout-btn {
  margin-top: auto;
  margin-bottom: 20px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logout-btn:hover {
  opacity: 0.8;
}

.logout-btn:hover .logout-icon {
  transform: scale(1.1);
}

.logout-icon {
  width: 32px;
  height: 32px;
  transition: transform 0.2s ease;
}

.logout-btn:active {
  transform: scale(0.95);
}
.logout-btn:hover::before {
  content: "";
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(255, 0, 0, 0.1);
  z-index: -1;
  animation: pulse 0.3s ease;
}

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

/* КОНТЕНТ */
body.main-page {
  height: 100vh;
  overflow: hidden;
  display: flex;
  background: var(--bg-color);
  color: var(--text-color);
}
.main-page .main-content {
  flex: 1;
  margin-left: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
  overflow-y: auto;
}

/*  КАРТОЧКА ФОРМЫ */
.main-page .form-card {
  width: 100%;
  max-width: 600px;
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 50px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

body.dark-theme .main-page .form-card {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.main-page .form-card h2 {
  color: var(--text-color);
  font-size: 32px;
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/*  КОНТЕЙНЕР СЧЁТЧИКА КАРТ */
.cards-count-row {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.cards-count-row:hover {
  border-bottom-color: var(--text-color);
  opacity: 0.8;
}

.count-label {
  font-size: 16px;
  color: var(--text-color);
  white-space: nowrap;
  font-weight: 500;
  min-width: 180px;
}

.count-input {
  width: 100px;
  height: 44px;
  font-size: 18px;
  border: 2px solid var(--border-color);
  background: var(--input-bg);
  color: var(--text-color);
  text-align: center;
  border-radius: 6px;
  font-family: 'OCRA RUS', monospace;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.count-input:focus {
  outline: none;
  border-color: var(--text-color);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

body.dark-theme .count-input:focus {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

/*  КОНТЕЙНЕР КАРТ */
.cards-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 280px;
  overflow-y: auto;
  padding: 4px;
}

.cards-container::-webkit-scrollbar {
  width: 6px;
}

.cards-container::-webkit-scrollbar-track {
  background: var(--input-bg);
  border-radius: 10px;
}

.cards-container::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 10px;
  opacity: 0.5;
}

.cards-container::-webkit-scrollbar-thumb:hover {
  opacity: 0.8;
}

.card-tag-input {
  width: 100%;
  height: 44px;
  padding: 0 16px;
  font-size: 16px;
  border: 2px solid var(--border-color);
  background: var(--input-bg);
  color: var(--text-color);
  border-radius: 6px;
  font-family: 'OCRA RUS', monospace;
  transition: all 0.2s ease;
}

.card-tag-input::placeholder {
  color: var(--placeholder-color);
}

.card-tag-input:focus {
  outline: none;
  border-color: var(--text-color);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

body.dark-theme .card-tag-input:focus {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.card-tag-input.error {
  border: 2px solid #ef5350;
  background: rgba(239, 83, 80, 0.05);
}

body.dark-theme .card-tag-input.error {
  background: rgba(239, 83, 80, 0.1);
}

/* КНОПКА ОТПРАВКИ */
.submit-btn {
  width: 100%;
  max-width: 300px;
  height: 50px;
  background: var(--button-bg);
  border: 2px solid var(--button-bg);
  color: var(--button-text);
  font-size: 16px;
  font-weight: 600;
  font-family: 'OCRA RUS', monospace;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 8px;
  letter-spacing: 0.5px;
  margin-top: 8px;
}

.submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

body.dark-theme .submit-btn:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.15);
}

.submit-btn:active:not(:disabled) {
  transform: translateY(0);
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* МОДАЛКА */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.modal.hidden {
  display: none;
}

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

.modal-content {
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  padding: 40px;
  text-align: center;
  border-radius: 12px;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  animation: slideUp 0.3s ease;
}

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

.modal-content p {
  color: var(--text-color);
  font-size: 16px;
  margin-bottom: 24px;
  line-height: 1.6;
  white-space: pre-wrap;
}

#modalClose {
  background: var(--button-bg);
  border: none;
  color: var(--button-text);
  padding: 12px 32px;
  font-size: 14px;
  font-family: 'OCRA RUS', monospace;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
  font-weight: 600;
}

#modalClose:hover {
  opacity: 0.9;
  transform: scale(1.02);
}

#modalClose:active {
  transform: scale(0.98);
}
/* СТРАНИЦА HISTORY */
.history-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    padding: 40px 20px;
    overflow-y: auto;
    max-height: 100%;
}

.page-title {
  font-size: 40px;
  color: var(--text-color);
  margin-bottom: 30px;
  text-align: center;
  font-family: 'OCRA RUS', monospace;
  flex-shrink: 0;
}

.search-filter-container {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    padding: 0;
    position: relative;
    flex-shrink: 0;
}

.search-box {
    position: relative;
    width: 300px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    pointer-events: none;
    opacity: 0.6;
}

.search-input {
    width: 100%;
    height: 45px;
    padding: 0 15px 0 45px;
    font-size: 16px;
    border: 2px solid var(--border-color);
    background: var(--input-bg);
    color: var(--text-color);
    border-radius: 6px;
    font-family: 'OCRA RUS', monospace;
    transition: border-color 0.2s ease;
}

.search-input::placeholder {
    color: var(--placeholder-color);
}

.search-input:focus {
    outline: none;
    border-color: var(--text-color);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

body.dark-theme .search-input:focus {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

/* КНОПКА ФИЛЬТРАЦИИ */
.filter-btn {
    width: 45px;
    height: 45px;
    padding: 0;
    background: var(--input-bg);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.filter-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.05);
}

body.dark-theme .filter-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.filter-icon {
    width: 24px;
    height: 24px;
    display: block;
}

/* ВЫПАДАЮЩЕЕ МЕНЮ ФИЛЬТРАЦИИ */
.filter-dropdown {
    position: absolute;
    top: 60px;
    right: 0;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    z-index: 1000;
    min-width: 250px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.filter-dropdown.hidden {
    display: none;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    font-weight: bold;
    color: var(--text-color);
}

.filter-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-color);
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.filter-close:hover {
    transform: rotate(90deg);
}

.filter-options {
    padding: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.filter-option {
    display: flex;
    align-items: center;
    padding: 10px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s ease;
    color: var(--text-color);
}

.filter-option:hover {
    background: rgba(0, 0, 0, 0.05);
}

body.dark-theme .filter-option:hover {
    background: rgba(255, 255, 255, 0.05);
}

.filter-option input[type="checkbox"] {
    margin-right: 10px;
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.filter-option span {
    user-select: none;
}

.filter-actions {
    display: flex;
    gap: 10px;
    padding: 10px;
    border-top: 1px solid var(--border-color);
}

.filter-reset,
.filter-apply {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'OCRA RUS', monospace;
    font-size: 12px;
    transition: all 0.2s ease;
}

.filter-reset {
    background: var(--input-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.filter-reset:hover {
    background: rgba(0, 0, 0, 0.05);
}

.filter-apply {
    background: var(--button-bg);
    color: var(--button-text);
}

.filter-apply:hover {
    opacity: 0.9;
}

/* КОНТЕЙНЕР ТАБЛИЦЫ */
.requests-container {
    width: 100%;
    overflow-x: auto;
    overflow-y: auto;
    flex: 1;
    border: 2px solid var(--border-color);
    border-radius: 8px;
}

.cards-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
}

.cards-table thead {
    background: var(--input-bg);
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.cards-table th {
    padding: 15px;
    text-align: left;
    font-size: 16px;
    font-weight: bold;
    color: var(--text-color);
    border-right: 1px solid var(--border-color);
    white-space: nowrap;
}

.cards-table th:last-child {
    border-right: none;
}

.cards-table td {
    padding: 15px;
    border-right: 1px solid var(--border-color);
    color: var(--text-color);
    font-size: 14px;
}

.cards-table td:last-child {
    border-right: none;
}

.cards-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.cards-table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

body.dark-theme .cards-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* КОЛОНКА ДЕЙСТВИЯ */
.action-cell {
    text-align: center;
    padding: 10px !important;
}

.delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.delete-btn:hover {
    background-color: rgba(255, 0, 0, 0.1);
    transform: scale(1.1);
}

body.dark-theme .delete-btn:hover {
    background-color: rgba(255, 100, 100, 0.2);
}

.action-icon {
    width: 24px;
    height: 24px;
    display: block;
}

.delete-btn:active {
    transform: scale(0.95);
}

/*  СТАТУСЫ */
.status-badge {
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 12px;
    display: inline-block;
}

.status-active {
    background-color: #d4edda;
    color: #155724;
}

body.dark-theme .status-active {
    background-color: #1e3a1f;
    color: #81c784;
}

.status-inactive {
    background-color: #f8d7da;
    color: #721c24;
}

body.dark-theme .status-inactive {
    background-color: #3a1f1f;
    color: #ef5350;
}

.status-blocked {
    background-color: #f5c6cb;
    color: #721c24;
}

body.dark-theme .status-blocked {
    background-color: #4a1f1f;
    color: #ff6b6b;
}

.status-closed {
    background-color: #e2e3e5;
    color: #383d41;
}

body.dark-theme .status-closed {
    background-color: #3a3a3a;
    color: #d0d0d0;
}

 /*  ТУЛТИПЫ */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 350px;
}

.toast {
  padding: 14px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: slideInRight 0.3s ease-out;
  word-wrap: break-word;
  max-width: 100%;
}

.toast.success {
  background-color: #d4edda;
  color: #155724;
  border-left: 4px solid #28a745;
}

.toast.error {
  background-color: #f8d7da;
  color: #721c24;
  border-left: 4px solid #dc3545;
}

.toast.info {
  background-color: #d1ecf1;
  color: #0c5460;
  border-left: 4px solid #17a2b8;
}

.toast.warning {
  background-color: #fff3cd;
  color: #856404;
  border-left: 4px solid #ffc107;
}

.toast-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.toast-close {
  margin-left: auto;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
  border: none;
  background: none;
  font-size: 18px;
  padding: 0;
  color: inherit;
}

.toast-close:hover {
  opacity: 1;
}

@keyframes slideInRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

.toast.remove {
  animation: slideOutRight 0.3s ease-out forwards;
}
