/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* Sidebar: колонка с прокруткой только у меню, шапка и «Выйти» зафиксированы */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    height: 100vh;
    background: #1B1C3C;
    color: white;
    padding: 20px 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.sidebar-header {
    flex-shrink: 0;
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 20px;
}

.sidebar-header h2 {
    font-size: 24px;
    margin-bottom: 8px;
}

.user-role {
    font-size: 12px;
    opacity: 0.7;
    margin-bottom: 4px;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
}

.sidebar-menu {
    list-style: none;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    margin-bottom: 20px;
    scrollbar-width: none;           /* Firefox: без полосы прокрутки */
    -ms-overflow-style: none;        /* IE/Edge */
}
.sidebar-menu::-webkit-scrollbar {
    display: none;                   /* Chrome/Safari: без полосы прокрутки */
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar-menu li a:hover,
.sidebar-menu li a.active {
    background: rgba(255,255,255,0.1);
    color: white;
}

.sidebar-menu .icon {
    margin-right: 12px;
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    flex-shrink: 0;
    padding: 0 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
}

.logout-btn {
    width: 100%;
    padding: 10px;
    background: rgba(255,255,255,0.1);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: rgba(255,255,255,0.2);
}

/* Main Content */
.main-content {
    margin-left: 260px;
    padding: 30px;
    min-height: 100vh;
}

.main-content.full-width {
    margin-left: 0;
}

/* Navigation links */
.nav-link {
    text-decoration: none;
    color: inherit;
}

.admin-only {
    display: block;
}

/* Login */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1B1C3C 0%, #2c3e50 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 8px;
    color: #1B1C3C;
}

.login-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.login-form input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.login-form input:focus {
    outline: none;
    border-color: #1B1C3C;
}

/* Card forms - стиль приложения */
.card .form,
.card form {
    max-width: 600px;
}
.card .form-group,
.card form .form-group {
    margin-bottom: 20px;
}
.card .form-group label,
.card form .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}
.card .form-group input[type="number"],
.card .form-group input[type="text"],
.card .form-group input[type="email"],
.card form .form-group input[type="number"],
.card form .form-group input[type="text"],
.card form .form-group input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    color: #333;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.card .form-group input:focus,
.card form .form-group input:focus {
    outline: none;
    border-color: #1B1C3C;
    box-shadow: 0 0 0 2px rgba(27, 28, 60, 0.15);
}
.card .form-group input::placeholder {
    color: #999;
}

/* Payments tabs */
.payments-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    background: #e9ecef;
    padding: 4px;
    border-radius: 12px;
    width: fit-content;
}
.payments-tab {
    padding: 10px 24px;
    border: none;
    background: transparent;
    color: #6c757d;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
}
.payments-tab:hover {
    color: #495057;
}
.payments-tab.active {
    background: #1B1C3C;
    color: white;
    box-shadow: 0 2px 8px rgba(27, 28, 60, 0.3);
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 28px;
    color: #1B1C3C;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    font-size: 48px;
    color: #1B1C3C;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: #f0f0f0;
    border-radius: 12px;
}

.stat-icon i {
    font-size: 40px;
}

.stat-info h3 {
    font-size: 32px;
    margin-bottom: 4px;
    color: #1B1C3C;
}

.stat-info p {
    color: #666;
    font-size: 14px;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: #f8f9fa;
}

.data-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #ddd;
}

.data-table td {
    padding: 16px;
    border-bottom: 1px solid #eee;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.text-center {
    text-align: center;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background: #1B1C3C;
    color: white;
}

.btn-primary:hover {
    background: #2a2d5a;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
    display: block;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-error {
    background: #f8d7da;
    color: #721c24;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

/* Alerts */
.alert {
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Detail Cards */
.user-detail-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 30px;
}

.detail-section {
    margin-bottom: 30px;
}

.detail-section h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #1B1C3C;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-item label {
    font-weight: 600;
    color: #666;
    font-size: 14px;
}

.detail-item span {
    font-size: 16px;
    color: #333;
}

/* Quick Actions */
.quick-actions {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.quick-actions h2 {
    margin-bottom: 20px;
    color: #1B1C3C;
}

.action-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Error Page */
.error-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.error-box {
    text-align: center;
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.error-box h1 {
    font-size: 32px;
    margin-bottom: 16px;
    color: #1B1C3C;
}

.error-box p {
    font-size: 18px;
    color: #666;
    margin-bottom: 24px;
}

/* Google Sign-In Button */
.btn-google {
    background: white;
    color: #333;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-google:hover {
    background: #f8f9fa;
    border-color: #ccc;
}

/* Google Sign-In Button Container */
#google-signin-button {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 0 auto;
    text-align: center;
}

#google-signin-button > div {
    margin: 0 auto !important;
    display: inline-block !important;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.modal-body label {
    display: block;
    margin: 15px 0;
    font-size: 16px;
    cursor: pointer;
    user-select: none;
}

.modal-body input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.modal-body .btn {
    margin-right: 10px;
}

