/* ================================================
   КОМПОНЕНТЫ — общие стили для всех страниц
   Романа Логистика
   ================================================ */

/* ===== КНОПКИ ===== */
.btn {
    border-radius: 10px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    padding: 9px 20px !important;
    transition: all 0.2s !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    border: none !important;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.15) !important;
}

.btn:active {
    transform: translateY(0) !important;
}

.btn-lg {
    padding: 11px 24px !important;
    font-size: 15px !important;
    border-radius: 12px !important;
}

.btn-sm {
    padding: 5px 12px !important;
    font-size: 12px !important;
    border-radius: 8px !important;
}

.btn-primary {
    background: linear-gradient(135deg, #0d6efd, #6610f2) !important;
    color: white !important;
}
.btn-primary:hover {
    background: linear-gradient(135deg, #0b5ed7, #5a0dc5) !important;
}
.btn-primary:disabled {
    background: #adb5bd !important;
    transform: none !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
    opacity: 0.7 !important;
}

.btn-success {
    background: linear-gradient(135deg, #198754, #20c997) !important;
    color: white !important;
}
.btn-success:hover {
    background: linear-gradient(135deg, #146c43, #1aa47e) !important;
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545, #e83e8c) !important;
    color: white !important;
}
.btn-danger:hover {
    background: linear-gradient(135deg, #b02a37, #c2316e) !important;
}
.btn-danger:disabled {
    background: #adb5bd !important;
    transform: none !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
    opacity: 0.7 !important;
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107, #fd7e14) !important;
    color: #1a1a2e !important;
}
.btn-warning:hover {
    background: linear-gradient(135deg, #e0a800, #e06c0d) !important;
}

.btn-outline-primary {
    background: transparent !important;
    border: 2px solid #0d6efd !important;
    color: #0d6efd !important;
}
.btn-outline-primary:hover {
    background: #0d6efd !important;
    color: white !important;
}

.btn-outline-danger {
    background: transparent !important;
    border: 2px solid #dc3545 !important;
    color: #dc3545 !important;
}
.btn-outline-danger:hover {
    background: #dc3545 !important;
    color: white !important;
}

.btn-outline-secondary {
    background: transparent !important;
    border: 2px solid #6c757d !important;
    color: #6c757d !important;
}
.btn-outline-secondary:hover {
    background: #6c757d !important;
    color: white !important;
}

/* ===== КАРТОЧКИ ===== */
.card {
    border: none !important;
    border-radius: 16px !important;
    box-shadow: 0 2px 16px rgba(0,0,0,0.07) !important;
    overflow: hidden;
}

.card-header {
    padding: 14px 20px !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    border-bottom: none !important;
}

.card-header.bg-primary {
    background: linear-gradient(135deg, #0d6efd, #6610f2) !important;
}

.card-body {
    padding: 24px !important;
}

/* ===== ФОРМЫ ===== */
.form-control,
.form-select {
    border-radius: 10px !important;
    border: 1.5px solid #e0e0e0 !important;
    padding: 9px 14px !important;
    font-size: 14px !important;
    transition: border-color 0.2s, box-shadow 0.2s !important;
    background: #fafafa !important;
}

.form-control:focus,
.form-select:focus {
    border-color: #0d6efd !important;
    box-shadow: 0 0 0 3px rgba(13,110,253,0.1) !important;
    background: white !important;
    outline: none !important;
}

.form-label {
    font-weight: 600 !important;
    font-size: 13px !important;
    color: #444 !important;
    margin-bottom: 6px !important;
}

textarea.form-control {
    resize: vertical !important;
    min-height: 80px !important;
}

/* ===== АЛЕРТЫ ===== */
.alert {
    border: none !important;
    border-radius: 12px !important;
    padding: 14px 18px !important;
    font-size: 14px !important;
}

.alert-success {
    background: #d1f0d1 !important;
    color: #0d5e2a !important;
}

.alert-danger {
    background: #fde8e8 !important;
    color: #7f1d1d !important;
}

.alert-warning {
    background: #fff3cd !important;
    color: #7d5a00 !important;
}

/* ===== ТАБЛИЦА jSpreadsheet — обёртка ===== */
.spreadsheet-wrap {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.07);
    overflow: hidden;
    width: 100%;
}

.spreadsheet-wrap .jexcel_content {
    width: 100% !important;
}

/* ===== ПАНЕЛЬ ДЕЙСТВИЙ НАД ТАБЛИЦЕЙ ===== */
.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.table-toolbar-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-toolbar-title .count-badge {
    background: #f0f4ff;
    color: #0d6efd;
    font-size: 13px;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 20px;
}

.table-toolbar-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ===== ЗАГОЛОВОК СТРАНИЦЫ ===== */
.page-header {
    margin-bottom: 28px;
}

.page-header h2 {
    font-size: 26px;
    font-weight: 800;
    color: #1a1a2e;
    margin-bottom: 4px;
}

.page-header p {
    color: #888;
    font-size: 14px;
    margin: 0;
}

/* ===== ТОСТ ===== */
.toast-notify {
    position: fixed;
    bottom: 28px;
    right: 28px;
    padding: 14px 22px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    box-shadow: 0 8px 28px rgba(0,0,0,0.2);
    z-index: 11000;
    animation: toastIn 0.25s ease;
}
#addFormChevron {
    transition: transform 0.3s ease;
}
/* ===== БЕЙДЖИ В НАВИГАЦИИ ===== */
.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 6px;
    background: rgba(0,0,0,0.2);
    color: white;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    margin-left: 6px;
    vertical-align: middle;
}

.nav-badge--green {
    background: rgba(0,0,0,0.2);
}

/* На активной ссылке */
.nav-link.active .nav-badge {
    background: rgba(255,255,255,0.25);
    color: white;
}
.search-error {
    padding: 12px;
    color: #dc3545;
    background: #fff5f5;
    border-left: 4px solid #dc3545;
    font-size: 14px;
    text-align: center;
}
@keyframes toastIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.toast-success { background: linear-gradient(135deg, #198754, #20c997); }
.toast-warning { background: linear-gradient(135deg, #ffc107, #fd7e14); color: #1a1a2e; }
.toast-danger  { background: linear-gradient(135deg, #dc3545, #e83e8c); }

/* ===== АДАПТИВ ===== */
@media (max-width: 768px) {
    .table-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .table-toolbar-actions {
        width: 100%;
    }

    .table-toolbar-actions .btn {
        flex: 1;
        justify-content: center;
    }

    .card-body {
        padding: 16px !important;
    }

    .page-header h2 {
        font-size: 20px;
    }

    /* Скролл таблицы на телефоне */
    .spreadsheet-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Форма добавления — все поля на всю ширину */
    .col-md-4,
    .col-md-3,
    .col-md-2 {
        width: 100% !important;
    }
}

@media (max-width: 480px) {
    .table-toolbar-title {
        font-size: 16px;
    }

    .btn-lg {
        padding: 10px 16px !important;
        font-size: 13px !important;
    }
}