:root {
    --accent: #2563eb;
    --accent-dark: #1d4ed8;
    --danger: #dc2626;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #e5e7eb;
    --bg: #f3f4f6;
    --card-bg: #ffffff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
}

.brand {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
    text-decoration: none;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.site-nav a {
    color: var(--accent);
    text-decoration: none;
}

.site-main {
    max-width: 860px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.5rem;
}

.card.narrow {
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.card.center {
    text-align: center;
}

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

h2 {
    font-size: 1.1rem;
    margin: 1.25rem 0 0.5rem;
}

.muted {
    color: var(--muted);
}

.error {
    color: var(--danger);
    margin-top: 0.75rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.45rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text);
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
}

.btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.btn.primary:hover {
    background: var(--accent-dark);
}

.btn.danger {
    border-color: var(--danger);
    color: var(--danger);
}

.btn.danger:hover {
    background: var(--danger);
    color: #fff;
}

.link-button {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: inherit;
    padding: 0;
}

.inline-form {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Code entry */
.code-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.code-input {
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 2rem;
    letter-spacing: 0.5em;
    text-align: center;
    width: 9.5em;
    padding: 0.4rem 0 0.4rem 0.5em;
    border: 2px solid var(--border);
    border-radius: 10px;
}

.code-input:focus {
    outline: none;
    border-color: var(--accent);
}

.code-badge {
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-weight: 600;
    letter-spacing: 0.15em;
}

.code-display {
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 0.35em;
}

.share-box {
    display: flex;
    gap: 3rem;
    flex-wrap: wrap;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--bg);
    border-radius: 10px;
    margin: 0.75rem 0;
}

/* Forms */
.field {
    margin-bottom: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.field label {
    font-size: 0.9rem;
    font-weight: 600;
}

.field input,
.field select {
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
}

.field-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.field-row .field {
    flex: 1 1 180px;
}

.days-input {
    width: 4.5rem;
    padding: 0.35rem 0.4rem;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.days-input.wide {
    width: 7rem;
}

.actions-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    flex-wrap: wrap;
}

.tabs {
    display: flex;
    gap: 0.25rem;
}

.tabs a {
    padding: 0.3rem 0.8rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--muted);
}

.tabs a.active {
    background: var(--bg);
    color: var(--text);
    font-weight: 600;
}

.divider-text {
    margin: 1.25rem 0 0.75rem;
}

/* File tables */
.file-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
}

.file-table th {
    text-align: left;
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: 600;
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid var(--border);
}

.file-table td {
    padding: 0.55rem 0.6rem;
    border-bottom: 1px solid var(--border);
    word-break: break-word;
}

.file-table tr {
    transition: background-color 0.8s;
}

tr.flash {
    background-color: #d1fae5;
}

.hidden {
    display: none;
}

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

/* Upload area */
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 2rem 1rem;
    text-align: center;
    margin: 1rem 0;
    transition: border-color 0.15s, background-color 0.15s;
}

.drop-zone.drag-over {
    border-color: var(--accent);
    background: #eff6ff;
}

.drop-zone p {
    margin: 0 0 0.75rem;
    color: var(--muted);
}

.file-label {
    margin: 0;
}

.upload-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.upload-list li {
    padding: 0.6rem 0.2rem;
    border-bottom: 1px solid var(--border);
}

.upload-item-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.95rem;
}

.upload-item-status {
    color: var(--muted);
    white-space: nowrap;
}

.upload-item-status.done {
    color: #16a34a;
}

.upload-item-status.failed {
    color: var(--danger);
}

.progress-track {
    height: 6px;
    background: var(--bg);
    border-radius: 3px;
    margin-top: 0.4rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.2s;
}
