/* ============================================
   Базовые стили
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: #f0f2f5;
    color: #333;
    line-height: 1.6;
    padding: 10px;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    overflow: hidden;
}

/* ============================================
   Шапка (header)
   ============================================ */
.header {
    background: linear-gradient(135deg, #1a472a 0%, #2d6a4f 100%);
    color: white;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.header img {
    height: 45px;
    background: white;
    border-radius: 8px;
    padding: 5px;
    object-fit: contain;
}

.header-text h1 {
    font-size: clamp(1rem, 4vw, 1.3rem);
    margin: 0;
    font-weight: 700;
}

.header-text p {
    font-size: clamp(0.7rem, 3vw, 0.85rem);
    margin-top: 2px;
    opacity: 0.85;
}

.user-info {
    text-align: right;
    background: rgba(255,255,255,0.15);
    padding: 6px 16px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

.user-info > div:first-child {
    font-weight: 600;
    font-size: 14px;
    font-family: -apple-system, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

.role-badge {
    font-size: 11px;
    opacity: 0.9;
    margin-top: 2px;
    font-family: -apple-system, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

/* ============================================
   МЕНЮ С КАТЕГОРИЯМИ (СВОРАЧИВАЕМОЕ)
   ============================================ */
.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 12px;
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
}

.nav-section {
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-radius: 6px;
    overflow: hidden;
}

.nav-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #e8f5e9;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
    user-select: none;
}

.nav-section-header:hover {
    background: #d4edda;
}

.nav-section-title {
    font-size: 13px;
    font-weight: 700;
    color: #1a472a;
    font-family: -apple-system, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

.nav-section-toggle {
    font-size: 12px;
    color: #1a472a;
    transition: transform 0.3s;
}

.nav-section-content {
    padding: 4px 0 8px 0;
}

.nav-section-content .nav-buttons {
    padding: 4px 0 0 0;
}

.nav-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.nav-btn {
    padding: 8px 16px;
    background: #2d6a4f;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.3s, transform 0.1s;
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    font-family: -apple-system, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

.nav-btn:hover {
    background: #1b4d3e;
    text-decoration: none;
    color: white;
}

.nav-btn.repair {
    background: #e67e22;
}

.nav-btn.repair:hover {
    background: #d35400;
}

.nav-btn.equipment {
    background: #1a472a;
}

.nav-btn.equipment:hover {
    background: #0f3a1f;
}

.nav-btn.admin {
    background: #1a472a;
}

.nav-btn.admin:hover {
    background: #0f3a1f;
}

.nav-btn.logout {
    background: #e74c3c;
}

.nav-btn.logout:hover {
    background: #c0392b;
}

.nav-btn.tmc {
    background: #2c3e50;
}

.nav-btn.tmc:hover {
    background: #1a2a3a;
}

.nav-btn.objects {
    background: #2980b9;
}

.nav-btn.objects:hover {
    background: #1a6b9a;
}

.nav-btn .badge {
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    padding: 1px 8px;
    font-size: 10px;
    font-weight: 700;
    margin-left: 4px;
    min-width: 18px;
    text-align: center;
}

/* ============================================
   Контент
   ============================================ */
.content {
    padding: 25px 30px;
}

/* ============================================
   Заголовки
   ============================================ */
h2 {
    color: #1a472a;
    margin-bottom: 20px;
    font-size: 22px;
    border-left: 4px solid #1a472a;
    padding-left: 15px;
    font-family: -apple-system, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

h3 {
    color: #1a472a;
    font-size: 18px;
    margin-bottom: 15px;
    font-family: -apple-system, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

/* ============================================
   Сообщения
   ============================================ */
.success-message,
.error-message,
.info-message {
    padding: 12px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    font-family: -apple-system, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

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

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

.info-message {
    background: #e3f2fd;
    color: #0c5460;
    border-left: 4px solid #2196f3;
}

/* ============================================
   Кнопки - УВЕЛИЧЕННЫЕ РАЗМЕРЫ С ЕДИНЫМ ШРИФТОМ
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.3s, transform 0.1s;
    background: #2d6a4f;
    color: white;
    min-height: 48px;
    font-family: -apple-system, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.2;
}

.btn:hover {
    background: #1b4d3e;
    color: white;
    text-decoration: none;
}

.btn-primary {
    background: #2d6a4f;
    color: white;
}

.btn-primary:hover {
    background: #1b4d3e;
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    color: white;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #1e7e34;
    color: white;
}

.btn-warning {
    background: #e67e22;
    color: white;
}

.btn-warning:hover {
    background: #d35400;
    color: white;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
    color: white;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #117a8b;
    color: white;
}

.btn-block {
    width: 100%;
    justify-content: center;
    padding: 14px 28px;
    font-size: 16px;
    min-height: 52px;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 8px;
    min-height: 36px;
}

.btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ============================================
   Формы
   ============================================ */
.form-card {
    background: #f9f9f9;
    padding: 20px 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    border: 1px solid #e0e0e0;
}

.form-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
    font-size: 13px;
    font-family: -apple-system, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 13px;
    font-family: -apple-system, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2d6a4f;
}

.required {
    color: #e74c3c;
}

.manual-input {
    display: none;
    margin-top: 5px;
}

/* ============================================
   Таблицы
   ============================================ */
.table-wrapper {
    overflow-x: auto;
    margin: 10px 0 15px;
}

.items-table,
.equipment-table,
.users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    font-family: -apple-system, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

.items-table th,
.equipment-table th,
.users-table th {
    background: #1a472a;
    color: white;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
    font-family: -apple-system, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

.items-table td,
.equipment-table td,
.users-table td {
    border: 1px solid #ddd;
    padding: 8px 12px;
    vertical-align: middle;
    font-family: -apple-system, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

.items-table input,
.items-table select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    font-family: -apple-system, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

.items-table input:focus {
    outline: none;
    border-color: #2d6a4f;
}

.remove-row {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
    font-family: -apple-system, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

.remove-row:hover {
    background: #c0392b;
}

/* ============================================
   Карточки заявок
   ============================================ */
.request-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    margin-bottom: 15px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.request-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.request-header {
    background: #f9f9f9;
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    border-bottom: 1px solid #eee;
}

.request-number {
    font-weight: 700;
    color: #1a472a;
    font-size: 14px;
    font-family: -apple-system, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

.request-date {
    font-size: 12px;
    color: #666;
    margin-left: 10px;
    font-family: -apple-system, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

.request-user {
    font-size: 13px;
    color: #333;
    font-family: -apple-system, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

.request-body {
    padding: 15px 18px;
}

.request-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px 20px;
    margin-bottom: 12px;
}

.info-item {
    display: flex;
    gap: 5px;
    font-size: 13px;
    font-family: -apple-system, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

.info-label {
    font-weight: 600;
    color: #555;
    white-space: nowrap;
}

.info-value {
    color: #333;
    word-break: break-word;
}

.request-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* ============================================
   Статусы
   ============================================ */
.status-badge {
    display: inline-block;
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    font-family: -apple-system, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

.status-new,
.status-draft {
    background: #e3f2fd;
    color: #0c5460;
}

.status-in_progress,
.status-sent {
    background: #fff3cd;
    color: #856404;
}

.status-completed,
.status-received {
    background: #d4edda;
    color: #155724;
}

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

.status-active {
    background: #fff3cd;
    color: #856404;
}

.status-axo_head {
    background: #e8d5f5;
    color: #6c3483;
}

/* ============================================
   Статус-формы и редактирование
   ============================================ */
.status-form,
.edit-form,
.reason-form {
    display: none;
    margin-top: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.status-form.active,
.edit-form.active,
.reason-form.active {
    display: block;
}

.status-form h4,
.edit-form h4,
.reason-form h4 {
    color: #1a472a;
    margin-bottom: 10px;
    font-size: 14px;
    font-family: -apple-system, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

.status-form select,
.edit-form input,
.edit-form textarea {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 13px;
    font-family: -apple-system, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    margin-bottom: 10px;
}

.status-form select:focus,
.edit-form input:focus,
.edit-form textarea:focus {
    outline: none;
    border-color: #2d6a4f;
}

.edit-form .edit-table input {
    margin: 0;
    padding: 4px 6px;
    font-size: 12px;
}

.reason-form {
    border-color: #f39c12;
}

.reason-form h4 {
    color: #f39c12;
}

/* ============================================
   Статистика (Dashboard)
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border-top: 4px solid #2d6a4f;
}

.stat-card-green {
    border-top-color: #2d6a4f;
}
.stat-card-orange {
    border-top-color: #e67e22;
}
.stat-card-blue {
    border-top-color: #3498db;
}
.stat-card-dark {
    border-top-color: #2c3e50;
}

.stat-number {
    font-size: 28px;
    font-weight: 700;
    color: #1a472a;
    font-family: -apple-system, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

.stat-label {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
    font-family: -apple-system, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

/* ============================================
   Графики / Чарты
   ============================================ */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.chart-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.chart-card h3 {
    margin-top: 0;
    font-size: 16px;
    font-family: -apple-system, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

.statuses-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.status-bar {
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    margin: 4px 0 8px;
    overflow: hidden;
}

.status-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s;
}

/* ============================================
   Быстрые действия
   ============================================ */
.request-actions-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.action-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.action-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.action-card .card-header h3 {
    margin: 0;
    font-size: 16px;
    font-family: -apple-system, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

.action-card .card-header a {
    font-size: 13px;
    color: #2d6a4f;
    text-decoration: none;
    font-family: -apple-system, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

.action-card .card-header a:hover {
    text-decoration: underline;
}

/* ============================================
   История статусов
   ============================================ */
.status-history {
    margin-top: 15px;
    padding: 12px 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #eee;
}

.status-history h4 {
    font-size: 13px;
    color: #1a472a;
    margin-bottom: 8px;
    font-family: -apple-system, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

.status-history-item {
    display: flex;
    gap: 15px;
    font-size: 12px;
    padding: 3px 0;
    border-bottom: 1px solid #f0f0f0;
    flex-wrap: wrap;
    font-family: -apple-system, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

.status-history-item:last-child {
    border-bottom: none;
}

.status-arrow {
    color: #999;
    margin: 0 4px;
}

/* ============================================
   Описание / Description
   ============================================ */
.description-box {
    margin-top: 10px;
    padding: 12px 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border-left: 3px solid #2d6a4f;
}

.description-box .info-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
    font-family: -apple-system, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

.description-box .info-value {
    font-size: 13px;
    color: #333;
    font-family: -apple-system, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

/* ============================================
   Техника (Equipment)
   ============================================ */
.equipment-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.equipment-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.equipment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.equipment-header {
    padding: 15px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    background: #f9f9f9;
    border-bottom: 1px solid #eee;
}

.equipment-info {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.equipment-photo {
    width: 60px;
    height: 60px;
    background: #f0f2f5;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.equipment-photo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

.equipment-details h3 {
    margin: 0;
    font-size: 17px;
    color: #1a472a;
    font-family: -apple-system, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

.equipment-details p {
    margin: 2px 0;
    font-size: 13px;
    color: #555;
    font-family: -apple-system, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

.location-badge {
    font-size: 12px;
    background: #e8f5e9;
    padding: 2px 10px;
    border-radius: 12px;
    color: #2d6a4f;
    font-weight: 500;
    font-family: -apple-system, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

.equipment-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.add-part-form {
    display: none;
    padding: 15px 18px;
    background: #f5f5f5;
    border-bottom: 1px solid #eee;
}

.add-part-form.active {
    display: block;
}

.parts-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    font-family: -apple-system, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

/* ============================================
   ТМЦ и Объекты
   ============================================ */
.tmc-grid,
.objects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.tmc-card,
.object-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.tmc-card:hover,
.object-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.tmc-photo,
.object-photo {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    background: #f0f2f5;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tmc-photo img,
.object-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================
   Пользователи (Users)
   ============================================ */
.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.user-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.user-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.role-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: white;
    font-family: -apple-system, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

/* ============================================
   Запчасти (Spare Parts)
   ============================================ */
.spare-parts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.spare-part-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.spare-part-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.spare-part-photo {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    background: #f0f2f5;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spare-part-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================
   Установка PWA
   ============================================ */
.install-pwa {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #1a472a;
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    z-index: 10000;
    transition: transform 0.3s;
    text-align: center;
    font-family: -apple-system, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

.install-pwa:hover {
    transform: translateX(-50%) scale(1.03);
}

/* ============================================
   АДАПТИВНОСТЬ (Mobile First)
   ============================================ */

/* Планшеты и маленькие ноутбуки */
@media (max-width: 1024px) {
    .content {
        padding: 20px;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .request-actions-grid {
        grid-template-columns: 1fr;
    }
    
    .equipment-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    
    /* Увеличенные кнопки на планшетах */
    .btn {
        padding: 14px 26px;
        font-size: 16px;
        min-height: 50px;
    }
    
    .btn-block {
        padding: 14px 26px;
        font-size: 16px;
        min-height: 50px;
    }
    
    .btn-sm {
        padding: 6px 14px;
        font-size: 13px;
        min-height: 38px;
    }
}

/* Мобильные устройства (до 768px) */
@media (max-width: 768px) {
    body {
        padding: 5px;
    }
    
    .container {
        border-radius: 12px;
    }
    
    .header {
        padding: 12px 15px;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .header-content {
        gap: 10px;
    }
    
    .header img {
        height: 36px;
    }
    
    .user-info {
        text-align: left;
        padding: 4px 12px;
        border-radius: 12px;
        width: 100%;
    }
    
    .user-info > div:first-child {
        font-size: 13px;
    }
    
    .content {
        padding: 15px;
    }
    
    h2 {
        font-size: 19px;
        padding-left: 12px;
    }
    
    h3 {
        font-size: 16px;
    }
    
    /* ===== КНОПКИ НА МОБИЛЬНЫХ - УВЕЛИЧЕННЫЕ ===== */
    .btn {
        padding: 16px 28px !important;
        font-size: 17px !important;
        min-height: 54px !important;
        border-radius: 10px !important;
        gap: 10px !important;
        font-family: -apple-system, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif !important;
    }
    
    .btn-block {
        padding: 16px 28px !important;
        font-size: 17px !important;
        min-height: 54px !important;
        border-radius: 10px !important;
    }
    
    .btn-sm {
        padding: 8px 16px !important;
        font-size: 14px !important;
        min-height: 40px !important;
        border-radius: 8px !important;
    }
    
    .btn-group {
        gap: 8px;
    }
    
    /* ===== ДАШБОРД: ПЛИТКИ ===== */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .stat-card {
        padding: 14px 10px;
    }
    
    .stat-number {
        font-size: 22px;
    }
    
    .stat-label {
        font-size: 11px;
    }
    
    /* Графики в одну колонку */
    .charts-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .chart-card {
        padding: 15px;
    }
    
    .statuses-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    /* Быстрые действия в одну колонку */
    .request-actions-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .action-card {
        padding: 15px;
    }
    
    /* Карточки заявок */
    .request-info {
        grid-template-columns: 1fr;
        gap: 2px;
    }
    
    .request-header {
        padding: 10px 12px;
    }
    
    .request-body {
        padding: 10px 12px;
    }
    
    .request-number {
        font-size: 13px;
    }
    
    /* Навигация */
    .nav-menu {
        padding: 5px 8px;
    }
    
    .nav-section-header {
        padding: 6px 10px;
    }
    
    .nav-section-title {
        font-size: 12px;
    }
    
    .nav-btn {
        padding: 6px 12px;
        font-size: 12px;
        white-space: normal;
        flex: 1 1 auto;
        justify-content: center;
    }
    
    .nav-buttons {
        gap: 4px;
    }
    
    /* Формы */
    .form-card {
        padding: 15px;
    }
    
    .form-row {
        gap: 10px;
    }
    
    .form-group {
        min-width: 100%;
    }
    
    /* Таблицы */
    .items-table th,
    .items-table td,
    .equipment-table th,
    .equipment-table td,
    .users-table th,
    .users-table td {
        padding: 6px 8px;
        font-size: 12px;
    }
    
    /* Карточки */
    .equipment-grid {
        grid-template-columns: 1fr;
    }
    
    .tmc-grid,
    .objects-grid {
        grid-template-columns: 1fr;
    }
    
    .users-grid {
        grid-template-columns: 1fr;
    }
    
    .spare-parts-grid {
        grid-template-columns: 1fr;
    }
    
    /* Кнопка установки PWA */
    .install-pwa {
        padding: 10px 18px;
        font-size: 14px;
        bottom: 10px;
        width: 90%;
        max-width: 320px;
        border-radius: 20px;
    }
}

/* Маленькие телефоны (до 480px) */
@media (max-width: 480px) {
    .header {
        padding: 10px 12px;
    }
    
    .header img {
        height: 30px;
    }
    
    .header-text h1 {
        font-size: 15px;
    }
    
    .header-text p {
        font-size: 11px;
    }
    
    .user-info > div:first-child {
        font-size: 12px;
    }
    
    .role-badge {
        font-size: 10px;
    }
    
    .content {
        padding: 10px 12px;
    }
    
    h2 {
        font-size: 17px;
        padding-left: 10px;
        margin-bottom: 15px;
    }
    
    h3 {
        font-size: 15px;
        margin-bottom: 10px;
    }
    
    /* ===== КНОПКИ НА МАЛЕНЬКИХ ТЕЛЕФОНАХ - ЕЩЁ БОЛЬШЕ ===== */
    .btn {
        padding: 18px 32px !important;
        font-size: 18px !important;
        min-height: 60px !important;
        border-radius: 10px !important;
        gap: 12px !important;
        font-family: -apple-system, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif !important;
    }
    
    .btn-block {
        padding: 18px 32px !important;
        font-size: 18px !important;
        min-height: 60px !important;
        border-radius: 10px !important;
    }
    
    .btn-sm {
        padding: 8px 16px !important;
        font-size: 14px !important;
        min-height: 40px !important;
        border-radius: 8px !important;
    }
    
    /* ===== ДАШБОРД: ПЛИТКИ В ОДНУ КОЛОНКУ ===== */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .stat-card {
        padding: 12px 8px;
    }
    
    .stat-number {
        font-size: 20px;
    }
    
    .stat-label {
        font-size: 10px;
    }
    
    .chart-card {
        padding: 12px;
    }
    
    .action-card {
        padding: 12px;
    }
    
    /* Навигация */
    .nav-section-header {
        padding: 5px 8px;
    }
    
    .nav-section-title {
        font-size: 11px;
    }
    
    .nav-section-toggle {
        font-size: 10px;
    }
    
    .nav-btn {
        padding: 5px 10px;
        font-size: 11px;
        gap: 3px;
    }
    
    .nav-btn .badge {
        font-size: 9px;
        padding: 0 6px;
        min-width: 16px;
    }
    
    /* Формы */
    .form-card {
        padding: 12px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .form-group label {
        font-size: 12px;
    }
    
    /* Карточки */
    .equipment-header {
        padding: 10px 12px;
    }
    
    .equipment-details h3 {
        font-size: 15px;
    }
    
    .equipment-photo {
        width: 44px;
        height: 44px;
    }
    
    .tmc-card,
    .object-card,
    .spare-part-card,
    .user-card {
        padding: 12px;
    }
    
    .tmc-photo,
    .object-photo,
    .spare-part-photo {
        width: 60px;
        height: 60px;
    }
    
    /* Таблицы */
    .items-table th,
    .items-table td,
    .equipment-table th,
    .equipment-table td,
    .users-table th,
    .users-table td {
        padding: 4px 6px;
        font-size: 11px;
    }
    
    .items-table input,
    .items-table select {
        padding: 4px 6px;
        font-size: 11px;
    }
    
    .remove-row {
        padding: 2px 6px;
        font-size: 10px;
    }
    
    .status-badge {
        font-size: 10px;
        padding: 1px 8px;
    }
    
    /* Кнопка установки PWA */
    .install-pwa {
        padding: 8px 14px;
        font-size: 12px;
        bottom: 8px;
        width: 95%;
        max-width: 280px;
        border-radius: 16px;
    }
}

/* Очень маленькие телефоны (до 360px) */
@media (max-width: 360px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
    
    .stat-card {
        padding: 10px 6px;
    }
    
    .stat-number {
        font-size: 17px;
    }
    
    .stat-label {
        font-size: 9px;
    }
    
    .header-text h1 {
        font-size: 13px;
    }
    
    .content {
        padding: 8px 8px;
    }
    
    .nav-btn {
        font-size: 10px;
        padding: 4px 8px;
    }
    
    /* Кнопки на очень маленьких телефонах */
    .btn {
        padding: 16px 24px !important;
        font-size: 16px !important;
        min-height: 52px !important;
        font-family: -apple-system, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif !important;
    }
    
    .btn-block {
        padding: 16px 24px !important;
        font-size: 16px !important;
        min-height: 52px !important;
    }
}