/* Bootstrap Icons */
@import url('https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.0/font/bootstrap-icons.css');

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Основные стили */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f6fa;
}

/* ============================================
   BREADCRUMBS
   ============================================ */
.breadcrumbs-custom {
    background: white;
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    margin-bottom: 25px;
}

.breadcrumbs-custom .breadcrumb {
    margin: 0;
    background: transparent;
    padding: 0;
}

.breadcrumbs-custom .breadcrumb-item {
    color: #667eea;
    font-weight: 500;
}

.breadcrumbs-custom .breadcrumb-item a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumbs-custom .breadcrumb-item a:hover {
    color: #764ba2;
}

.breadcrumbs-custom .breadcrumb-item.active {
    color: #764ba2;
}

.breadcrumbs-custom .breadcrumb-item + .breadcrumb-item::before {
    color: #ccc;
}

/* ============================================
   ACTIVEFORM
   ============================================ */
.form-control,
.form-select {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 12px 15px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
    outline: none;
}

.form-control:hover,
.form-select:hover {
    border-color: #764ba2;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-group label.required::after {
    content: ' *';
    color: #f5576c;
}

.form-text {
    font-size: 0.85rem;
    color: #888;
    margin-top: 0.4rem;
}

/* Поля с ошибками */
.form-control.is-invalid,
.form-select.is-invalid {
    border-color: #f5576c;
    background-image: none;
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
    border-color: #f5576c;
    box-shadow: 0 0 0 3px rgba(245, 87, 108, 0.15);
}

.invalid-feedback {
    color: #f5576c;
    font-size: 0.85rem;
    margin-top: 0.4rem;
    font-weight: 500;
}

/* Checkbox и Radio */
.form-check-input {
    width: 1.2em;
    height: 1.2em;
    margin-top: 0.15em;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
}

.form-check-input:checked {
    background-color: #667eea;
    border-color: #667eea;
}

.form-check-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.form-check-label {
    font-weight: 500;
    color: #555;
    margin-left: 0.3rem;
}

/* Кнопки в формах */
.form-group .btn {
    border-radius: 10px;
    padding: 12px 25px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.form-group .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.form-group .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.form-group .btn-success {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    border: none;
}

.form-group .btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(67, 233, 123, 0.4);
}

/* Input groups */
.input-group-text {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    color: #667eea;
    font-weight: 600;
}

.input-group .form-control {
    border-left: none;
}

.input-group .form-control:focus {
    border-left: none;
}

/* ============================================
   GRIDVIEW
   ============================================ */
.grid-view {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.grid-view table {
    margin: 0;
}

.grid-view thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.grid-view thead th {
    color: #333 !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    padding: 18px 15px;
    border: none;
    background: #f0f0f0 !important;
}

.grid-view thead th a {
    color: #333 !important;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.grid-view thead th a:hover {
    opacity: 0.8;
}

.grid-view tbody td {
    padding: 15px;
    vertical-align: middle;
    border-bottom: 1px solid #f0f0f0;
    color: #555;
    font-size: 0.95rem;
}

.grid-view tbody tr {
    transition: all 0.2s ease;
}

.grid-view tbody tr:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
}

.grid-view tbody tr:last-child td {
    border-bottom: none;
}

/* Ссылки в grid */
.grid-view a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.grid-view a:hover {
    color: #764ba2;
}

/* Фильтры в grid */
.grid-view .filters input,
.grid-view .filters select {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.85rem;
    width: 100%;
    color: #333;
    background: white;
}

.grid-view .filters input:focus,
.grid-view .filters select:focus {
    border-color: #667eea;
    outline: none;
}

.grid-view .filters {
    background: #f8f9fa;
}

.grid-view .filters td,
.grid-view .filters th {
    padding: 10px 15px;
    background: #f8f9fa;
}

.grid-view .filters th {
    color: #333;
    font-weight: 600;
    text-transform: none;
    font-size: 0.9rem;
}

/* Пагинация */
.grid-view .pagination,
.pagination {
    margin: 20px 0;
    padding: 0 15px 15px;
    justify-content: center;
    gap: 5px;
}

.grid-view .pagination .page-item,
.pagination .page-item {
    margin: 0;
}

.grid-view .pagination .page-item .page-link,
.pagination .page-item .page-link {
    border: 2px solid transparent !important;
    background: #f8f9fa !important;
    color: #667eea !important;
    font-weight: 600;
    min-width: 45px;
    text-align: center;
    border-radius: 8px !important;
    transition: all 0.3s ease;
    padding: 10px 16px !important;
}

.grid-view .pagination .page-item .page-link:hover,
.pagination .page-item .page-link:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.grid-view .pagination .page-item.active .page-link,
.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border-color: #667eea !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
}

