* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
    min-height: 100vh;
}

.topnav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 50px;
    background: #2c3e50;
    color: #fff;
    font-size: 14px;
}

.topnav a {
    color: #ecf0f1;
    text-decoration: none;
    margin-right: 16px;
}

.topnav a:hover {
    color: #fff;
}

.topnav .logo {
    font-weight: 700;
    font-size: 16px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-info {
    color: #bdc3c7;
    font-size: 13px;
}

main {
    max-width: 960px;
    margin: 0 auto;
    padding: 20px;
}

.btn-link {
    background: none;
    border: none;
    color: #ecf0f1;
    cursor: pointer;
    font-size: 14px;
    text-decoration: underline;
}

/* Login */
.login-container {
    max-width: 360px;
    margin: 80px auto;
    padding: 32px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.login-container h1 {
    text-align: center;
    margin-bottom: 24px;
    color: #2c3e50;
}

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

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
    color: #666;
}

.form-group input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
}

.error {
    color: #e74c3c;
    background: #fdf0ef;
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 12px;
    font-size: 13px;
}

/* Toolbar */
.toolbar {
    margin-bottom: 16px;
}

.breadcrumbs {
    font-size: 15px;
}

.breadcrumbs a {
    color: #3498db;
    text-decoration: none;
}

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

/* Upload bar */
.upload-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.btn {
    display: inline-block;
    padding: 8px 16px;
    background: #3498db;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
}

.btn:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #7f8c8d;
    color: #fff;
    cursor: pointer;
    font-size: 13px;
}

.btn-secondary:hover {
    background: #6c7a7d;
}

.btn-small {
    display: inline-block;
    padding: 4px 10px;
    background: #95a5a6;
    color: #fff;
    border: none;
    border-radius: 3px;
    font-size: 12px;
    cursor: pointer;
    text-decoration: none;
}

.btn-small:hover {
    background: #7f8c8d;
}

.btn-danger {
    background: #e74c3c;
}

.btn-danger:hover {
    background: #c0392b;
}

.input-inline {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    width: 150px;
}

/* Flash */
.flash {
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 12px;
    font-size: 13px;
    background: #e8f5e9;
    color: #2e7d32;
}

.flash-error {
    background: #fdf0ef;
    color: #c0392b;
}

.flash-ok {
    background: #e8f5e9;
    color: #2e7d32;
}

/* File table */
.file-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.file-table th {
    text-align: left;
    padding: 10px 16px;
    background: #ecf0f1;
    font-size: 13px;
    color: #555;
    border-bottom: 1px solid #ddd;
}

.file-table td {
    padding: 8px 16px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.file-table tr:last-child td {
    border-bottom: none;
}

.file-table tr:hover {
    background: #f8f9fa;
}

.icon {
    margin-right: 6px;
}

.entry-link {
    color: #2c3e50;
    text-decoration: none;
}

.entry-link:hover {
    color: #3498db;
    text-decoration: underline;
}

.size, .date {
    color: #888;
    font-size: 13px;
}

.actions {
    white-space: nowrap;
    text-align: right;
}

.empty {
    text-align: center;
    color: #999;
    padding: 32px;
}

.inline {
    display: inline;
}

/* Upload progress */
.upload-status {
    margin-top: 12px;
    padding: 12px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.progress-bar {
    height: 6px;
    background: #ecf0f1;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: #3498db;
    width: 0%;
    transition: width 0.3s;
}

#status-text {
    font-size: 13px;
    color: #666;
}

.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    border-bottom: 1px solid #f0f0f0;
}

.upload-item:last-child {
    border-bottom: none;
}

.upload-name {
    flex: 1;
    font-size: 13px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 300px;
}

.upload-pct {
    font-size: 12px;
    color: #888;
    min-width: 40px;
    text-align: right;
}

.progress-small {
    width: 120px;
    height: 8px;
    accent-color: #3498db;
}

.progress-small::-webkit-progress-value {
    background: #3498db;
}

.progress-small::-webkit-progress-bar {
    background: #ecf0f1;
}

#upload-queue {
    margin-bottom: 10px;
    max-height: 200px;
    overflow-y: auto;
}

/* Admin */
.admin-form {
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.checkbox-label {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
    color: #555;
}

.inline-form {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.inline-form input {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 12px;
    width: 130px;
}

.change-pw {
    display: inline-block;
}

.change-pw summary {
    list-style: none;
    display: inline-block;
}

h2 {
    margin-bottom: 16px;
    color: #2c3e50;
}

h3 {
    margin: 16px 0 10px;
    font-size: 15px;
    color: #555;
}
