/* =========================================
   БАЗОВЫЕ СТИЛИ
   ========================================= */
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; max-width: 900px; margin: 20px auto; padding: 0 15px; line-height: 1.6; background: #f4f7f6; color: #333; }
.card { background: white; padding: 20px; border-radius: 8px; box-shadow: 0 2px 6px rgba(0,0,0,0.08); margin-bottom: 20px; }
input, textarea, select { width: 100%; padding: 10px; margin: 8px 0; border: 1px solid #ddd; border-radius: 5px; box-sizing: border-box; font-size: 0.95em; }
input:focus, textarea:focus, select:focus { border-color: #007bff; outline: none; box-shadow: 0 0 0 2px rgba(0,123,255,0.25); }

/* =========================================
   КНОПКИ
   ========================================= */
.btn { display: inline-flex; align-items: center; justify-content: center; border: none; padding: 10px 16px; border-radius: 5px; cursor: pointer; font-size: 0.95em; transition: all 0.2s; text-decoration: none; }
.btn-sm { padding: 6px 12px; font-size: 0.85em; display: inline-block; }
.btn-primary { background: #007bff; color: #fff; }
.btn-primary:hover { background: #0056b3; }
.btn-secondary { background: #6c757d; color: #fff; }
.btn-secondary:hover { background: #5a6268; }
.btn-success { background: #28a745; color: #fff; }
.btn-success:hover { background: #218838; }
.btn-danger { background: #dc3545; color: #fff; }
.btn-danger:hover { background: #c82333; }

/* =========================================
   БЕЙДЖИ, СТАТУСЫ, ПРИОРИТЕТЫ
   ========================================= */
.badge { padding: 4px 8px; border-radius: 4px; font-size: 0.8em; font-weight: 600; display: inline-block; color: #fff; }
.priority-badge { padding: 3px 8px; border-radius: 3px; font-size: 0.75em; color: #fff; margin-right: 5px; font-weight: bold; text-transform: uppercase; }
.priority-low { background: #6c757d; }
.priority-normal { background: #007bff; }
.priority-high { background: #fd7e14; }
.priority-critical { background: #dc3545; animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.75; } }

.ticket-card { position: relative; border-left: 4px solid #007bff; padding-top: 5px; }
.ticket-card.status-new { border-left-color: #6c757d; }
.ticket-card.status-in_progress { border-left-color: #fd7e14; }
.ticket-card.status-done { border-left-color: #28a745; }
.ticket-card.status-closed { border-left-color: #343a40; opacity: 0.85; }

/* =========================================
   UI ЭЛЕМЕНТЫ
   ========================================= */
.stats-bar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 15px; }
.stat-item { padding: 12px; background: #fff; border-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); font-size: 0.9em; flex: 1; min-width: 110px; text-align: center; }
.stat-item b { font-size: 1.4em; display: block; margin-top: 4px; color: #212529; }

.search-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 15px; }
.search-row input { flex: 1; min-width: 200px; margin: 0; }
.search-row button, .search-row .btn-sm { margin-top: 8px; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.inline-form { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 5px 0; }
.inline-form select { width: auto; margin: 0; min-width: 150px; }

.pagination { margin-top: 25px; text-align: center; }
.pagination a { padding: 8px 12px; border: 1px solid #ddd; text-decoration: none; margin: 0 3px; border-radius: 4px; color: #333; display: inline-block; transition: all 0.2s; }
.pagination a:hover { background: #e9ecef; border-color: #adb5bd; }
.pagination a.active { background: #007bff; color: white; border-color: #007bff; font-weight: bold; }

/* =========================================
   АДАПТИВНОСТЬ
   ========================================= */
@media (max-width: 600px) {
    .stats-bar { flex-direction: column; }
    .search-row { flex-direction: column; }
    .search-row input, .search-row button, .search-row .btn-sm { width: 100%; margin: 5px 0; }
    .actions { flex-direction: column; }
    .actions .btn-sm { width: 100%; }
    .inline-form { flex-direction: column; align-items: stretch; }
    .inline-form select { width: 100%; }
}