/* assets/css/style.css */
:root {
    --medical-blue: #0d6efd;
    --medical-light-blue: #e7f1ff;
    --medical-green: #198754;
    --medical-red: #dc3545;
    --medical-warning: #ffc107;
    --medical-purple: #6f42c1;
    --medical-gray: #3e4436;
    --medical-light-green: #656F57;
}

/* ===== ОБЩИЕ СТИЛИ ===== */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
}

/* ===== СТИЛИ ДЛЯ СТРАНИЦЫ ВХОДА ===== */
.login-page {
    background: var(--medical-gray);
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.login-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.login-header {
    background: linear-gradient(90deg, var(--medical-gray) 0%, var(--medical-light-green) 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.login-logo {
    font-size: 3rem;
    margin-bottom: 10px;
    color: white;
}

.login-form {
    padding: 40px;
}

.login-form .form-control {
    border-radius: 10px;
    padding: 12px 20px;
    border: 2px solid #e9ecef;
    transition: all 0.3s;
}

.login-form .form-control:focus {
    border-color: var(--medical-light-green);
    box-shadow: 0 0 0 0.25rem rgba(101, 111, 87, 0.25);
}

.login-form .form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

.login-form .input-group-text {
    background-color: #f8f9fa;
    border: 2px solid #e9ecef;
    border-right: none;
    border-radius: 10px 0 0 10px;
}

.btn-login {
    background: linear-gradient(90deg, var(--medical-gray) 0%, var(--medical-light-green) 100%);
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s;
    width: 100%;
    color: white;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(101, 111, 87, 0.3);
    color: white;
}

.btn-login:disabled {
    opacity: 0.7;
    transform: none !important;
    box-shadow: none !important;
}

.remember-forgot {
    font-size: 0.9rem;
}

.remember-forgot a {
    color: var(--medical-light-green);
    text-decoration: none;
}

.remember-forgot a:hover {
    text-decoration: underline;
}

.role-selector {
    margin-bottom: 20px;
}

.role-btn {
    border: 2px solid #dee2e6;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
    flex: 1;
}

.role-btn:hover {
    border-color: var(--medical-light-green);
    background-color: rgba(101, 111, 87, 0.1);
}

.role-btn.active {
    border-color: var(--medical-light-green);
    background-color: rgba(101, 111, 87, 0.15);
    color: var(--medical-light-green);
    font-weight: 600;
}

.role-icon {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--medical-light-green);
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 20px;
    display: none;
    align-items: center;
}

.success-message {
    background-color: #d1e7dd;
    color: #0f5132;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 20px;
    display: none;
    align-items: center;
}

.login-footer {
    text-align: center;
    padding: 20px;
    color: #6c757d;
    font-size: 0.9rem;
    border-top: 1px solid #e9ecef;
}

.eye-toggle {
    cursor: pointer;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    color: #6c757d;
}

/* ===== СТИЛИ ДЛЯ ГЛАВНОЙ СТРАНИЦЫ ===== */
/* Sidebar */
.sidebar {
    background:var(--medical-light-green);
    color: white;
    min-height: 100vh;
    position: fixed;
    width: 250px;
    z-index: 100;
    box-shadow: 3px 0 15px rgba(0,0,0,0.1);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

.sidebar-header h3 {
    color: white;
}

.user-info {
    padding: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
}

.nav-link {
    color: rgba(255,255,255,0.8);
    padding: 12px 20px;
    border-radius: 8px;
    margin: 2px 10px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    position: relative;
}

.nav-link:hover, .nav-link.active {
    background-color: rgba(255,255,255,0.15);
    color: white;
}

.nav-link i {
    width: 24px;
    margin-right: 10px;
    font-size: 1.1rem;
}

.nav-link.text-danger {
    color: #f8d7da !important;
}

.nav-link.text-danger:hover {
    background-color: rgba(220, 53, 69, 0.2);
}

/* Main Content */
.main-content {
    margin-left: 250px;
    padding: 20px;
    transition: margin-left 0.3s;
    background-color: #f8f9fa;
    min-height: 100vh;
}

/* Cards */
.stat-card {
    border-radius: 12px;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: transform 0.3s;
    height: 100%;
    border-left: 4px solid transparent;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.bg-purple {
    background-color: var(--medical-purple) !important;
}

.bg-purple.bg-opacity-10 {
    background-color: rgba(111, 66, 193, 0.1) !important;
}

.text-purple {
    color: var(--medical-purple) !important;
}

/* Table */
.data-table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 0;
}

.data-table thead {
    background-color: rgba(101, 111, 87, 0.1);
    border-bottom: 2px solid rgba(101, 111, 87, 0.2);
}

.data-table th {
    font-weight: 600;
    color: var(--medical-light-green);
    padding: 15px;
}

.data-table td {
    padding: 15px;
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background-color: rgba(101, 111, 87, 0.05);
}

/* Quick Actions */
.quick-action {
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.3s;
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.quick-action:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(101, 111, 87, 0.15);
    text-decoration: none;
    color: var(--medical-light-green);
}

.action-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 15px;
}

/* Badges */
.badge {
    padding: 6px 12px;
    font-weight: 500;
    border-radius: 20px;
}

/* Form controls */
.form-control, .form-select {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: all 0.3s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--medical-light-green);
    box-shadow: 0 0 0 0.25rem rgba(101, 111, 87, 0.25);
}

/* Buttons */
.btn-outline-primary {
    color: var(--medical-light-green);
    border-color: var(--medical-light-green);
}

.btn-outline-primary:hover {
    background-color: var(--medical-light-green);
    border-color: var(--medical-light-green);
    color: white;
}

.btn-primary {
    background: var(--medical-light-green);
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(101, 111, 87, 0.3);
    background: var(--medical-gray);

}

/* Search */
.search-box .form-control {
    border-radius: 25px;
    padding: 10px 20px;
    border: 2px solid #e9ecef;
}

.search-box .btn {
    border-radius: 25px;
    padding: 10px 25px;
}

/* Notifications */
.notification-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--medical-red);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* List Group */
.list-group-item {
    border-color: rgba(0,0,0,0.05);
    padding: 15px;
}

