/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

/* Custom styles for Cabinet app - работает с Bootstrap */

/* Layout - только для sidebar */
.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: #2c3e50;
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 1000;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid #34495e;
}

.sidebar-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.sidebar-header h2 a {
    color: white;
    text-decoration: none;
    transition: color 0.3s ease;
}

.sidebar-header h2 a:hover {
    color: #3498db;
}

.sidebar-menu {
    flex: 1;
    list-style: none;
    padding: 1rem 0;
    margin: 0;
}

.sidebar-menu li {
    margin: 0.25rem 0;
}

.sidebar-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.3s ease;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: #34495e;
    color: white;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid #34495e;
}

.user-info {
    margin-bottom: 1rem;
}

.user-info .role {
    font-size: 0.875rem;
    color: #95a5a6;
    text-transform: uppercase;
}

.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 2rem;
    overflow-y: auto;
    background: #f8f9fa;
}

.main-content.full-width {
    margin-left: 0;
    width: 100%;
}

/* Custom button styles for sidebar only */
.sidebar .btn {
    width: 100%;
    border-radius: 4px;
}

/* Login page override */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem;
}

.login-card {
    background: rgba(255, 255, 255);
    backdrop-filter: blur(10px);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 420px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-header h2 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 2rem;
    font-weight: 700;
}

.login-header p {
    color: #7f8c8d;
    font-size: 1rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.login-form .form-group {
    position: relative;
    margin-bottom: 1.5rem !important;
}

.login-form .form-group label {
    position: absolute;
    top: -0.5rem;
    left: 1rem;
    background: rgba(255, 255, 255, 0.9);
    padding: 0 0.5rem;
    color: #667eea !important;
    font-size: 0.875rem;
    font-weight: 600;
    z-index: 1;
}

.login-form .form-group input.form-control {
    width: 100% !important;
    padding: 1rem 1.5rem !important;
    border: 2px solid #e1e5e9 !important;
    border-radius: 12px !important;
    font-size: 1rem !important;
    transition: all 0.3s ease !important;
    background: rgba(255, 255, 255, 0.8) !important;
    outline: none !important;
    box-shadow: none !important;
}

.login-form .form-group input.form-control:focus {
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
    background: rgba(255, 255, 255, 1) !important;
    transform: translateY(-2px);
}

.login-form .form-group input.form-control::placeholder {
    color: #a0aec0 !important;
}

.login-form button.btn,
.login-form .btn {
    padding: 1rem 2rem !important;
    border: none !important;
    border-radius: 12px !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: all 0.3s ease !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    text-decoration: none !important;
}

.login-form button.btn.btn-primary,
.login-form .btn.btn-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #ec4899 100%) !important;
    background-color: #4f46e5 !important;
    color: white !important;
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.4) !important;
    border: none !important;
    border-color: transparent !important;
}

.login-form button.btn.btn-primary::before,
.login-form .btn.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.login-form button.btn.btn-primary:hover,
.login-form .btn.btn-primary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 12px 25px rgba(79, 70, 229, 0.5) !important;
    background: linear-gradient(135deg, #4338ca 0%, #6d28d9 50%, #db2777 100%) !important;
    background-color: #4338ca !important;
    border-color: transparent !important;
}

.login-form button.btn.btn-primary:hover::before,
.login-form .btn.btn-primary:hover::before {
    left: 100%;
}

.login-form button.btn.btn-primary:active,
.login-form .btn.btn-primary:active {
    transform: translateY(0) !important;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #ec4899 100%) !important;
    background-color: #4f46e5 !important;
}

.login-form button.btn.btn-primary:focus,
.login-form .btn.btn-primary:focus {
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.3) !important;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #ec4899 100%) !important;
    background-color: #4f46e5 !important;
}

.login-form .btn-full {
    width: 100% !important;
    margin-top: 2rem;
}

/* Home page */
.hero {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin: -2rem -2rem 2rem -2rem;
    border-radius: 0 0 1rem 1rem;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
}

/* Flash messages - дополняют Bootstrap alerts */
.flash-messages {
    margin-bottom: 1rem;
}

.flash {
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    border-left: 4px solid;
}

.flash-success {
    background: #d4edda;
    color: #155724;
    border-left-color: #28a745;
}

