* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    background: #f5f5f7;
    color: #1a1a1a;
    line-height: 1.5;
}

header {
    background: #2a2a2a;
    color: #fff;
    padding: 18px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

header h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
}

header .back {
    color: #aaa;
    text-decoration: none;
    font-size: 14px;
    display: inline-block;
    margin-bottom: 6px;
}

header .back:hover { color: #fff; }

.user-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 13px;
    color: #ccc;
}

.user-bar .user-email {
    font-family: 'Consolas', 'Monaco', monospace;
}

.user-bar .logout {
    color: #ddd;
    text-decoration: none;
    background: rgba(255,255,255,0.08);
    padding: 6px 12px;
    border-radius: 6px;
    transition: background 0.15s;
}

.user-bar .logout:hover {
    background: rgba(255,255,255,0.18);
    color: #fff;
}

/* Login page */
.login-body {
    background: #f5f5f7;
    min-height: 100vh;
}

.login-main {
    max-width: 380px;
    margin: 0 auto;
    padding: 80px 20px 40px;
}

.login-card {
    background: #fff;
    border-radius: 10px;
    padding: 32px 28px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.login-card h1 {
    margin: 0 0 6px 0;
    font-size: 22px;
    font-weight: 600;
    color: #1a1a1a;
}

.login-card .subtitle {
    margin: 0 0 22px 0;
    font-size: 14px;
    color: #888;
}

.login-card .field {
    margin-bottom: 16px;
}

.login-card .field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 13px;
    color: #444;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.login-card .field input {
    width: 100%;
    padding: 11px 13px;
    font-size: 14px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    background: #fafafa;
    transition: border-color 0.15s, background 0.15s;
}

.login-card .field input:focus {
    outline: none;
    border-color: #2a7ad9;
    background: #fff;
}

.login-card button[type="submit"] {
    width: 100%;
    padding: 12px 20px;
    background: #2a7ad9;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 6px;
}

.login-card button[type="submit"]:hover { background: #1d5fa8; }

.login-card .error {
    background: #fdecea;
    border: 1px solid #f5c6c6;
    color: #b71c1c;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 16px;
}

.login-card .hint {
    margin: 18px 0 0 0;
    font-size: 12px;
    color: #888;
    line-height: 1.5;
}

main {
    max-width: 880px;
    margin: 0 auto;
    padding: 28px;
}

section {
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

section h2 {
    margin: 0 0 16px 0;
    font-size: 17px;
    font-weight: 600;
    color: #444;
}

.field {
    margin-bottom: 22px;
}

.field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.field input[type="date"],
.field textarea {
    width: 100%;
    padding: 11px 13px;
    font-size: 14px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    background: #fafafa;
    transition: border-color 0.15s, background 0.15s;
}

.field input[type="date"]:focus,
.field textarea:focus {
    outline: none;
    border-color: #2a7ad9;
    background: #fff;
}

.field textarea {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    resize: vertical;
    min-height: 200px;
}

.field .hint {
    margin: 6px 0 0 0;
    font-size: 12px;
    color: #888;
}

.row {
    display: flex;
    gap: 16px;
    margin-bottom: 22px;
}

fieldset.checkboxes {
    flex: 1;
    padding: 14px 16px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    background: #fafafa;
}

fieldset.checkboxes legend {
    padding: 0 8px;
    font-weight: 600;
    font-size: 13px;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

fieldset.checkboxes label {
    display: inline-block;
    margin-right: 18px;
    font-size: 14px;
    cursor: pointer;
}

fieldset.checkboxes input[type="checkbox"] {
    margin-right: 5px;
    cursor: pointer;
}

button[type="submit"] {
    padding: 13px 28px;
    background: #2a7ad9;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

button[type="submit"]:hover { background: #1d5fa8; }
button[type="submit"]:active { background: #164a87; }

.recent ul,
.file-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.recent li,
.file-list li {
    border-bottom: 1px solid #eee;
}

.recent li:last-child,
.file-list li:last-child {
    border-bottom: none;
}

.recent a,
.file-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 0;
    color: #2a7ad9;
    text-decoration: none;
    font-size: 14px;
}

.recent a:hover,
.file-list a:hover {
    color: #1d5fa8;
    text-decoration: underline;
}

.file-list .filename {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
}

.file-list .download-hint {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.empty {
    color: #999;
    font-style: italic;
    margin: 0;
}

.hint {
    font-size: 12px;
    color: #888;
    margin: 12px 0 0 0;
}

code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

/* Overwrite-confirmation page */
.warning-section {
    border-left: 4px solid #d97706;
    background: #fffbeb;
}

.warning-section .warning-line {
    font-size: 15px;
    margin: 0 0 10px 0;
}

.confirm-form {
    margin-top: 20px;
}

.confirm-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 8px;
}

button.danger {
    padding: 11px 22px;
    background: #dc2626;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

button.danger:hover { background: #b91c1c; }

.cancel-link {
    color: #555;
    text-decoration: none;
    font-size: 14px;
}

.cancel-link:hover {
    color: #1a1a1a;
    text-decoration: underline;
}

@media (max-width: 600px) {
    .row { flex-direction: column; gap: 12px; }
    main { padding: 16px; }
    section { padding: 18px; }
}