.list-group-item:hover {
    background-color: rgba(101, 111, 87, 0.05);
}

/* Modal */
.modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.modal-header {
    background: var(--medical-gray);
    color: white;
    border-radius: 15px 15px 0 0 !important;
    padding: 20px;
}

.modal-header .btn-close {
    filter: invert(1);
}

.modal-title {
    color: white;
    font-weight: 600;
}

/* Footer */
footer {
    background-color: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    margin-top: 20px;
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 992px) {
    .sidebar {
        width: 70px;
    }
    
    .sidebar .nav-text {
        display: none;
    }
    
    .sidebar-header h3 {
        display: none;
    }
    
    .user-info .user-name {
        display: none;
    }
    
    .main-content {
        margin-left: 70px;
    }
    
    .nav-link {
        justify-content: center;
        padding: 15px;
    }
    
    .nav-link i {
        margin-right: 0;
        font-size: 1.3rem;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        bottom: 0;
        top: auto;
        width: 100%;
        height: 60px;
        min-height: auto;
        background: white;
        color: #333;
        display: flex;
        justify-content: space-around;
        align-items: center;
        border-top: 1px solid #dee2e6;
    }
    
    .sidebar-header, .user-info {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
        margin-bottom: 70px;
        padding: 15px;
    }
    
    .nav-link {
        flex-direction: column;
        padding: 8px;
        margin: 0;
        font-size: 0.8rem;
        color: #666;
        border-radius: 0;
        background: none !important;
    }
    
    .nav-link i {
        font-size: 1.2rem;
        margin-right: 0;
        margin-bottom: 5px;
    }
    
    .nav-link.active {
        color: var(--medical-light-green);
        background: none;
    }
    
    .nav-link.text-danger {
        color: #dc3545 !important;
    }
    
    .notification-badge {
        position: absolute;
        top: -5px;
        right: 5px;
    }
    
    /* Логин на мобильных */
    .login-page .login-container {
        margin: 20px;
    }
    
    .login-page .login-form {
        padding: 30px 20px;
    }
    
    .login-page .login-header {
        padding: 20px;
    }
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-container, .main-content > * {
    animation: fadeIn 0.5s ease-out;
}

/* Кастомные скроллбары */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--medical-light-green);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--medical-gray);
}



