:root {
    --bg: #f4f5f7;
    --panel: #ffffff;
    --border: #e2e4ea;
    --text: #1c1e26;
    --muted: #6b7280;
    --accent: #3b6fed;
    --success: #1f9d55;
    --error: #d92d2d;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
    background: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0 1rem 3rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    max-width: 700px;
    margin: 0 auto;
}

header h1 { font-size: 1.4rem; margin: 0; }

.logout {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem;
}
.logout:hover { color: var(--text); }

.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
}
.nav-links a { color: var(--accent); text-decoration: none; }
.nav-links a:hover { text-decoration: underline; }

.user-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.user-table th, .user-table td {
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border);
}
.user-table th { color: var(--muted); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; }
.user-table tr:last-child td { border-bottom: none; }

.admin-actions { display: flex; gap: 0.5rem; }
.small-btn {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
}
.small-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

main {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

h2 { font-size: 1.1rem; margin-bottom: 0.75rem; }

.upload-box, .video-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

label {
    display: block;
    margin-bottom: 0.9rem;
    font-size: 0.9rem;
    color: var(--muted);
}

input[type="file"], input[type="number"], input[type="password"] {
    display: block;
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
}

button {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.6rem 1.1rem;
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
}
button:hover { opacity: 0.9; }

.delete-btn {
    background: transparent;
    border: 1px solid var(--error);
    color: var(--error);
    margin-top: 0.75rem;
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
}

.hint { color: var(--muted); font-size: 0.8rem; margin-top: 0.5rem; }

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.checkbox-label input { width: auto; margin: 0; }

.upload-progress-wrap {
    margin-top: 1rem;
}
.upload-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}
.upload-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    transition: width 0.2s ease;
}

.banner {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
}
.banner.success { background: rgba(31,157,85,0.1); border: 1px solid var(--success); }
.banner.error { background: rgba(217,45,45,0.08); border: 1px solid var(--error); }
.banner.small { font-size: 0.8rem; margin-top: 0.75rem; }

.video-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status {
    font-size: 0.7rem;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: var(--border);
    color: var(--muted);
}
.status-done { color: var(--success); }
.status-error { color: var(--error); }
.status-processing { color: var(--accent); }

.video-meta { color: var(--muted); font-size: 0.8rem; margin: 0.4rem 0 0.6rem; }

.segment-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.segment-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    gap: 0.5rem;
}
.segment-list a {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.8rem;
    white-space: nowrap;
}
.segment-list a:hover { text-decoration: underline; }

.login-box {
    max-width: 320px;
    margin: 15vh auto;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.login-box h1 { margin-bottom: 1.5rem; }
.error { color: var(--error); font-size: 0.85rem; }
