:root {
    --ink: #3a1f44;
    --ink-2: #4c285a;
    --pink: #b3125d;
    --pink-soft: #f8e7f0;
    --blue: #5d538c;
    --green: #2f8b67;
    --green-soft: #e8f4ed;
    --amber: #b26a00;
    --amber-soft: #fff3df;
    --muted: #766b7d;
    --line: #e7e1eb;
    --soft: #f7f5f8;
    --paper: #fff9f2;
    --white: #fff;
    color: var(--ink);
    background: var(--soft);
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 16px;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--soft); }
a { color: var(--pink); }
p { line-height: 1.6; }
h1 { font-size: 31px; line-height: 1.15; margin: 0 0 12px; letter-spacing: -.03em; }
h2 { font-size: 20px; margin: 0 0 18px; }
h3 { font-size: 16px; margin: 12px 0 8px; }
small, .muted { color: var(--muted); font-size: 13px; }

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

.sidebar {
    background: var(--ink);
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100vh;
    padding: 30px 16px 20px;
    position: sticky;
    top: 0;
}

.brand img { width: 145px; margin: 0 10px; }
.brand-sub {
    color: #cbb8d3;
    font-size: 11px;
    letter-spacing: .16em;
    line-height: 1.5;
    margin: 12px 10px 28px;
    text-transform: uppercase;
}

.nav-label {
    color: #b6a2bf;
    font-size: 11px;
    letter-spacing: .14em;
    margin: 14px 10px 6px;
    text-transform: uppercase;
}

