/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* ═══ Логист23 — Глобальные стили форм ═══ */

/* Все инпуты */
input[type="text"], input[type="number"], input[type="email"],
input[type="password"], input[type="date"], input[type="time"],
input[type="tel"], input[type="url"], input[type="search"],
textarea, select {
  font-size: 14px;
  padding: 10px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
  color: #1e293b;
  transition: all 0.15s ease;
  width: 100%;
  outline: none;
  -webkit-appearance: none;
}

input:focus, textarea:focus, select:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

input:hover, textarea:hover, select:hover {
  border-color: #cbd5e1;
}

input[readonly], input[disabled] {
  background: #f8fafc;
  color: #94a3b8;
  cursor: not-allowed;
  border-color: #f1f5f9;
}

/* Number inputs — моноширинный */
input[type="number"] {
  font-family: 'SF Mono', 'Menlo', 'Monaco', monospace;
  font-weight: 600;
  letter-spacing: -0.3px;
}

/* Date inputs */
input[type="date"] {
  font-weight: 500;
}

/* Select — стрелка */
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-position: right 10px center;
  background-repeat: no-repeat;
  background-size: 16px;
  padding-right: 36px;
  cursor: pointer;
}

select:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236366f1' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
}

/* Textarea */
textarea {
  resize: vertical;
  min-height: 60px;
}

/* Labels */
label, .form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

/* Submit buttons */
input[type="submit"], button[type="submit"] {
  font-weight: 700;
  letter-spacing: 0.3px;
  transition: all 0.15s ease;
}

input[type="submit"]:active, button[type="submit"]:active {
  transform: scale(0.98);
}

/* File inputs */
input[type="file"] {
  padding: 8px;
  border-style: dashed;
  border-width: 2px;
  border-color: #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  cursor: pointer;
}

input[type="file"]:hover {
  border-color: #6366f1;
  background: #f5f3ff;
}

/* Секции формы */
.form-section {
  background: white;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  overflow: hidden;
  margin-bottom: 16px;
}

.form-section-header {
  padding: 12px 20px;
  border-bottom: 1px solid #f1f5f9;
  background: #fafafa;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.form-section-header h2 {
  font-size: 12px;
  font-weight: 800;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.form-section-body {
  padding: 20px;
}

/* Автокалькуляция панель */
.calc-panel {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 12px;
  padding: 16px 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 12px;
}

.calc-item {
  text-align: center;
}

.calc-item .calc-label {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.calc-item .calc-value {
  font-size: 18px;
  font-weight: 800;
  color: #1e293b;
  font-family: 'SF Mono', 'Menlo', monospace;
  letter-spacing: -0.5px;
  margin-top: 2px;
}

.calc-item .calc-value.positive { color: #16a34a; }
.calc-item .calc-value.negative { color: #ef4444; }
.calc-item .calc-value.accent { color: #6366f1; }

/* Подсказки под полями */
.field-hint {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
}

/* Hotkey badge */
.hotkey {
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'SF Mono', monospace;
}

/* ═══ Tom Select — кастомные стили ═══ */
.ts-wrapper {
  border: none !important;
}

.ts-wrapper .ts-control {
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 10px !important;
  padding: 8px 14px !important;
  font-size: 14px !important;
  background: #fff !important;
  min-height: 42px !important;
  transition: all 0.15s ease !important;
  box-shadow: none !important;
}

.ts-wrapper .ts-control:hover {
  border-color: #cbd5e1 !important;
}

.ts-wrapper.focus .ts-control {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12) !important;
}

.ts-wrapper .ts-control input {
  font-size: 14px !important;
  color: #1e293b !important;
}

.ts-wrapper .ts-control input::placeholder {
  color: #94a3b8 !important;
  font-size: 13px !important;
}

.ts-dropdown {
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 10px !important;
  box-shadow: 0 10px 40px rgba(0,0,0,0.12) !important;
  margin-top: 4px !important;
  overflow: hidden !important;
}

.ts-dropdown .ts-dropdown-content {
  max-height: 250px !important;
  padding: 4px !important;
}

.ts-dropdown [data-selectable] {
  padding: 8px 12px !important;
  font-size: 13px !important;
  border-radius: 6px !important;
  margin: 1px 0 !important;
}

.ts-dropdown .active {
  background: #eef2ff !important;
  color: #4338ca !important;
}

.ts-dropdown .ts-dropdown-content .no-results {
  padding: 12px !important;
  text-align: center !important;
  color: #94a3b8 !important;
  font-size: 13px !important;
}

.ts-wrapper .item {
  font-size: 14px !important;
  color: #1e293b !important;
  font-weight: 500 !important;
}