.grid-view .pagination .page-item.disabled .page-link,
.pagination .page-item.disabled .page-link {
    color: #ccc !important;
    background: #f8f9fa !important;
    cursor: not-allowed;
}

.grid-view .pagination .page-item.disabled,
.pagination .page-item.disabled {
    display: none;
}

/* Summary */
.grid-view .summary,
.pagination-summary {
    padding: 15px 20px;
    color: #888;
    font-size: 0.9rem;
    background: #f8f9fa;
    border-radius: 0 0 15px 15px;
    text-align: left;
}

/* Action кнопки */
.grid-view .btn,
.grid-view .action-column .btn {
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.85rem;
    margin: 0 2px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
}

.grid-view .btn-view {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
}

.grid-view .btn-view:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.4);
    color: white;
}

.grid-view .btn-update {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
    border: none;
}

.grid-view .btn-update:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(67, 233, 123, 0.4);
    color: white;
}

.grid-view .btn-delete {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
}

.grid-view .btn-delete:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 87, 108, 0.4);
    color: white;
}

.grid-view .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Пустой результат */
.grid-view table:empty + .empty-message,
.grid-view .empty {
    text-align: center;
    padding: 50px 20px;
    color: #888;
}

.grid-view .empty i {
    font-size: 4rem;
    color: #e0e0e0;
    display: block;
    margin-bottom: 15px;
}

/* ============================================
   DETAILVIEW
   ============================================ */
.detail-view {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.detail-view table {
    margin: 0;
}

.detail-view th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    padding: 15px 20px;
    width: 200px;
}

.detail-view td {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    color: #555;
    font-size: 0.95rem;
}

.detail-view tr:last-child td {
    border-bottom: none;
}

.detail-view tr:nth-child(even) td {
    background: #f8f9fa;
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    border: none;
    border-radius: 12px;
    padding: 15px 20px;
    font-weight: 500;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.alert-success {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
}

.alert-danger {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.alert-warning {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
}

.alert-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.alert .close {
    color: white;
    opacity: 0.8;
    font-weight: 300;
}

.alert .close:hover {
    opacity: 1;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    overflow: hidden;
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    padding: 15px 20px;
    border: none;
}

.card-body {
    padding: 25px;
}

.card-footer {
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    padding: 15px 20px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    border-radius: 10px;
    padding: 10px 20px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.btn-success {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.btn-warning {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: #333;
}

.btn-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0.7;
}

.btn-outline-primary {
    border: 2px solid #667eea;
    color: #667eea;
    background: transparent;
}

.btn-outline-primary:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

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

/* ============================================
   BADGES
   ============================================ */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.8rem;
}

.badge.bg-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.badge.bg-success {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%) !important;
}

.badge.bg-danger {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
}

.badge.bg-warning {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%) !important;
    color: #333;
}

.badge.bg-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
}

/* ============================================
   MODALS
   ============================================ */
.modal-content {
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 20px 25px;
}

.modal-title {
    font-weight: 600;
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    border: none;
    padding: 15px 25px;
    background: #f8f9fa;
}

/* ============================================
   TABS
   ============================================ */
.nav-tabs {
    border: none;
    margin-bottom: 20px;
}

.nav-tabs .nav-link {
    border: none;
    color: #666;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 10px 10px 0 0;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.nav-tabs .nav-link.active {
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.tab-content {
    background: white;
    border-radius: 0 0 15px 15px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

/* ============================================
   NAVBAR (HEADER)
   ============================================ */
.navbar-custom {
    background: var(--primary-gradient);
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    padding: 15px 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: white !important;
}

.navbar-nav .nav-link {
    color: rgba(255,255,255,0.9) !important;
    font-weight: 500;
    padding: 10px 20px !important;
    transition: all 0.3s ease;
    border-radius: 25px;
    margin: 0 5px;
}

.navbar-nav .nav-link:hover {
    background: rgba(255,255,255,0.15);
    color: white !important;
}

.navbar-nav .nav-link.active {
    background: rgba(255,255,255,0.2);
}

.btn-navbar {
    background: rgba(255,255,255,0.2);
    border: 2px solid white;
    color: white !important;
    padding: 8px 25px !important;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.btn-navbar:hover {
    background: white;
    color: #667eea !important;
}

.btn-navbar-primary {
    background: white;
    color: #667eea !important;
    border: 2px solid white;
    padding: 8px 25px !important;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.btn-navbar-primary:hover {
    background: transparent;
    color: white !important;
}

.navbar-custom .dropdown-menu {
    border: none;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    border-radius: 10px;
}

.navbar-custom .dropdown-item:hover {
    background: #f8f9fa;
}

/* ============================================
   FOOTER
   ============================================ */
.footer-custom {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 40px 0 20px;
    margin-top: 80px;
}

.footer-custom a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-custom a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    margin-top: 30px;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: white !important;
    margin-right: 10px;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-3px);
}
