:root {
    --bg: #0d1117;
    --surface: #161b22;
    --border: #21262d;
    --text: #e6edf3;
    --dim: #484f58;
    --accent: #2dd4bf;
    --accent-glow: rgba(45, 212, 191, 0.15);
    --accent-dim: rgba(45, 212, 191, 0.4);
    --green: #3fb950;
    --radius: 12px;
}

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

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow: hidden;
}

.app {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Top bar — barely visible */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    flex-shrink: 0;
}
.brand {
    font-size: 13px;
    color: var(--dim);
    display: flex;
    align-items: center;
    gap: 6px;
}
.brand span { font-weight: 500; }
.icon-btn {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    opacity: 0.25;
    transition: opacity 0.2s;
    padding: 8px;
}
.icon-btn:hover { opacity: 0.7; }

/* Center content — all views */
.center-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 20px;
}

/* Drop zone — initial */
.drop-zone {
    width: 320px;
    padding: 60px 40px;
    border: 2px dashed var(--border);
    border-radius: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s;
}
.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--accent);
    background: var(--accent-glow);
}
.drop-icon { font-size: 48px; margin-bottom: 16px; }
.drop-zone p {
    color: var(--dim);
    font-size: 14px;
    margin-bottom: 20px;
}

/* Buttons */
.btn-ghost {
    background: none;
    border: 1px solid var(--border);
    color: var(--dim);
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.btn-add {
    background: var(--accent-glow);
    border: 1.5px solid var(--accent);
    color: var(--accent);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    padding: 14px 32px;
    border-radius: 10px;
    transition: all 0.2s;
    margin-top: 6px;
    letter-spacing: 0.3px;
}
.btn-add:hover {
    background: rgba(45, 212, 191, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(45, 212, 191, 0.2);
}

/* ═══ Progress Ring ═══ */
.ring-container {
    position: relative;
    width: 240px;
    height: 240px;
}
.ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}
.ring-bg {
    fill: none;
    stroke: var(--border);
    stroke-width: 4;
}
.ring-progress {
    fill: none;
    stroke: var(--accent);
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.8s ease;
    filter: drop-shadow(0 0 12px var(--accent-dim));
}
.ring-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.ring-count {
    font-size: 56px;
    font-weight: 300;
    letter-spacing: -2px;
    color: var(--text);
}
.ring-label {
    font-size: 12px;
    color: var(--dim);
    margin-top: 4px;
}

/* Current file progress */
.current-progress {
    width: 240px;
}
.progress-track {
    height: 3px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.3s;
}
.progress-hint {
    font-size: 11px;
    color: var(--dim);
    text-align: center;
    margin-top: 6px;
    min-height: 16px;
}

/* Done */
.done-icon { font-size: 64px; }
.done-text {
    font-size: 15px;
    color: var(--dim);
}

/* ═══ Admin ═══ */
.admin-app {
    overflow-y: auto;
}
.admin-tag {
    background: var(--accent);
    color: var(--bg);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 4px;
}
.admin-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 0 24px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}
.stat-label { font-size: 11px; color: var(--dim); }
.stat-value { font-size: 22px; font-weight: 600; margin-top: 4px; }
.admin-section {
    padding: 0 24px;
    margin-bottom: 24px;
}
.admin-section h3 {
    font-size: 13px;
    color: var(--dim);
    margin-bottom: 10px;
    font-weight: 500;
}
.log-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    max-height: 300px;
    overflow-y: auto;
    font-family: 'Menlo', monospace;
    font-size: 11px;
    color: var(--dim);
    line-height: 1.7;
    white-space: pre-wrap;
}
.queue-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.queue-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
}
.queue-item .status { font-size: 11px; }
.status-done { color: var(--green); }
.status-processing { color: var(--accent); }
.status-pending { color: var(--dim); }

/* ═══ Login ═══ */
.login-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    width: 320px;
}
.login-logo { font-size: 40px; }
.login-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}
.login-sub {
    font-size: 13px;
    color: var(--dim);
    margin-bottom: 4px;
}
.login-input {
    width: 100%;
    text-align: center;
    letter-spacing: 2px;
    font-size: 14px;
}
.login-btn {
    width: 100%;
    padding: 12px;
    font-size: 14px;
}
.login-error {
    font-size: 12px;
    color: #f85149;
    min-height: 16px;
}

/* Invite form */
.invite-form {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.input-field {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    flex: 1;
}
.input-field:focus {
    outline: none;
    border-color: var(--accent);
}
.btn-accent {
    background: var(--accent);
    color: var(--bg);
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.2s;
    white-space: nowrap;
}
.btn-accent:hover { opacity: 0.85; }
.user-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.user-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.user-item .user-info { display: flex; gap: 12px; align-items: center; }
.user-item .role-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--border);
    color: var(--dim);
}
.user-item .role-badge.admin { background: var(--accent); color: var(--bg); }
.btn-danger {
    background: none;
    border: 1px solid #f85149;
    color: #f85149;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    font-family: inherit;
}
.btn-danger:hover { background: rgba(248, 81, 73, 0.15); }
.invite-result {
    background: var(--surface);
    border: 1px solid var(--accent);
    border-radius: 8px;
    padding: 12px;
    margin-top: 10px;
    font-size: 12px;
}
.invite-result code {
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    word-break: break-all;
}

@media (max-width: 640px) {
    .admin-grid { grid-template-columns: 1fr 1fr; }
    .ring-container { width: 180px; height: 180px; }
    .ring-count { font-size: 42px; }
    .invite-form { flex-direction: column; }
}
