:root {
    --bg: #f4f1ea;
    --surface: #ffffff;
    --surface-strong: #f8fafc;
    --ink: #172033;
    --muted: #657084;
    --line: #d9dee7;
    --accent: #235c6f;
    --accent-strong: #173f4d;
    --danger: #b42318;
    --shadow: 0 18px 50px rgba(23, 32, 51, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.app-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding: 26px 20px;
    color: #eef7f5;
    background: #173f4d;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    color: #173f4d;
    background: #f6d36f;
    font-weight: 800;
}

.brand strong,
.brand span {
    display: block;
}

.brand span,
.sidebar-footer,
.project-nav a {
    color: rgba(238, 247, 245, 0.72);
}

.project-nav {
    display: grid;
    gap: 8px;
}

.project-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 42px;
    padding: 9px 10px;
    border-radius: 8px;
}

.project-nav a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.project-nav span {
    display: grid;
    width: 26px;
    height: 26px;
    place-items: center;
    border-radius: 7px;
    background: var(--project-color);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

.sidebar-footer {
    display: grid;
    gap: 12px;
    margin-top: auto;
    font-size: 14px;
}

.connect-link {
    padding: 11px 12px;
    border-radius: 8px;
    color: #173f4d;
    background: #f6d36f;
    text-align: center;
    font-weight: 700;
}

.dashboard {
    padding: 30px;
}

.topbar,
.panel-heading,
.account-card,
.email-row,
.todo-item {
    display: flex;
    align-items: center;
}

.topbar {
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

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

h1 {
    margin-bottom: 0;
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.05;
}

h2 {
    margin-bottom: 0;
    font-size: 20px;
}

h3 {
    margin-bottom: 6px;
    font-size: 16px;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-pill,
.secondary,
.primary,
.quick-add button,
.note-form button {
    min-height: 40px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    font-weight: 700;
}

.primary,
.quick-add button,
.note-form button {
    border-color: var(--accent);
    color: #fff;
    background: var(--accent);
}

.status-pill {
    color: #845400;
    background: #fff4cf;
    border-color: #f6d36f;
}

.account-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.account-card {
    gap: 12px;
    min-height: 82px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.account-card div {
    min-width: 0;
}

.account-card strong,
.account-card small {
    display: block;
}

.account-card small,
.account-card em,
.muted,
.agenda-item p,
.email-row p,
.todo-item p,
.note-card time {
    color: var(--muted);
}

.account-card em {
    margin-left: auto;
    font-size: 12px;
    white-space: nowrap;
}

.account-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    flex: 0 0 auto;
}

.grid-main,
.grid-secondary {
    display: grid;
    gap: 18px;
}

.grid-main {
    grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.65fr);
    margin-bottom: 18px;
}

.grid-secondary {
    grid-template-columns: minmax(360px, 0.8fr) minmax(0, 1.2fr);
}

.notes-panel {
    grid-column: 1 / -1;
}

.panel {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.panel-heading {
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.panel-heading span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.agenda-list {
    display: grid;
    gap: 12px;
}

.agenda-item {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto;
    gap: 12px;
    padding: 14px;
    border: 1px solid #e5e9f0;
    border-radius: 8px;
    background: var(--surface-strong);
}

.agenda-item time {
    display: block;
    margin-bottom: 5px;
    color: var(--project-color);
    font-size: 13px;
    font-weight: 800;
}

.agenda-item span {
    align-self: start;
    padding: 5px 8px;
    border-radius: 999px;
    color: var(--project-color);
    background: color-mix(in srgb, var(--project-color), white 88%);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.timeline-dot {
    width: 10px;
    height: 10px;
    margin-top: 6px;
    border-radius: 999px;
    background: var(--project-color);
}

.email-scroll {
    display: grid;
    max-height: 470px;
    overflow: auto;
    padding-right: 4px;
}

.email-row {
    gap: 12px;
    padding: 13px 0;
    border-bottom: 1px solid #e8ecf2;
}

.email-row div {
    min-width: 0;
}

.email-row strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.email-row time {
    margin-left: auto;
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.avatar {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 8px;
    color: #fff;
    font-weight: 800;
    flex: 0 0 auto;
}

.quick-add,
.note-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 130px 110px 70px;
    gap: 8px;
    margin-bottom: 14px;
}

.note-fields {
    grid-template-columns: minmax(0, 1fr) 150px;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    padding: 11px 12px;
}

textarea {
    resize: vertical;
}

.todo-list,
.trello-list,
.note-grid {
    display: grid;
    gap: 10px;
}

.todo-item {
    gap: 12px;
    padding: 12px;
    border: 1px solid #e8ecf2;
    border-radius: 8px;
    background: var(--surface-strong);
}

.todo-item button {
    width: 22px;
    height: 22px;
    border: 2px solid #9aa5b5;
    border-radius: 999px;
    background: #fff;
}

.todo-item button:disabled {
    opacity: 0.45;
}

.trello-list {
    max-height: 390px;
    overflow: auto;
    padding-right: 4px;
}

.trello-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 13px;
    border: 1px solid #e8ecf2;
    border-left: 4px solid var(--project-color);
    border-radius: 8px;
    background: var(--surface-strong);
}

.trello-card div {
    min-width: 0;
}

.trello-card span {
    display: inline-block;
    margin-bottom: 7px;
    color: var(--project-color);
    font-size: 12px;
    font-weight: 800;
}

.trello-card h3 {
    margin-bottom: 5px;
}

.trello-card time {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.note-form {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}

.note-form button {
    justify-self: end;
}

.note-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.note-card {
    min-height: 170px;
    padding: 14px;
    border: 1px solid #e8ecf2;
    border-radius: 8px;
    background: #fffbeb;
}

.note-card span {
    display: inline-block;
    margin-bottom: 10px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
}

.note-card p {
    color: #394456;
}

.login-body {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 22px;
    background: #173f4d;
}

.login-panel {
    display: grid;
    gap: 22px;
    width: min(440px, 100%);
    padding: 28px;
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

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

label {
    display: grid;
    gap: 7px;
    color: #394456;
    font-weight: 700;
}

.alert {
    padding: 12px 14px;
    border: 1px solid #f2b8b5;
    border-radius: 8px;
    color: var(--danger);
    background: #fff4f2;
}

.setup-alert {
    margin-bottom: 18px;
    color: #845400;
    background: #fff4cf;
    border-color: #f6d36f;
}

@media (max-width: 1100px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
    }

    .grid-main,
    .grid-secondary,
    .account-strip {
        grid-template-columns: 1fr;
    }

    .note-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .dashboard {
        padding: 18px;
    }

    .topbar,
    .top-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .quick-add,
    .note-fields,
    .note-grid {
        grid-template-columns: 1fr;
    }

    .agenda-item {
        grid-template-columns: 14px minmax(0, 1fr);
    }

    .agenda-item span {
        grid-column: 2;
        justify-self: start;
    }
}
