/* ==== СВЕТЛАЯ ТЕМА (по умолчанию) ==== */
:root {
    --bg: #f4f6fa;
    --bg-card: #ffffff;
    --bg-hover: #eef1f7;
    --border: #dfe3eb;
    --text: #1b1f27;
    --text-dim: #6b7280;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --danger: #dc2626;
    --radius: 12px;
    --shadow: 0 8px 24px rgba(20, 30, 60, 0.08);
}

/* ==== БАЗА ==== */
* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ==== КНОПКИ ==== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--bg-hover); border-color: var(--border); }

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 600;
}
.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-dim);
}
.btn-ghost:hover { color: var(--text); background: var(--bg-hover); }

.btn-icon {
    padding: 6px 8px;
    font-size: 14px;
    background: transparent;
    border-color: transparent;
}
.btn-icon:hover { background: var(--bg-hover); }

/* ============================================
   СТРАНИЦА ВХОДА
   ============================================ */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: var(--bg-card);
    padding: 40px 36px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 380px;
}

.login-card h1 {
    margin: 0 0 6px;
    font-size: 26px;
    font-weight: 700;
}

.login-card .subtitle {
    margin: 0 0 26px;
    color: var(--text-dim);
    font-size: 14px;
}

.login-card form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-card label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: var(--text-dim);
}

.login-card input {
    padding: 11px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.15s;
}
.login-card input:focus {
    outline: none;
    border-color: var(--accent);
}

.login-card button[type="submit"] {
    margin-top: 6px;
    padding: 12px;
    background: var(--accent);
    color: #04121b;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}
.login-card button[type="submit"]:hover { background: var(--accent-hover); }

.error {
    background: rgba(239,83,80,0.1);
    border: 1px solid rgba(239,83,80,0.4);
    color: var(--danger);
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
}
.hidden { display: none; }

/* ============================================
   СТРАНИЦА ФАЙЛОВ
   ============================================ */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    position: sticky;
    top: 0;
    z-index: 10;
}

.logo { font-weight: 700; font-size: 16px; }

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}
.user { color: var(--text-dim); font-size: 14px; }

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 24px;
}

.toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.breadcrumbs {
    color: var(--text-dim);
    font-size: 14px;
    margin-bottom: 16px;
}

/* ==== ТАБЛИЦА ФАЙЛОВ ==== */
.files-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.files-table th,
.files-table td {
    padding: 12px 16px;
    text-align: left;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}

.files-table th {
    background: var(--bg-hover);
    color: var(--text-dim);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.files-table tbody tr:last-child td { border-bottom: none; }
.files-table tbody tr:hover { background: var(--bg-hover); }

/* ==== КОЛОНКИ ==== */
.col-size { width: 100px; }
.col-date { width: 160px; }
.col-actions { width: 140px; }    /* было 110px — увеличили */

/* ==== ЯЧЕЙКА С КНОПКАМИ ==== */
td.actions {
    text-align: right;
    white-space: nowrap;
    padding: 8px 12px;             /* уменьшили паддинг, чтобы больше влезло */
}

td.actions > * {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin: 0 1px;                 /* минимальные отступы между кнопками */
}

td.actions .btn-icon {
    padding: 4px 5px;
    line-height: 1;
}

td.actions form { margin: 0; }

.folder td:first-child { font-weight: 600; color: var(--accent); }

/* ==== МОБИЛЬНАЯ АДАПТАЦИЯ ==== */
@media (max-width: 640px) {
    .container { padding: 14px; }
    .col-size, .col-date { display: none; }
    .files-table th:nth-child(2),
    .files-table td:nth-child(2),
    .files-table th:nth-child(3),
    .files-table td:nth-child(3) { display: none; }
    .topbar { padding: 12px 14px; }
    .user { display: none; }
}