body {
    font-family: Arial, sans-serif;
    background: #f5f7fa;
    margin: 0;
    padding: 20px;
    color: #333;
}

.page-title {
    text-align: center;
    margin-bottom: 20px;
}

.card {
    max-width: 1100px;
    margin: 0 auto 24px auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    padding: 20px;
}

.files {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.files th {
    background: #f1f5f9;
    text-align: left;
    padding: 10px 8px;
    border-bottom: 2px solid #e5e7eb;
}

.files td {
    padding: 10px 8px;
    border-bottom: 1px solid #eef2f7;
    vertical-align: top;
}

.files tr:hover {
    background: #fafcff;
}

.files a {
    color: #2563eb;
    text-decoration: none;
}

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

.files small {
    display: block;
    margin-top: 4px;
    color: #64748b;
    word-break: break-all;
}

.summary {
    max-width: 1100px;
    margin: 0 auto 24px auto;
    text-align: right;
    font-weight: bold;
}

.row-even,
.row-odd {
    background: transparent;
}

.err {
    color: #dc2626;
}

.ok {
    color: #16a34a;
}
.files th.center,
.files td.center {
    text-align: center;
}

.files th.right,
.files td.right {
    text-align: right;
}
.drop-zone {
    border: 2px dashed #999;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    color: #666;
    background: #fafafa;
    transition: all 0.2s ease;
    cursor: pointer;
}

.drop-zone.dragover {
    border-color: #4caf50;
    background: #f0fff0;
    color: #000;
}

.drop-zone small {
    display: block;
    margin-top: 8px;
    color: #888;
}
.top-bar {
    max-width: 1100px;
    margin: 0 auto 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,.05);
    font-size: 14px;
}

.top-bar-user {
    color: #fff;
    font-weight: 500;
}
.top-bar-user small {
    color: rgba(255,255,255,0.7);
    margin-left: 8px;
}

.btn-link {
    color: #fff;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.5);
    transition: background 0.12s, border-color 0.12s;
}
.btn-link:hover {
    background: rgba(255,255,255,0.18);
    border-color: #fff;
}
/* Имя файла — якорь (a name=...), не ссылка. Не подчёркиваем при наведении. */
.files a:not([href]) {
    color: inherit;
    cursor: default;
}
.files a:not([href]):hover {
    text-decoration: none;
}

/* Вертикальное центрирование ячеек таблицы файлов
   (после добавления иконки календаря строки разной высоты) */
.files td,
.files th {
    vertical-align: middle;
}

/* Иконки в топ-баре — делаем белыми */
.top-bar img {
    filter: brightness(0) invert(1);
    opacity: 0.85;
}
.top-bar img:hover {
    opacity: 1;
}

/* =====================================================
   LOGIN PAGE
   ===================================================== */
.login-box {
    width: 360px;
    margin: 120px auto;
    background: #fff;
    border-radius: 14px;
    padding: 28px;
    box-shadow: 0 10px 30px rgba(0,0,0,.08);
}
.login-box h2 {
    margin-top: 0;
    text-align: center;
}
.login-input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px;
    border: 1px solid #d0d7e2;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 14px;
}
.login-btn {
    width: 100%;
    padding: 12px;
    border: 0;
    border-radius: 8px;
    background: #2f6fed;
    color: #fff;
    cursor: pointer;
    font-size: 15px;
}
.login-btn:hover {
    background: #1d4ed8;
}
.login-btn-secondary {
    background: #6c757d;
    margin-top: 8px;
}
.login-btn-secondary:hover {
    background: #5a6268;
}
.login-err {
    color: #c62828;
    margin-bottom: 12px;
    text-align: center;
    font-size: 14px;
}
.login-divider {
    text-align: center;
    margin: 18px 0;
    color: #888;
    font-size: 12px;
}

/* ===== Этап A: улучшения таблицы файлов (2026-06-04) ===== */
.files td.size, .files th.size { white-space: nowrap; text-align: center; width: 1%; }
/* width:1% — колонки дат сжимаются по содержимому, промежутки равномерные как у размера */
.files td.date, .files th.date { white-space: nowrap; text-align: center; width: 1%; }
.files td.actions { white-space: nowrap; width: 1%; text-align: right; }
.files .action-group { display: inline-flex; align-items: center; gap: 14px; justify-content: flex-end; }
.files .action-group a { display: inline-flex; align-items: center; line-height: 0; position: relative; }
.files .action-group img { opacity: 0.75; transition: opacity 0.12s; }
.files .action-group a:hover img { opacity: 1; }

/* Кнопка раскрытия [+] — крупная, заметная, как кнопка */
.files .toggle-row {
    cursor: pointer;
    user-select: none;
    display: inline-block;
    width: 22px;
    height: 22px;
    line-height: 20px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    font-family: monospace;
    color: #2563eb;
    border: 1px solid #bfdbfe;
    border-radius: 5px;
    background: #eff6ff;
    transition: background 0.12s, color 0.12s;
}
.files .toggle-row:hover {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

.files .file-url-row { display: none; }
.files .file-url-row.open { display: table-row; }
.files .file-url-row td { padding-top: 0; border-bottom: 1px solid #eef2f7; }
.files .file-url-row small { color: #64748b; word-break: break-all; }
.files .group-header { cursor: pointer; user-select: none; }
.files .group-header .grp-arrow { display: inline-block; width: 14px; transition: transform 0.15s; font-size: 11px; }
.files .group-header.collapsed .grp-arrow { transform: rotate(-90deg); }
.files .group-count { color: #64748b; font-weight: normal; font-size: 13px; margin-left: 6px; }
.forever-box { margin-top: 6px; font-size: 13px; color: #475569; }
.forever-box input { vertical-align: middle; margin-right: 4px; }
