* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f6f7fb;
    color: #171717;
}

a {
    color: #ff5a00;
    text-decoration: none;
}

code {
    background: #f1f1f1;
    padding: 2px 6px;
    border-radius: 6px;
}

.topbar {
    min-height: 64px;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #111;
    color: #fff;
}

.topbar a {
    color: #fff;
    margin-left: 18px;
}

.brand {
    margin-left: 0 !important;
    font-weight: 800;
    font-size: 18px;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px;
}

.page-head {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 20px;
}

h1 {
    margin: 0 0 8px;
    font-size: 30px;
}

h2 {
    margin-top: 28px;
}

.muted {
    color: #666;
    font-size: 14px;
}

.stat-card,
.upload-box,
.auth-box,
.empty,
.table-wrap,
.log-box {
    background: #fff;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.05);
}

.stat-card {
    margin: 18px 0;
}

.upload-box.single {
    max-width: 760px;
}

.head-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    border: 0;
    border-radius: 10px;
    padding: 9px 14px;
    cursor: pointer;
    background: #eee;
    color: #111;
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
}

.button.small,
button.small {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 13px;
}

.primary {
    background: #ff5a00;
    color: #fff;
}

.danger {
    background: #fee2e2;
    color: #b91c1c;
}

.auth-box {
    max-width: 420px;
    margin: 80px auto;
}

form label {
    display: block;
    margin: 16px 0 8px;
    font-weight: 700;
}

input,
textarea {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 10px;
    font-size: 14px;
    background: #fff;
}

.auth-box button,
.upload-box button.primary {
    width: 100%;
    margin-top: 18px;
}

.flash {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 8px;
    font-weight: 700;
}

.flash.success {
    background: #dcfce7;
    color: #166534;
}

.flash.error {
    background: #fee2e2;
    color: #991b1b;
}

.flash.warning {
    background: #fef3c7;
    color: #92400e;
}

.progress-wrap {
    margin-top: 14px;
}

.progress-bar {
    height: 14px;
    background: #eee;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 8px;
}

#progressFill {
    height: 100%;
    width: 0%;
    background: #ff5a00;
    transition: width .2s ease;
}

.log-box {
    margin-top: 14px;
    font-size: 14px;
}

.log-box:empty {
    display: none;
}

.log-box pre {
    white-space: pre-wrap;
    background: #f7f7f7;
    padding: 12px;
    border-radius: 10px;
    max-height: 260px;
    overflow: auto;
}

.table-wrap {
    overflow-x: auto;
    padding: 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

th,
td {
    padding: 12px 14px;
    border-bottom: 1px solid #eee;
    text-align: left;
    vertical-align: middle;
}

th {
    background: #fafafa;
    font-size: 13px;
    color: #555;
}

td {
    font-size: 14px;
}

.actions-cell {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.actions-cell form {
    margin: 0;
}

.link-input {
    min-width: 520px;
    font-family: Consolas, Monaco, monospace;
    font-size: 13px;
}

.pager {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin: 12px 0;
    color: #666;
    font-size: 14px;
}

.toast {
    position: fixed;
    right: 22px;
    bottom: 22px;
    background: #111;
    color: #fff;
    padding: 12px 16px;
    border-radius: 999px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

@media (max-width: 800px) {
    .topbar {
        height: auto;
        padding: 18px;
        align-items: flex-start;
        gap: 12px;
        flex-direction: column;
    }

    .topbar a {
        margin: 0 12px 8px 0;
        display: inline-block;
    }

    .page-head {
        flex-direction: column;
    }

    .link-input {
        min-width: 360px;
    }
}

.user-label{color:#bbb;font-size:13px;margin-right:8px}
.form-card{background:#fff;border-radius:16px;padding:18px;box-shadow:0 8px 30px rgba(0,0,0,.05);margin-bottom:24px}
.form-grid{display:grid;grid-template-columns:repeat(4,minmax(150px,1fr));gap:14px;align-items:end}
.form-grid label{margin-top:0}
select{width:100%;border:1px solid #ddd;border-radius:12px;padding:10px;background:#fff;font-size:14px}
.inline-check{display:flex;align-items:center;gap:7px;margin:0;white-space:nowrap}
.inline-check input{width:auto}
.filter-bar{display:flex;gap:10px;align-items:center;background:#fff;padding:14px;border-radius:14px;margin-bottom:14px;box-shadow:0 8px 30px rgba(0,0,0,.04)}
.filter-bar select{width:auto;min-width:210px}
@media(max-width:900px){.form-grid{grid-template-columns:1fr 1fr}.filter-bar{align-items:stretch;flex-direction:column}.filter-bar select{width:100%}}
