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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #808080;
    color: #222;
    line-height: 1.55;
}

a { color: #000; }
a:hover { text-decoration: underline; }

.skip-to-content {
    position: absolute;
    left: 0;
    top: -40px;
    background: #000;
    color: #fff;
    padding: 0.5rem 1rem;
    z-index: 100;
}
.skip-to-content:focus { top: 0; }

.site {
    max-width: 800px;
    min-height: 100vh;
    margin: 0 auto;
    background: #fff;
    border-left: 3px solid #000;
    border-right: 3px solid #000;
}

.site-header, .site-footer {
    padding: 1rem 2rem;
    border-bottom: 1px solid #ddd;
}
.site-footer {
    border-top: 1px solid #ddd;
    border-bottom: 0;
    color: #555;
    font-size: 0.875rem;
    text-align: center;
}
.site-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #000;
    text-decoration: none;
}
.site-nav {
    display: flex;
    gap: 1rem;
    margin: 1rem -2rem 0;
    padding: 1rem 2rem 0;
    border-top: 1px solid #ddd;
}
.site-nav a, .app-sidebar a, .app-logout { color: #000; text-decoration: none; }
.site-nav .active, .app-sidebar .active { font-weight: 700; text-decoration: underline; }
.site-main { padding: 2rem; }

.hero { padding: 3rem 0; }
.hero h1 { font-size: 2.25rem; margin-bottom: 0.75rem; }
.subtitle { color: #555; font-size: 1.15rem; max-width: 36rem; margin-bottom: 1.5rem; }
.section, .detail-section { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid #ddd; }
.section h2, .detail-section h2 { font-size: 1.2rem; margin-bottom: 0.75rem; }

.btn, .cta-button {
    display: inline-block;
    background: #000;
    color: #fff;
    border: 0;
    padding: 0.55rem 1rem;
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}
.btn:hover, .cta-button:hover { background: #333; text-decoration: none; }
.btn-small { padding: 0.3rem 0.65rem; font-size: 0.9rem; }
.btn-danger { background: #b00020; }
.btn-danger:hover { background: #800018; }

.stacked-form { display: grid; gap: 1rem; max-width: 36rem; }
.wide-form { max-width: 54rem; }
.stacked-form label, .inline-form label { display: grid; gap: 0.25rem; font-weight: 600; }
input, textarea, select {
    width: 100%;
    padding: 0.55rem;
    border: 1px solid #bbb;
    background: #fff;
    color: #222;
    font: inherit;
}
textarea { resize: vertical; }
.form-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.form-note { margin-top: 1rem; }
.inline-form, .row-form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.inline-form input, .inline-form select { width: auto; min-width: 14rem; }
.row-form {
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
}
.row-form input { width: auto; min-width: 12rem; flex: 1; }

.error-message, .rejection-message, .token-box {
    margin: 1rem 0;
    padding: 0.75rem;
    border: 1px solid #b00020;
    background: #fff5f5;
}
.rejection-message { border-color: #9a6a00; background: #fff8e1; }
.token-box { border-color: #000; background: #f5f5f5; }
.token-box code { display: block; margin: 0.5rem 0; overflow-wrap: anywhere; }

.app-shell {
    min-height: 100vh;
    background: #fff;
    display: flex;
    flex-direction: column;
}
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    border-bottom: 3px solid #000;
}
.app-body { display: flex; min-height: 0; flex: 1; }
.app-sidebar {
    width: 210px;
    flex: 0 0 210px;
    padding: 1rem 0;
    border-right: 3px solid #000;
    background: #f5f5f5;
}
.app-sidebar a {
    display: block;
    padding: 0.55rem 1.5rem;
}
.app-sidebar a:hover { background: #eee; text-decoration: none; }
.app-sidebar a.active { background: #000; color: #fff; text-decoration: none; }
.app-main {
    flex: 1;
    min-width: 0;
    padding: 2rem;
    overflow-x: auto;
}

.dashboard-header, .detail-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}
.action-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.task-list table {
    width: 100%;
    border-collapse: collapse;
}
th, td {
    padding: 0.65rem;
    border-bottom: 1px solid #ddd;
    text-align: left;
    vertical-align: top;
}
th { background: #f5f5f5; }
.muted { color: #666; font-size: 0.9rem; }
.status, .pill {
    display: inline-block;
    border: 1px solid #ddd;
    background: #f5f5f5;
    padding: 0.1rem 0.4rem;
    margin: 0 0.25rem 0.25rem 0;
    font-size: 0.85rem;
}
.empty-state {
    color: #666;
    padding: 1rem 0;
}
.pagination {
    display: flex;
    justify-content: space-between;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #ddd;
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}
.meta-grid div { border: 1px solid #ddd; padding: 0.75rem; }
.meta-grid dt { font-weight: 700; }
.body-text { white-space: pre-wrap; }
.comment {
    border: 1px solid #ddd;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}
.comment footer { color: #666; font-size: 0.875rem; margin-top: 0.5rem; }
.changelog { padding-left: 1.5rem; }
.changelog li { margin-bottom: 0.75rem; }

@media (max-width: 760px) {
    .site { border: 0; }
    .site-main, .app-main { padding: 1rem; }
    .app-body { flex-direction: column; }
    .app-sidebar {
        width: 100%;
        flex-basis: auto;
        border-right: 0;
        border-bottom: 3px solid #000;
    }
    .app-sidebar a { display: inline-block; }
    .dashboard-header, .detail-header { flex-direction: column; }
}