/* ===== СТИЛИ ДЛЯ ПАГИНАЦИИ ===== */
.pagination-wrapper {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px 20px;
    border-radius: 0 0 10px 10px;
    color: white;
}

.pagination-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pagination-info i {
    font-size: 1.2rem;
    opacity: 0.9;
}

.pagination-info span {
    background: rgba(255,255,255,0.2);
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 500;
}

.pagination {
    margin: 0;
    gap: 5px;
}

.page-item {
    margin: 0;
}

.page-link {
    border: none;
    border-radius: 8px !important;
    padding: 8px 14px;
    color: white;
    font-weight: 500;
    transition: all 0.3s;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(5px);
}

.page-link:hover {
    background: rgba(255,255,255,0.3);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.page-item.active .page-link {
    background: white;
    color: #667eea;
    font-weight: 600;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.page-item.disabled .page-link {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.5);
    pointer-events: none;
    transform: none;
}

/* Адаптивность */
@media (max-width: 768px) {
    .pagination-wrapper {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .pagination-info {
        justify-content: center;
    }
    
    .page-link {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
}


        .report-card {
            transition: transform 0.3s;
            height: 100%;
        }
        .report-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        }
        .chart-container {
            position: relative;
            height: 300px;
            margin: 20px 0;
        }
        .export-btn {
            margin-right: 10px;
        }

/* ===== СТИЛИ ДЛЯ ПЕЧАТИ ===== */
@media print {
    .sidebar {
        display: none !important;
    }
    
    .nav,
    .navbar,
    header .btn,
    .quick-action,
    .btn,
    footer,
    .modal,
    .card-header .btn,
    .dataTables_length,
    .dataTables_filter,
    .dataTables_paginate {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    
    .card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
        margin-bottom: 20px !important;
        page-break-inside: avoid;
    }
    
    .table {
        border-collapse: collapse !important;
        width: 100% !important;
    }
    
    .table th {
        background-color: #f2f2f2 !important;
        color: #000 !important;
        font-weight: bold !important;
        border: 1px solid #000 !important;
    }
    
    .table td {
        border: 1px solid #ddd !important;
    }
    
    .badge {
        background-color: transparent !important;
        color: #000 !important;
        border: 1px solid #000 !important;
        font-weight: normal !important;
    }
    
    .badge.bg-success,
    .badge.bg-warning,
    .badge.bg-danger {
        background-color: transparent !important;
    }
    
    h2, h4, h5, h6 {
        color: #000 !important;
    }
    
    .table-danger,
    .table-warning,
    .table-success {
        background-color: transparent !important;
    }
    
    .main-content::before {
        content: "Медицинский склад - Отчет";
        display: block;
        font-size: 18px;
        font-weight: bold;
        text-align: center;
        margin-bottom: 20px;
    }
    
    .main-content::after {
        content: "Дата печати: " attr(data-print-date);
        display: block;
        font-size: 12px;
        text-align: right;
        margin-top: 20px;
        font-style: italic;
    }
    
    .chart-container {
        page-break-inside: avoid;
        max-width: 100% !important;
        height: auto !important;
    }
    
    canvas {
        max-width: 100% !important;
        height: auto !important;
    }
    
    .table i {
        display: none !important;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 90%;
        color: #666;
    }
}