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

body {
    font-family: "Ubuntu", "Roboto", "Helvetica", "Arial", sans-serif;
    font-size: 14px;
    background: #f5f5f5;
    color: #333;
    line-height: 1.4;
    min-height: 100vh;
}

a {
    color: #1565c0;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Top bar */
#topbar {
    background: #fff;
    border-bottom: 1px solid #ddd;
    padding: 0 12px;
    height: 42px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

#crumbbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
    font-size: 14px;
}

#crumbbar a {
    color: #1565c0;
    padding: 4px 6px;
    border-radius: 3px;
}

#crumbbar a:hover {
    background: #e3f2fd;
    text-decoration: none;
}

#crumbbar a.active {
    color: #333;
    font-weight: 600;
}

#crumbbar .sep {
    color: #999;
    margin: 0 2px;
}

#top-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
    align-items: center;
}

#top-actions a {
    font-size: 13px;
    padding: 5px 12px;
    border-radius: 4px;
    border: 1px solid #ccc;
    background: #fafafa;
    color: #333;
    text-decoration: none;
}

#top-actions a:hover {
    background: #eee;
    border-color: #bbb;
}

/* Main content */
#content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px 12px 40px;
}

#content-header {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 16px 20px;
    margin-bottom: 16px;
}

#content-header h1 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #222;
}

#content-header p {
    color: #666;
    font-size: 13px;
}

/* Table / list view */
#view {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

#items {
    list-style: none;
    width: 100%;
}

#items .header {
    display: flex;
    align-items: center;
    background: #fafafa;
    border-bottom: 1px solid #ddd;
    font-weight: 600;
    font-size: 12px;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    user-select: none;
}

#items .header a {
    color: #555;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 8px;
}

#items .header a:hover {
    color: #1565c0;
}

#items .item {
    border-bottom: 1px solid #eee;
}

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

#items .item a {
    display: flex;
    align-items: center;
    padding: 0;
    color: inherit;
    text-decoration: none;
    min-height: 40px;
}

#items .item a:hover {
    background: #f0f7ff;
}

#items .icon {
    width: 44px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 0;
}

#items .icon img,
#items .icon .emoji {
    width: 20px;
    height: 20px;
    font-size: 18px;
    line-height: 1;
}

#items .label {
    flex: 1;
    min-width: 0;
    padding: 8px 8px 8px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
}

#items .item.folder .label {
    font-weight: 500;
}

#items .date {
    width: 150px;
    flex-shrink: 0;
    padding: 8px;
    font-size: 13px;
    color: #666;
    text-align: right;
}

#items .size {
    width: 100px;
    flex-shrink: 0;
    padding: 8px 12px 8px 8px;
    font-size: 13px;
    color: #666;
    text-align: right;
}

#items .header .icon { width: 44px; }
#items .header .label { flex: 1; padding-left: 0; }
#items .header .date { width: 150px; justify-content: flex-end; }
#items .header .size { width: 100px; justify-content: flex-end; }

/* Empty */
#view-hint {
    padding: 40px 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

/* Footer */
#content-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 12px;
    color: #999;
}

#content-footer small {
    display: block;
    margin-top: 2px;
}

/* Upload page */
.upload-wrap {
    max-width: 420px;
    margin: 40px auto;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 24px;
}

.upload-wrap h2 {
    font-size: 18px;
    margin-bottom: 16px;
    color: #222;
}

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

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 4px;
}

.form-group input[type="password"],
.form-group input[type="file"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: #1565c0;
}

.btn {
    display: inline-block;
    padding: 8px 18px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fafafa;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    color: #333;
    text-decoration: none;
}

.btn:hover {
    background: #eee;
}

.btn-primary {
    background: #1565c0;
    border-color: #1565c0;
    color: #fff;
    width: 100%;
    text-align: center;
}

.btn-primary:hover {
    background: #0d47a1;
    border-color: #0d47a1;
    color: #fff;
    text-decoration: none;
}

.msg {
    padding: 10px 12px;
    border-radius: 4px;
    margin-bottom: 14px;
    font-size: 13px;
}

.msg.success {
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    color: #2e7d32;
}

.msg.error {
    background: #ffebee;
    border: 1px solid #ef9a9a;
    color: #c62828;
}

.links {
    margin-top: 16px;
    text-align: center;
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Mobile */
@media (max-width: 600px) {
    #items .date {
        display: none;
    }
    #items .header .date {
        display: none;
    }
    #items .size {
        width: 80px;
    }
    #topbar {
        flex-wrap: wrap;
        height: auto;
        padding: 8px 12px;
        gap: 6px;
    }
    #top-actions {
        margin-left: 0;
        width: 100%;
    }
}
