body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f9;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 20px auto;
    padding: 0 20px;
}

header {
    background-color: #007aff;
    color: white;
    padding: 10px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1, h2 {
    margin-top: 25px;
    color: #333;
}

nav a {
    color: white;
    text-decoration: none;
    margin-right: 15px;
    font-weight: 500;
    opacity: 0.8;
}

nav a:hover, nav a.active {
    opacity: 1;
}

button, .btn {
    background-color: #007aff;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

button:hover, .btn:hover {
    background-color: #0051c7;
}

button:disabled {
    background-color: #ccc;
    cursor: default;
}

.logout-btn {
    background-color: #ff3b30;
}

.logout-btn:hover {
    background-color: #d60d06;
}

/* Login Styles */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    text-align: center;
    width: 350px;
}

input[type="text"], input[type="password"], input[type="month"], select {
    padding: 10px;
    margin: 5px 0;
    border-radius: 5px;
    border: 1px solid #ccc;
    box-sizing: border-box;
}

.full-width {
    width: 100%;
}

/* Stats Styles */
.stats-grid {
    display: grid;
    /* Изменено: Уменьшен minmax для лучшего размещения 5 карточек баланса на user.html */
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    text-align: center;
}

/* Добавлено: Стиль для карточки холда */
.stat-card-hold {
    background-color: #fff0e0; /* Слегка оранжевый фон для выделения */
}

.stat-value {
    font-size: 2em;
    font-weight: bold;
    color: #007aff;
}

/* Data Section and Table Styles */
.data-section {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

th, td {
    padding: 12px 15px;
    border: 1px solid #ddd;
    text-align: left;
    white-space: nowrap;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
}

th {
    background-color: #f8f8f8;
    font-weight: 600;
}

tr:hover {
    background-color: #f1f1f1;
}

/* Добавлено: Стили для таблицы деталей пользователя (user.html) */
table.details-table th {
    width: 30%; /* Задаем ширину для колонки с названием поля */
    text-align: right;
    padding-right: 20px;
    white-space: normal; /* Разрешаем перенос, если название поля длинное */
}

table.details-table td {
    white-space: normal; /* Разрешаем перенос текста в значениях */
    max-width: none;
    word-break: break-all; /* Для длинных токенов, ID или email */
}

a {
    color: #007aff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.pagination {
    margin-top: 20px;
    text-align: center;
}

.pagination button {
    margin: 0 5px;
}

.loader {
    text-align: center;
    padding: 20px;
    font-style: italic;
}

.error-message {
    color: #ff3b30;
    background-color: #ffecec;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 15px;
}

.controls {
    margin-bottom: 15px;
}

.search-input {
    width: 300px;
}