.flash-error {
    background: #f8d7da;
    color: #721c24;
    border-left-color: #dc3545;
}

.flash-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left-color: #17a2b8;
}

/* Breadcrumbs - дополняют Bootstrap breadcrumb */
.breadcrumbs {
    margin-bottom: 1rem;
    padding: 0.5rem 0;
    color: #6c757d;
}

.breadcrumbs a {
    color: #007bff;
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

/* Дополнительные утилиты для Bootstrap */
.text-gray-800 {
    color: #5a5c69 !important;
}

/* Стили для интерактивных карточек дашборда */
.dashboard-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.dashboard-card:active {
    transform: translateY(0);
}

/* Убираем подчеркивание у ссылок на карточках */
a.text-decoration-none:hover {
    text-decoration: none !important;
}

/* Стили для группировки станций в таблице маппингов */
.station-group-start {
    border-top: 2px solid #e3e6f0 !important;
}

.table-separator td {
    border: none !important;
    padding: 0.25rem !important;
}

/* Дополнительные стили для таблиц */
.table-responsive .table {
    margin-bottom: 0;
}

.table th {
    border-top: none;
    font-weight: 600;
    background-color: #f8f9fc;
    color: #5a5c69;
}

.border-left-primary {
    border-left: 0.25rem solid #4e73df !important;
}

.border-left-success {
    border-left: 0.25rem solid #1cc88a !important;
}

.border-left-info {
    border-left: 0.25rem solid #36b9cc !important;
}

.border-left-warning {
    border-left: 0.25rem solid #f6c23e !important;
}

.border-left-dark {
    border-left: 0.25rem solid #5a5c69 !important;
}

.border-left-secondary {
    border-left: 0.25rem solid #8B5A96 !important;
}

.text-secondary {
    color: #8B5A96 !important;
}

/* Styles for transactions page */
.transactions-header {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e3e6f0;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

.transactions-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: nowrap;
    padding: 0.5rem 0;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: auto;
}

.control-group label {
    color: #5a5c69 !important;
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    margin-bottom: 0 !important;
}

.enhanced-select {
    min-width: 120px;
    padding: 0.5rem 2.5rem 0.5rem 0.75rem !important;
    border: 2px solid #d1d3e2 !important;
    border-radius: 6px !important;
    background: #fff !important;
    font-size: 0.875rem !important;
    font-weight: 500;
    color: #5a5c69 !important;
    transition: all 0.3s ease !important;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e") !important;
    background-position: right 0.5rem center !important;
    background-repeat: no-repeat !important;
    background-size: 1.5em 1.5em !important;
}

.enhanced-select:focus {
    outline: none !important;
    border-color: #4e73df !important;
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25) !important;
}

.enhanced-select:hover {
    border-color: #4e73df !important;
}

.control-suffix {
    color: #5a5c69;
    font-size: 0.875rem;
    white-space: nowrap;
}