.nav { display: flex; flex-direction: column; gap: 5px; }
.nav a {
    border-radius: 9px;
    color: #eadff0;
    font-size: 14px;
    padding: 11px 12px;
    text-decoration: none;
}
.nav a:hover { background: #ffffff12; }
.nav a.active {
    background: #ffffff18;
    box-shadow: inset 3px 0 #de3478;
    color: #fff;
}

.sidebar-bottom {
    border-top: 1px solid #ffffff20;
    margin-top: auto;
    padding-top: 16px;
}

.sidebar-suggestions {
    border-bottom: 1px solid #ffffff20;
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
    padding: 0 8px 14px;
}
.sidebar-suggestions strong { font-size: 13px; }
.sidebar-suggestions small { color: #cbb8d3; line-height: 1.45; }
.sidebar-suggestions a { color: #fff; font-size: 12px; line-height: 1.35; text-decoration: none; }
.sidebar-small-link { color: #cbb8d3 !important; text-decoration: underline !important; }

.person { align-items: center; border-radius: 10px; color: #fff; display: flex; gap: 10px; padding: 8px 8px; text-decoration: none; }
.person:hover { background: #ffffff12; }
.avatar {
    align-items: center;
    background: #eee8f2;
    border-radius: 50%;
    color: var(--ink);
    display: grid;
    font-size: 12px;
    font-weight: 700;
    height: 38px;
    justify-items: center;
    width: 38px;
}
.person small { color: #cbb8d3; display: block; }
.logout {
    background: #ffffff14;
    border: 1px solid #ffffff20;
    color: white;
    margin-top: 10px;
    width: 100%;
}
.offline { align-items: center; color: #d7c8de; display: flex; font-size: 12px; gap: 8px; padding: 0 8px; }
.dot { background: #82c5a5; border-radius: 50%; display: inline-block; height: 8px; width: 8px; }

.workspace { min-width: 0; }
.topbar {
    align-items: center;
    background: white;
    border-bottom: 1px solid var(--line);
    display: flex;
    height: 78px;
    justify-content: space-between;
    padding: 0 34px;
}
.context { align-items: center; display: flex; gap: 14px; min-width: 0; }
.context strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.context .divider { background: var(--line); height: 26px; width: 1px; }
.topbar-links { align-items: center; display: flex; gap: 14px; font-size: 13px; }
.demo-pill {
    border: 1px solid #e5dce8;
    border-radius: 7px;
    color: var(--blue);
    font-size: 12px;
    letter-spacing: .04em;
    padding: 6px 9px;
}

main {
    margin: 0 auto;
    max-width: 1360px;
    padding: 30px 28px;
}
.guest, .auth { margin: 45px auto; max-width: 540px; }
footer { color: #796d80; font-size: 12px; padding: 25px; text-align: center; }

.card, .panel {
    background: white;
    border: 1px solid var(--line);
    border-radius: 13px;
    box-shadow: 0 10px 35px #3a1f4410;
    margin-bottom: 22px;
    padding: 24px;
}
.card.compact { padding: 18px; }
.hero { background: linear-gradient(135deg, #3a1f44, #5d538c 55%, #b3125d); border: 0; color: white; }
.hero .muted, .hero small { color: #eadff0; }
.panel-head.flat {
    align-items: center;
    border: 0;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 0 0 16px;
}

.notice {
    background: #eee8f1;
    border-left: 4px solid var(--pink);
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.6;
    margin: 15px 0 22px;
    padding: 14px 18px;
}
.error { background: #fff0f3; border-radius: 10px; color: #9b1848; padding: 15px; }
.success { background: #e8f4ed; border-radius: 10px; color: #286749; padding: 15px; }

.grid { display: grid; gap: 22px; grid-template-columns: 1fr 1fr; }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.stats {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(4, 1fr);
    margin: 0 auto 18px;
    max-width: 1240px;
}
.stat {
    background: white;
    border: 1px solid var(--line);
    border-radius: 13px;
    box-shadow: 0 10px 25px #3a1f440a;
    padding: 18px;
}
.stat strong { display: block; font-size: 30px; margin: 6px 0; }

.quick-nav, .tabs { display: flex; flex-wrap: wrap; gap: 10px; }
.tabs { background: var(--soft); padding: 0 0 12px; position: sticky; top: 0; z-index: 5; }
.badge {
    background: #eee8f1;
    border-radius: 7px;
    color: var(--blue);
    display: inline-block;
    font-size: 12px;
    padding: 4px 8px;
}
.badge.green { background: var(--green-soft); color: #286749; }
.badge.pink { background: var(--pink-soft); color: var(--pink); }

label { display: block; font-size: 14px; margin-bottom: 16px; }
input, select, textarea {
    background: white;
    border: 1px solid #d8cedc;
    border-radius: 9px;
    display: block;
    font: inherit;
    margin-top: 7px;
    padding: 10px;
    width: 100%;
}
textarea { min-height: 92px; }
input[type=checkbox] { display: inline; width: auto; }
button, .button {
    background: var(--pink);
    border: 0;
    border-radius: 9px;
    color: white;
    cursor: pointer;
    display: inline-block;
    font: inherit;
    font-size: 14px;
    padding: 10px 14px;
    text-decoration: none;
}
button.secondary, .button.secondary { background: #eee8f1; color: var(--ink); }
.button.active-tab {
    background: var(--ink);
    color: #fff;
}
.actions { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; }
.actions select, .actions input { font-size: 12px; margin: 0; padding: 7px; width: auto; }
.actions label, .inline { align-items: center; display: inline-flex; font-size: 12px; gap: 6px; margin: 0; }

.table { overflow: auto; }
table { border-collapse: collapse; width: 100%; }
td, th {
    border-bottom: 1px solid #eee6f0;
    font-size: 14px;
    padding: 13px 10px;
    text-align: left;
    vertical-align: top;
}
th { background: #fbfafc; color: #796d80; }

.dashboard-heading {
    align-items: center;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    margin: 22px auto 24px;
    max-width: 1240px;
}
.dashboard-heading h1 { font-size: 30px; }
.dashboard-layout {
    align-items: start;
    display: grid;
    gap: 26px;
    grid-template-columns: minmax(0, 1fr) 330px;
    margin: 0 auto;
    max-width: 1240px;
}

.calendar-workspace {
    align-items: start;
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(0, 1fr) 360px;
}
.calendar-board { padding-bottom: 18px; }
.calendar-strip { align-items: center; display: flex; flex-wrap: wrap; gap: 10px; }
.calendar-legend { align-items: center; color: var(--muted); display: inline-flex; font-size: 12px; gap: 6px; }
.calendar-legend:before { background: var(--pink); border-radius: 3px; content: ""; height: 9px; width: 9px; }
.calendar-legend.national:before, .calendar-legend.election:before { background: var(--blue); }
.calendar-legend.training:before { background: var(--green); }
.calendar-legend.task:before { background: var(--amber); }
.calendar-legend.social:before { background: var(--pink); }

.weekdays {
    color: var(--muted);
    display: grid;
    font-size: 12px;
    font-weight: 700;
    grid-template-columns: repeat(7, 1fr);
}
.weekdays div {
    background: #fbfafc;
    border: 1px solid var(--line);
    border-bottom: 0;
    border-left: 0;
    padding: 8px;
    text-align: right;
}
.weekdays div:first-child { border-left: 1px solid var(--line); }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(92px, 1fr)); }
.dashboard-calendar { border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); }
.day-cell {
    background: white;
    border-right: 1px solid var(--line);
    border-top: 1px solid var(--line);
    min-height: 132px;
    overflow: hidden;
    padding: 8px;
}
.day-cell strong { display: block; font-size: 13px; margin-bottom: 4px; text-align: right; }
.day-cell.other-month { background: #fbfafc; opacity: .52; }
.day-cell.today { box-shadow: inset 0 0 0 2px #b3125d44; }
.calendar-chip {
    background: var(--pink-soft);
    border-radius: 7px;
    color: var(--pink);
    display: block;
    font-size: 12px;
    line-height: 1.25;
    margin-top: 6px;
    overflow: hidden;
    padding: 6px 7px;
    text-decoration: none;
    text-overflow: ellipsis;
}
.calendar-chip span {
    display: block;
    font-size: 9px;
    letter-spacing: .05em;
    opacity: .75;
    text-transform: uppercase;
}
.calendar-chip.training { background: var(--green-soft); color: #286749; }
.calendar-chip.national, .calendar-chip.election { background: #edeaf7; color: var(--blue); }
.calendar-chip.task { background: var(--amber-soft); color: #9b5c00; }
.calendar-chip.social { background: var(--pink-soft); color: var(--pink); }

.task-row, .agenda-row {
    align-items: center;
    border-top: 1px solid #eee6f0;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 14px 0;
}
.agenda-row { grid-template-columns: 54px minmax(0, 1fr); }
.agenda-row strong { color: var(--pink); }
.task-row small, .agenda-row small { display: block; }
.suggestion-row a { display: inline-block; font-size: 12px; margin-top: 4px; }

.focus-card {
    background: linear-gradient(135deg, #3a1f44, #5d538c 65%, #b3125d);
    border-radius: 16px;
    box-shadow: 0 14px 40px #3a1f4424;
    color: white;
    margin-bottom: 22px;
    padding: 24px;
}
.focus-card .muted, .focus-card p { color: #eadff0; }
.focus-card .badge { background: #ffffff20; color: #fff; }
.focus-card .button { background: white; color: var(--ink); }
.signal-list { display: grid; gap: 10px; }
.signal-list a {
    align-items: center;
    border-top: 1px solid #eee6f0;
    color: var(--ink);
    display: flex;
    gap: 9px;
    padding-top: 10px;
    text-decoration: none;
}
.mini-stats {
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr 1fr;
}
.mini-stats span {
    background: #fbfafc;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px;
}
.mini-stats strong { display: block; font-size: 24px; }
.level-list { display: grid; gap: 10px; }
.level-list article {
    background: #fbfafc;
    border: 1px solid var(--line);
    border-radius: 12px;
    display: grid;
    gap: 8px;
    padding: 12px;
}
.level-list article > div { display: flex; flex-wrap: wrap; gap: 6px; }
.level-list.compact article { padding: 10px; }
.attention-list article.needs-attention { border-color: #f1c7d9; box-shadow: 0 12px 28px #b3125d12; }
.level-head { align-items: center; display: flex; justify-content: space-between; gap: 8px; }
.attention-points { margin: 0; padding-left: 18px; }
.attention-points li { margin: 4px 0; }
.level-next { display: grid; gap: 3px; }
.level-metrics { display: flex; flex-wrap: wrap; gap: 6px; }

.calendar-list { display: grid; gap: 12px; }
.calendar-item {
    border-top: 1px solid #eee6f0;
    display: grid;
    gap: 14px;
    grid-template-columns: 110px minmax(0, 1fr) 190px;
    padding: 15px 0;
}
.post-preview { background: var(--paper); border-radius: 10px; padding: 14px; white-space: pre-wrap; }
.media-list { display: grid; gap: 10px; margin: 14px 0; }
.media-item { background: #fbfafc; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.media-item img, .media-item video {
    background: #eee8f1;
    border-radius: 8px;
    max-height: 260px;
    object-fit: cover;
    width: 100%;
}
.media-item form { margin-top: 8px; }
.media-item small { display: block; margin-top: 7px; overflow-wrap: anywhere; }

.settings-section { scroll-margin-top: 92px; }
.settings-split { display: grid; gap: 18px; grid-template-columns: minmax(260px, 0.9fr) minmax(280px, 1.1fr); align-items: start; }
.settings-section.table textarea { min-height: 74px; }
.org-tree ul { margin: 8px 0 8px 22px; }
.org-tree li { margin: 8px 0; }
.org-row {
    align-items: end;
    border-top: 1px solid #eee6f0;
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 360px) auto;
    padding: 14px 0;
}
.org-row.child { padding-left: 22px; }
.friendly-steps { margin: 10px 0 10px 20px; padding: 0; }
.friendly-steps li { list-style: decimal; margin: 6px 0; }
.secret { background: #f6f2f8; font-family: monospace; overflow-wrap: anywhere; padding: 16px; }
.qr svg { height: 180px; width: 180px; }
.portal-page { max-width: 820px; }
.portal-event { grid-template-columns: 62px minmax(0, 1fr); }
.portal-page .secret { white-space: pre-wrap; word-break: break-all; }
.profile-head {
    align-items: center;
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}
.profile-avatar {
    background: #eee8f1;
    border-radius: 22px;
    color: var(--ink);
    display: grid;
    font-size: 22px;
    font-weight: 700;
    height: 96px;
    object-fit: cover;
    place-items: center;
    width: 96px;
}
.profile-avatar.placeholder { box-shadow: inset 0 0 0 1px var(--line); }
.planning-section { margin-top: 28px; }
.planning-grid { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.planning-card { display: flex; flex-direction: column; gap: 14px; }
.planning-card h3 { font-size: 22px; margin: 8px 0 2px; }
.plan-date { white-space: nowrap; }
.progress-line { background: #eee8f1; border-radius: 999px; height: 9px; overflow: hidden; }
.progress-line span { background: linear-gradient(90deg, var(--accent), #76285d); display: block; height: 100%; }
.plan-metrics { display: grid; gap: 8px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.plan-metrics span { background: #fbfafc; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.plan-metrics strong, .plan-metrics small { display: block; }
.plan-metrics strong { font-size: 20px; }
.plan-timeline { border-left: 3px solid #e7dce9; display: grid; gap: 9px; padding-left: 14px; }
.plan-timeline span { align-items: center; display: flex; justify-content: space-between; gap: 12px; }
.plan-timeline small { color: var(--muted); }
.planning-card details { border-top: 1px solid var(--line); padding-top: 12px; }
.planning-card summary { color: var(--accent); cursor: pointer; font-weight: 700; }
.plan-form { margin-top: 16px; }
.plan-links { display: flex; flex-wrap: wrap; gap: 8px; }
.pagination { margin-top: 18px; }
.pagination nav { align-items: center; display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; }
.pagination nav > div { align-items: center; display: flex; flex-wrap: wrap; gap: 6px; }
.pagination a, .pagination span {
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    display: inline-flex;
    min-height: 36px;
    padding: 7px 11px;
    text-decoration: none;
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination span[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.pagination span[aria-current="page"] span { background: transparent; border: 0; color: inherit; min-height: 0; padding: 0; }
.pagination svg { display: block; height: 18px !important; width: 18px !important; }

@media (max-width: 1120px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar { height: auto; position: relative; }
    .nav { display: grid; grid-template-columns: repeat(2, 1fr); }
    .topbar { height: auto; padding: 16px 18px; }
    .dashboard-layout, .calendar-workspace, .grid, .grid.three, .stats, .settings-split, .planning-grid { grid-template-columns: 1fr; }
    .calendar-item, .org-row { grid-template-columns: 1fr; }
    main { padding: 24px 14px; }
    h1 { font-size: 25px; }
    .card { padding: 18px; }
}

@media (max-width: 720px) {
    .dashboard-heading, .topbar { align-items: flex-start; display: block; }
    .context { align-items: flex-start; flex-wrap: wrap; gap: 8px; }
    .context .divider { display: none; }
    .context strong { max-width: 100%; white-space: normal; }
    .topbar-links { margin-top: 10px; }
    .month-grid, .weekdays { grid-template-columns: 1fr; }
    .weekdays { display: none; }
    .day-cell { min-height: auto; }
    .nav { grid-template-columns: 1fr; }
    .actions select, .actions input { width: 100%; }
    .actions button { width: 100%; }
    .table { overflow: visible; }
    table, thead, tbody, tr, th, td { display: block; width: 100%; }
    thead { display: none; }
    tr {
        background: #fff;
        border: 1px solid var(--line);
        border-radius: 12px;
        box-shadow: 0 8px 22px #3a1f4408;
        margin-bottom: 12px;
        overflow: hidden;
    }
    td {
        border-bottom: 1px solid #eee6f0;
        padding: 12px;
    }
    td:last-child { border-bottom: 0; }
    td h3 { margin-top: 0; }
    .calendar-board { padding: 14px; }
    .calendar-chip { white-space: normal; }
    .mini-stats { grid-template-columns: 1fr; }
    .plan-metrics { grid-template-columns: 1fr 1fr; }
    .sidebar { padding: 22px 14px 16px; }
    .brand-sub { margin-bottom: 14px; }
    main { max-width: 100%; overflow-x: hidden; }
    .pagination nav, .pagination nav > div { justify-content: center; width: 100%; }
    .pagination nav > div:first-child { display: none; }
}



