* {
    box-sizing: border-box;
}

:root {
    --bg: #f3f5f7;
    --surface: #ffffff;
    --surface-soft: #f8f9fa;

    --text: #1f2933;
    --text-muted: #6b7280;

    --border: #dfe3e8;

    --primary: #243746;
    --primary-hover: #162733;

    --danger: #a33a3a;
    --danger-bg: #fff1f1;

    --radius: 12px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

a {
    color: var(--primary);
}

a:hover {
    color: var(--primary-hover);
}

/* ---------- LOGIN ---------- */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 430px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    box-shadow: var(--shadow);

    padding: 42px 38px;
}

.login-brand {
    text-align: center;
    margin-bottom: 34px;
}

.login-brand h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.login-brand p {
    margin: 7px 0 0;
    color: var(--text-muted);
    font-size: 14px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    font-size: 14px;
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 13px 14px;

    border: 1px solid #cbd1d8;
    border-radius: 8px;

    background: #fff;
    color: var(--text);

    font-size: 16px;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.form-control:focus {
    outline: none;

    border-color: #61788a;

    box-shadow:
        0 0 0 3px rgba(36, 55, 70, 0.10);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 44px;
    padding: 10px 18px;

    border: none;
    border-radius: 8px;

    font-size: 15px;
    font-weight: 600;

    cursor: pointer;

    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: #fff;
}

.btn-full {
    width: 100%;
}

.alert {
    padding: 11px 14px;
    margin-bottom: 20px;

    border-radius: 8px;

    font-size: 14px;
}

.alert-danger {
    background: var(--danger-bg);
    border: 1px solid #edcaca;
    color: var(--danger);
}

/* ---------- ARCHIVIO ---------- */

.page-container {
    width: min(1100px, calc(100% - 40px));
    margin: 0 auto;
}

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    min-height: 72px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;
}

.site-title {
    margin: 0;

    font-size: 20px;
    font-weight: 600;
}

.site-subtitle {
    margin: 3px 0 0;

    color: var(--text-muted);
    font-size: 13px;
}

.archive-main {
    padding: 34px 0 50px;
}

.archive-card {
    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);

    overflow: hidden;
}

.archive-toolbar {
    padding: 18px 22px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    border-bottom: 1px solid var(--border);
}

.archive-path {
    font-size: 14px;
    color: var(--text-muted);
}

.archive-section {
    padding: 22px;
}

.archive-section + .archive-section {
    border-top: 1px solid var(--border);
}

.archive-section h2 {
    margin: 0 0 15px;

    font-size: 16px;
    font-weight: 600;
}

.archive-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.archive-item {
    display: flex;
    align-items: center;
    gap: 12px;

    min-height: 48px;

    padding: 8px 10px;

    border-radius: 7px;
}

.archive-item:hover {
    background: var(--surface-soft);
}

.archive-icon {
    width: 24px;

    text-align: center;
    font-size: 20px;
}

.archive-item a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
}

.archive-item a:hover {
    text-decoration: underline;
}

.archive-empty {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
}

.btn-logout {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-logout:hover {
    background: var(--surface-soft);
    color: var(--text);
}

@media (max-width: 600px) {

    .login-card {
        padding: 32px 24px;
    }

    .page-container {
        width: min(100% - 24px, 1100px);
    }

    .header-inner {
        min-height: 64px;
    }

    .archive-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }
}