/* Enhanced table styling */
.transactions-table {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

.transactions-table .table {
    margin-bottom: 0;
}

.transactions-table .table th {
    background: #f8f9fc;
    border-top: none;
    border-bottom: 2px solid #e3e6f0;
    color: #5a5c69;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1rem 0.75rem;
}

.transactions-table .table td {
    border-color: #e3e6f0;
    color: #5a5c69;
    font-size: 0.875rem;
    padding: 0.75rem;
    vertical-align: middle;
}

.transactions-table .table tbody tr:hover {
    background-color: #f8f9fc;
}

/* Badge styling */
.badge.bg-warning {
    background-color: #f6c23e !important;
    color: #1c1e21 !important;
    font-weight: 600;
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
}

/* Pagination improvements */
.dataTables_info {
    color: #858796;
    font-size: 0.875rem;
    margin-bottom: 0;
}

.pagination .page-link {
    color: #5a5c69;
    border-color: #dddfeb;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
}

.pagination .page-item.active .page-link {
    background-color: #4e73df;
    border-color: #4e73df;
}

.pagination .page-link:hover {
    color: #224abe;
    background-color: #eaecf4;
    border-color: #dddfeb;
}

/* Styles for users page */
.users-header {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e3e6f0;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

.users-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: nowrap;
    padding: 0.5rem 0;
}

.users-table {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

.users-table .table {
    margin-bottom: 0;
}

.users-table .table th {
    background: #f8f9fc;
    border-top: none;
    border-bottom: 2px solid #e3e6f0;
    color: #5a5c69;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1rem 0.75rem;
}

.users-table .table td {
    border-color: #e3e6f0;
    color: #5a5c69;
    font-size: 0.875rem;
    padding: 0.75rem;
    vertical-align: middle;
}

.users-table .table tbody tr:hover {
    background-color: #f8f9fc;
}

/* Styles for dashboard page */
.dashboard-transactions-header {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e3e6f0;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

.dashboard-transactions-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: nowrap;
    padding: 0.5rem 0;
}

.dashboard-transactions {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

.dashboard-transactions .table {
    margin-bottom: 0;
}

.dashboard-transactions .table th {
    background: #f8f9fc;
    border-top: none;
    border-bottom: 2px solid #e3e6f0;
    color: #5a5c69;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1rem 0.75rem;
}

.dashboard-transactions .table td {
    border-color: #e3e6f0;
    color: #5a5c69;
    font-size: 0.875rem;
    padding: 0.75rem;
    vertical-align: middle;
}

.dashboard-transactions .table tbody tr:hover {
    background-color: #f8f9fc;
}

/* Responsive */
@media (max-width: 576px) {
    .transactions-controls,
    .users-controls,
    .dashboard-transactions-controls {
        gap: 1rem;
        flex-wrap: wrap;
    }
    
    .control-group {
        min-width: auto;
        flex: 1;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .hero {
        padding: 2rem 1rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .login-container {
        padding: 0.5rem;
    }
    
    .login-card {
        padding: 2rem 1.5rem;
        border-radius: 16px;
        max-width: 100%;
    }
    
    .login-header h2 {
        font-size: 1.75rem;
    }
    
    .login-form .form-group input.form-control {
        padding: 0.875rem 1.25rem !important;
    }
    
    .login-form .btn {
        padding: 0.875rem 1.5rem !important;
    }
    
    .transactions-controls,
    .users-controls,
    .dashboard-transactions-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .control-group {
        justify-content: space-between;
    }
}



/* Profile page styles */
.profile-container {
    max-width: 1200px;
    margin: 0 auto;
}

.profile-card {
    border-radius: 12px;
    border: 1px solid #e3e6f0;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    transition: all 0.3s ease;
}

.profile-card:hover {
    box-shadow: 0 0.25rem 2rem 0 rgba(58, 59, 69, 0.2);
}

.profile-card .card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
    border-bottom: none;
}

.profile-card .card-header h6 {
    color: white;
    font-weight: 600;
}

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

.profile-form .form-label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.profile-form .form-control {
    border-radius: 8px;
    border: 2px solid #e1e5e9;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.profile-form .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.profile-form .form-control-plaintext {
    padding: 0.75rem 0;
    border-bottom: 1px solid #e1e5e9;
}

.profile-form .btn {
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

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

.profile-form .btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.profile-form .btn-warning {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    border: none;
    color: white;
}

.profile-form .btn-warning:hover {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
}

.user-info .btn {
    background: transparent;
    border: 1px solid #34495e;
    color: #bdc3c7;
    transition: all 0.3s ease;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-info .btn:hover {
    background: #34495e;
    border-color: #3498db;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.user-info .btn:focus {
    background: #34495e;
    border-color: #3498db;
    color: white;
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

.user-info .btn i {
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.user-info .btn:hover i {
    opacity: 1;
}

/* Alert improvements for profile page */
.alert {
    border-radius: 8px;
    border: none;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.alert-success {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
}

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

.alert .btn-close {
    filter: invert(1);
}

/* Responsive improvements for profile */
@media (max-width: 768px) {
    .profile-container {
        padding: 0 1rem;
    }
    
    .profile-form .btn {
        width: 100%;
        margin-bottom: 1rem;
    }
} 

/* Стили для таблицы маппингов */
.table-separator {
    border-top: 2px solid #ddd !important;
}

.station-group-start {
    border-top: 1px solid #6c757d;
}

.station-info {
    line-height: 1.2;
}

.station-info .station-id {
    font-weight: bold;
    color: #495057;
}

.station-info .station-description {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* Стили для модального окна маппингов */
.mapping-form .form-group {
    margin-bottom: 1rem;
}

.mapping-form select {
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
}

.mapping-form select:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
} 