/* ============================================= */
/*   COSMOSOUND - Modern UI (Fixed for Inline Edit) */
/* ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', 'Roboto', sans-serif;
  /*background: linear-gradient(135deg, #f0f4ff 0%, #f8fafc 100%);*/
	background: #EBF0FE;
  color: #1e293b;
  padding: 20px;
  line-height: 1.5;
}

/* Таблицы - без !important, но с четкой структурой */
table {
  width: 100%;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border-collapse: separate;
  border-spacing: 0;
  margin: 20px 0;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

thead {
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
}

th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  color: #475569;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #e2e8f0;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  position: relative; /* Важно для позиционирования внутри */
}

tr:hover {
  background: #f8fafc;
}

tr:last-child td {
  border-bottom: none;
}

/* Исправление для input'ов внутри таблиц (inline editing) */
td input[type="text"], 
td input[type="date"], 
td input[type="number"],
td select {
  width: 100%;
  min-width: auto;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9rem;
  margin: 0;
  display: block; /* Убираем inline-block, чтобы не было наложений */
  background: white;
}

/* Если в ячейке есть input, убираем лишние отступы у текста */
td input + span,
td span + input {
  margin-top: 4px;
  display: block;
}

/* Навигация - flexbox */
ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
}

li {
  position: relative;
}

li a {
  display: block;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 20px;
  color: #4f46e5;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}

li a:hover {
  background: #4f46e5;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

/* Выпадающие меню (Отчеты) - фикс наложения */
li ul {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  min-width: 220px;
  margin-top: 4px;
  padding: 8px 0;
}

li:hover ul {
  display: block;
}

li ul li {
  display: block;
  width: 100%;
}

li ul li a {
  border: none;
  border-radius: 0;
  padding: 10px 16px;
  font-weight: 500;
  font-size: 0.9rem;
}

li ul li a:hover {
  background: #f1f5f9;
  color: #4f46e5;
  transform: none;
  box-shadow: none;
}



/* Поля поиска */
input[type="search"], 
input[name*="search"],
input[placeholder*="Поиск"] {
  min-width: 300px;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.95rem;
}

/* Заголовки */
h1, h2 {
  color: #0f172a;
  margin-bottom: 20px;
  font-weight: 700;
  font-size: 1.5rem;
}

/* Формы редактирования */
form {
  background: #E4EEFF; /* Убираем белый фон, если форма внутри таблицы */
  padding: 0;
  margin: 0;
}

/* Если форма отдельная (не в таблице) */
form:not(table form) {
  background: #E4EEFF;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin: 20px 0;
  max-width: 800px;
}

/* Скроллбар */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

/* Мобильная адаптивность */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }
  
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
  
  td input {
    min-width: 120px;
  }
  
  ul {
    flex-direction: column;
  }
  
  li a {
    display: block;
    text-align: center;
  }
}