:root {
    --admin-ink: #1a1a1a;
    --admin-paper: #f5f2eb;
    --admin-grid: #c8c8c8;
}

.admin-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
}

.admin-page-title {
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--admin-ink);
}

.admin-page-subtitle {
    margin-top: 0.35rem;
    font-size: 0.925rem;
    color: #78716c;
}

.admin-card {
    border-radius: 1rem;
    border: 1px solid #e7e5e4;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.admin-card-body {
    padding: 1.5rem;
}

@media (min-width: 768px) {
    .admin-card-body {
        padding: 2rem;
    }
}

.admin-field + .admin-field {
    margin-top: 1.25rem;
}

.admin-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #44403c;
}

.admin-input,
.admin-textarea,
.admin-select {
    display: block;
    width: 100%;
    border-radius: 0.75rem;
    border: 1px solid #d6d3d1;
    background: #fff;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    color: var(--admin-ink);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.admin-input:focus,
.admin-textarea:focus,
.admin-select:focus {
    outline: none;
    border-color: var(--admin-ink);
    box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.08);
}

.admin-textarea {
    min-height: 8rem;
    resize: vertical;
}

.admin-hint {
    margin-top: 0.375rem;
    font-size: 0.75rem;
    color: #78716c;
}

.admin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 0.75rem;
    padding: 0.7rem 1.1rem;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.15s ease;
}

.admin-btn-primary {
    background: var(--admin-ink);
    color: #fff;
}

.admin-btn-primary:hover {
    background: #000;
}

.admin-btn-secondary {
    border: 1px solid #d6d3d1;
    background: #fff;
    color: #44403c;
}

.admin-btn-secondary:hover {
    background: #fafaf9;
}

.admin-btn-danger {
    color: #dc2626;
}

.admin-btn-danger:hover {
    color: #b91c1c;
}

.admin-alert {
    border-radius: 0.875rem;
    padding: 1rem 1.125rem;
    font-size: 0.875rem;
}

.admin-alert-success {
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.admin-alert-error {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.admin-table-wrap {
    overflow: hidden;
    border-radius: 1rem;
    border: 1px solid #e7e5e4;
    background: #fff;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    background: #fafaf9;
    padding: 0.875rem 1rem;
    text-align: left;
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #78716c;
}

.admin-table td {
    padding: 1rem;
    border-top: 1px solid #f5f5f4;
    font-size: 0.875rem;
    vertical-align: middle;
}

.admin-table tr:hover td {
    background: #fafaf9;
}

.category-picker-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin-bottom: 0.5rem;
    border-radius: 0.875rem;
    border: 1px solid transparent;
    background: #fff;
    padding: 0.875rem 1rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.category-picker-item:hover {
    border-color: #d6d3d1;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.category-picker-item.is-selected {
    border-color: var(--admin-ink);
    background: #fafaf9;
    box-shadow: inset 0 0 0 1px rgba(26, 26, 26, 0.06);
}

.category-picker-check {
    position: relative;
    flex-shrink: 0;
    width: 1.125rem;
    height: 1.125rem;
    border-radius: 0.375rem;
    border: 1.5px solid #a8a29e;
    background: #fff;
    transition: all 0.15s ease;
}

.category-picker-item.is-selected .category-picker-check {
    border-color: var(--admin-ink);
    background: var(--admin-ink);
}

.category-picker-item.is-selected .category-picker-check::after {
    content: "";
    position: absolute;
    left: 0.3rem;
    top: 0.12rem;
    width: 0.3rem;
    height: 0.55rem;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.category-picker-children {
    margin-left: 1.25rem;
    padding-left: 1rem;
    border-left: 2px solid #e7e5e4;
}

.category-tree-row td:first-child {
    padding-left: calc(1rem + var(--tree-depth, 0) * 1.5rem);
}

.file-upload {
    border-radius: 0.875rem;
    border: 1.5px dashed #d6d3d1;
    background: #fafaf9;
    padding: 1.25rem;
}

.file-upload:focus-within {
    border-color: var(--admin-ink);
    background: #fff;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
