:root {
    --bg: #f3f4f6;
    --panel: #ffffff;
    --ink: #1f2937;
    --muted: #667085;
    --line: #e6e8ec;
    --brand: #ec6608;
    --brand-dark: #bb5006;
    --soft: #fff5ec;
    --success: #196c3a;
    --shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, sans-serif;
    color: var(--ink);
    background: var(--bg);
}

.portal-topbar {
    background: linear-gradient(90deg, var(--brand), #ff842f);
    max-height: 64px;
    overflow: hidden;
}

.portal-topbar-inner {
    width: min(1040px, calc(100% - 28px));
    margin: 0 auto;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.portal-topbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    color: #fff;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.portal-topbar-brand img {
    display: block;
    height: 28px;
    width: auto;
    max-width: none;
    flex: 0 0 auto;
}

.portal-topbar-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-action {
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
}

.page-shell {
    width: min(1040px, calc(100% - 28px));
    margin: 16px auto 28px;
    display: grid;
    gap: 14px;
}

.login-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.card,
.login-card,
.todo-card {
    background: var(--panel);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.login-card {
    max-width: 460px;
    margin: 34px auto 0;
    padding: 26px;
}

h1, h2, h3, p {
    margin: 0;
}

.page-summary {
    padding: 14px 16px;
}

.page-summary-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
}

.page-summary-title {
    font-size: clamp(24px, 3vw, 30px);
    line-height: 1.15;
    margin-bottom: 4px;
}

.section-title {
    font-size: 18px;
}

.section-copy,
.todo-meta,
.todo-footer,
.login-card p,
label,
.summary-inline {
    color: var(--muted);
}

.page-summary-stats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.summary-chip {
    min-width: 104px;
    padding: 10px 12px;
    border: 1px solid #f2d0b9;
    border-radius: 16px;
    background: #fffdfa;
    display: grid;
    gap: 3px;
}

.summary-chip strong {
    font-size: 24px;
    line-height: 1;
    color: var(--brand-dark);
}

.summary-chip span {
    font-size: 13px;
    color: var(--muted);
}

.content-card {
    padding: 14px 16px 16px;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 12px;
}

.summary-inline {
    white-space: nowrap;
    font-size: 13px;
    padding-top: 4px;
}

.stack {
    display: grid;
    gap: 14px;
}

label {
    display: grid;
    gap: 6px;
    font-size: 14px;
}

input,
button {
    font: inherit;
}

input {
    border: 1px solid #d9d9d9;
    border-radius: 10px;
    padding: 12px 14px;
}

button,
.ghost-link {
    border: 0;
    border-radius: 10px;
    padding: 10px 14px;
    background: var(--brand);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
}

.ghost-link {
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.22);
}

.notice {
    padding: 12px 14px;
    border-radius: 10px;
    margin: 14px 0;
}

.notice-error {
    background: #fff2f0;
    color: #b42318;
    border: 1px solid #f2c1bc;
}

.notice-success {
    background: #edf9f1;
    color: #196c3a;
    border: 1px solid #b7e2c5;
}

.todo-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.todo-card {
    border: 1px solid var(--line);
    padding: 14px 16px;
    border-radius: 16px;
    box-shadow: none;
}

.todo-row,
.todo-footer,
.todo-title-row,
.schedule-line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.todo-main {
    min-width: 0;
    width: 100%;
}

.todo-title-row h3 {
    font-size: 18px;
    line-height: 1.25;
}

.todo-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 8px;
    margin-top: 7px;
    font-size: 12px;
}

.todo-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: #f7f7f8;
    border: 1px solid #eceef2;
}

.todo-text {
    margin: 10px 0 0;
    line-height: 1.45;
    color: var(--ink);
    font-size: 14px;
}

.schedule-box {
    margin: 10px 0 0;
    padding: 10px 12px;
    border: 1px solid #f2dcca;
    border-radius: 14px;
    background: var(--soft);
}

.schedule-box strong {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
}

.schedule-lines {
    display: grid;
    gap: 6px;
}

.schedule-line {
    font-weight: 600;
    font-size: 13px;
}

.schedule-type {
    color: var(--brand-dark);
    white-space: nowrap;
}

.schedule-note {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.todo-footer {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f0f1f4;
    font-size: 12px;
}

.status-chip {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 999px;
    background: #eef7f1;
    color: var(--success);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.status-chip.pending {
    background: #fff4e8;
    color: var(--brand-dark);
}

.role-chip {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.22);
    color: #fff;
    font-weight: 700;
}

.status-form {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f1f4;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
}

.status-form select {
    width: 100%;
    border: 1px solid #d9d9d9;
    border-radius: 10px;
    padding: 12px 14px;
    font: inherit;
    background: #fff;
}

.status-save-btn {
    min-height: 46px;
    white-space: nowrap;
}

.empty-state {
    padding: 22px;
    border-radius: 14px;
    background: var(--soft);
    color: var(--muted);
    text-align: center;
}

@media (max-width: 920px) {
    .portal-topbar-inner {
        width: min(100%, calc(100% - 18px));
        min-height: auto;
        padding: 10px 0;
        flex-direction: column;
        align-items: flex-start;
    }

    .page-shell {
        width: min(100%, calc(100% - 18px));
    }

    .page-summary-head,
    .toolbar,
    .todo-row,
    .todo-footer,
    .todo-title-row,
    .schedule-line {
        flex-direction: column;
        align-items: stretch;
    }

    .todo-grid {
        grid-template-columns: 1fr;
    }

    .login-grid,
    .status-form {
        grid-template-columns: 1fr;
    }
}
