@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500&display=swap");

/* Variables */
:root {
    --bg-primary: #070e18;
    --bg-header: #080f19;
    --bg-secondary: #0a1320;
    --bg-card: #0b1623;
    --bg-card-soft: #101c2b;
    --bg-input: #08121f;
    --border-color: #1b2a3a;
    --border-soft: #152334;
    --text-primary: #f5f7fb;
    --text-secondary: #aeb8c6;
    --text-muted: #7d8998;
    --accent: #e6a146;
    --accent-strong: #f0b23d;
    --accent-dark: #3a2b17;
    --danger: #dc4450;
    --link: #70b8e8;
    --header-height: 70px;
    --radius: 8px;
    --shadow-soft: 0 12px 28px rgba(0, 0, 0, .18);
    color-scheme: dark;
}

/* Reset */
* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--bg-primary);
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 25% 0%, rgba(21, 39, 58, .3), transparent 34%),
        var(--bg-primary);
    color: var(--text-primary);
    font-family: "Poppins", "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0;
    line-height: 1.45;
}

button,
input,
textarea,
select {
    font: inherit;
    letter-spacing: 0;
}

button,
a {
    color: inherit;
}

button {
    border: 0;
    cursor: pointer;
}

a {
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

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

h1,
h2,
h3,
strong,
th {
    font-weight: 500;
}

/* Global */
.icon {
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
}

.card {
    background: linear-gradient(180deg, rgba(14, 26, 39, .96), rgba(9, 18, 30, .96));
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025), var(--shadow-soft);
}

.avatar {
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, .1);
    background: #172334;
}

.avatar-top {
    width: 52px;
    height: 52px;
}

.avatar-xl {
    width: 86px;
    height: 86px;
}

.avatar-lg {
    width: 56px;
    height: 56px;
}

.avatar-md {
    width: 48px;
    height: 48px;
}

.avatar-sm {
    width: 44px;
    height: 44px;
}

.ghost-button,
.gold-button,
.post-submit {
    min-height: 38px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
}

.ghost-button {
    border: 1px solid var(--border-color);
    background: rgba(8, 18, 31, .8);
    color: var(--text-primary);
}

.ghost-button:hover,
.icon-button:hover,
.tool-button:hover {
    border-color: #2b3d51;
    background: #101d2c;
}

.gold-button,
.post-submit {
    background: linear-gradient(180deg, #f0b44e, #e39838);
    color: #fff7e4;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .24);
}

.gold-button .icon {
    width: 18px;
    height: 18px;
}

.text-action {
    background: transparent;
    color: var(--link);
    padding: 0;
    font-size: 12px;
}

.icon-button {
    width: 38px;
    height: 38px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-button .icon {
    width: 21px;
    height: 21px;
}

.app-shell {
    width: 100%;
    padding: 20px 34px 34px;
}

.narrow-shell {
    max-width: 980px;
    margin: 0 auto;
}

/* Header */
.topbar {
    height: var(--header-height);
    background: rgba(8, 15, 25, .98);
    border-bottom: 1px solid #172231;
    display: flex;
    align-items: center;
    padding: 0 34px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.brand {
    width: 257px;
    flex: 0 0 257px;
    height: var(--header-height);
    display: flex;
    align-items: center;
    overflow: hidden;
}

.brand-logo {
    width: 96px;
    height: 96px;
    object-fit: contain;
    object-position: left center;
}

.topnav {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(980px, calc(100% - 520px));
    height: var(--header-height);
    flex: 0 0 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0;
}

.nav-icon {
    width: 42px;
    height: var(--header-height);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #f2f6fb;
    position: relative;
    background: transparent;
}

.hidden-nav-item {
    display: none;
}

.nav-icon .icon {
    width: 27px;
    height: 27px;
}

.nav-icon .icon-settings {
    width: 25px;
    height: 25px;
}

.nav-icon.active::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 1px;
    width: 41px;
    height: 3px;
    border-radius: 6px 6px 0 0;
    background: var(--accent-strong);
    transform: translateX(-50%);
}

.top-actions {
    margin-left: auto;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0;
}

.top-actions .action-wrap {
    position: relative;
    left: 0;
}

.top-actions > a.nav-icon {
    position: relative;
    left: 0;
}

.action-wrap,
.profile-wrap {
    position: relative;
}

.notification-trigger {
    padding: 0;
}

.notify-badge {
    position: absolute;
    top: 16px;
    right: 1px;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background: #f12d36;
    color: #fff;
    font-size: 12px;
    line-height: 19px;
    text-align: center;
    border: 1px solid var(--bg-header);
}

.notify-badge.is-zero {
    display: none;
}

.profile-button {
    height: var(--header-height);
    display: flex;
    align-items: center;
    gap: 16px;
    background: transparent;
    padding: 0;
}

.profile-button .icon {
    width: 19px;
    height: 19px;
}

.dropdown-panel,
.mini-menu {
    position: absolute;
    display: none;
    z-index: 100;
    background: #0b1623;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 18px 42px rgba(0, 0, 0, .34);
}

.dropdown-panel.open,
.mini-menu.open {
    display: block;
}

.notifications-menu {
    top: 64px;
    right: -116px;
    width: 330px;
    padding: 10px;
}

.profile-menu {
    top: 64px;
    right: 0;
    width: 214px;
    padding: 8px;
}

.dropdown-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 8px 10px;
    border-bottom: 1px solid var(--border-soft);
    margin-bottom: 6px;
}

.dropdown-head span {
    font-weight: 500;
}

.notification-item,
.profile-menu a,
.profile-menu button,
.dropdown-link {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 6px;
    background: transparent;
    text-align: left;
}

.notification-item:hover,
.profile-menu a:hover,
.profile-menu button:hover,
.dropdown-link:hover {
    background: #101d2c;
}

.notification-item {
    align-items: flex-start;
}

.notification-item strong,
.notification-item small {
    display: block;
}

.notification-item small {
    color: var(--text-secondary);
    font-size: 12px;
    margin-top: 2px;
}

.mini-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    margin-top: 7px;
}

.notification-item.unread .mini-status {
    background: var(--accent);
}

.profile-menu .icon {
    width: 18px;
    height: 18px;
}

.mobile-menu-toggle {
    display: none;
}

/* Layout */
.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 412px;
    gap: 32px;
    align-items: start;
}

.feed-column {
    min-width: 0;
}

/* Community */
.create-post {
    min-height: 452px;
    height: auto;
    display: flex;
    flex-direction: column;
    padding: 24px 24px 19px;
    margin-bottom: 18px;
}

.composer-row {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: stretch;
    gap: 20px;
}

.composer-row textarea {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: 0;
    resize: none;
    overflow-x: hidden;
    overflow-y: auto;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--text-primary);
    padding: 17px 0 0;
    font-size: 15px;
    line-height: 1.45;
}

.composer-row textarea::placeholder {
    color: #d4dae4;
    opacity: .9;
}

.composer-divider {
    height: 1px;
    background: var(--border-soft);
    margin: 0 0 12px;
}

.composer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.composer-tools {
    display: flex;
    align-items: center;
    gap: 42px;
}

.tool-button {
    height: 36px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    color: var(--text-primary);
    border-radius: 6px;
    padding: 0 8px;
    font-size: 14px;
}

.tool-button .icon {
    width: 23px;
    height: 23px;
}

.post-submit {
    width: 90px;
    height: 40px;
    font-size: 14px;
}

.selected-file,
.poll-preview {
    color: var(--accent);
    font-size: 12px;
    margin-left: 76px;
    margin-top: 5px;
}

.feed-panel.card {
    overflow: visible;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.feed-toolbar {
    min-height: 52px;
    padding: 0 24px 0 25px;
    border: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    border-radius: 8px 8px 0 0;
    background: linear-gradient(180deg, rgba(14, 26, 39, .96), rgba(9, 18, 30, .96));
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.post-tabs {
    height: 52px;
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: stretch;
    gap: 28px;
}

.tab-button {
    position: relative;
    padding: 0 2px;
    background: transparent;
    color: var(--text-primary);
    font-size: 14px;
}

.tab-button.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    border-radius: 4px 4px 0 0;
    background: var(--accent-strong);
}

.feed-controls {
    display: flex;
    align-items: center;
    gap: 14px;
}

.feed-controls select,
.page-search input,
.in-panel-search input,
.settings-panel input,
.settings-panel select,
.modal-panel input,
.modal-panel textarea,
.comment-form input,
.chat-input input {
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
    border-radius: 6px;
    outline: none;
}

.feed-controls select {
    width: 96px;
    height: 34px;
    padding: 0 12px;
}

.post-list {
    display: flex;
    flex-direction: column;
}

.post-card {
    min-height: 254px;
    position: relative;
    padding: 18px 24px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 10px;
    background: linear-gradient(180deg, rgba(14, 26, 39, .96), rgba(9, 18, 30, .96));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025), var(--shadow-soft);
}

.post-card:first-child {
    margin-top: 0;
    border-top: 0;
    border-radius: 0 0 8px 8px;
    padding-bottom: 5px;
}

.post-card:not(:first-child) {
    padding-top: 14px;
}

.post-card:not(:first-child) .category-badge {
    margin-top: 10px;
}

.post-card:not(:first-child) .post-copy {
    margin-top: 10px;
}

.post-menu-wrap {
    position: absolute;
    right: 23px;
    top: 24px;
}

.more-button {
    width: 31px;
    height: 28px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.more-button .icon {
    width: 23px;
    height: 23px;
}

.mini-menu {
    top: 28px;
    right: 0;
    width: 120px;
    padding: 6px;
}

.mini-menu button {
    width: 100%;
    padding: 8px 10px;
    border-radius: 5px;
    background: transparent;
    text-align: left;
}

.mini-menu button:hover {
    background: #101d2c;
}

.mini-menu .danger {
    color: #ff8790;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-right: 44px;
}

.post-author h2 {
    font-size: 17px;
    line-height: 1.2;
}

.post-author p {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 3px;
}

.post-author span {
    margin: 0 6px;
}

.category-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    margin-top: 14px;
    border-radius: 5px;
    background: #172945;
    color: #dce8ff;
    font-size: 13px;
}

.category-badge.neutral {
    background: #1d2a36;
}

.category-badge.accent {
    background: var(--accent-dark);
    color: #ffcc70;
}

.post-copy {
    max-width: 690px;
    color: #f1f4f8;
    font-size: 15.5px;
    line-height: 1.45;
    margin-top: 13px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.attachment-box {
    min-height: 69px;
    margin-top: 13px;
    border: 1px solid var(--border-color);
    border-radius: 7px;
    background: rgba(9, 18, 30, .55);
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 11px 20px 11px 14px;
}

.attachment-box.compact {
    min-height: 60px;
}

.pdf-icon {
    width: 48px;
    height: 48px;
    border: 1px solid rgba(220, 68, 80, .55);
    border-radius: 6px;
    color: #ff4c59;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 500;
    background: rgba(220, 68, 80, .08);
}

.attachment-box strong,
.attachment-box span {
    display: block;
}

.attachment-box strong {
    font-size: 14px;
    color: var(--text-primary);
    overflow-wrap: anywhere;
}

.attachment-box span {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 3px;
}

.download-button {
    margin-left: auto;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--text-primary);
}

.download-button .icon {
    width: 22px;
    height: 22px;
}

.post-actions {
    height: 36px;
    margin-top: 9px;
    display: flex;
    align-items: center;
    gap: 28px;
}

.reaction-button {
    background: transparent;
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-width: 58px;
    height: 32px;
    padding: 0;
}

.reaction-button .icon {
    width: 23px;
    height: 23px;
}

.reaction-button.active {
    color: var(--accent);
}

.like-button.active {
    color: #f0444f;
}

.bookmark-button {
    margin-left: auto;
    min-width: 32px;
}

.comments-panel {
    display: none;
    border-top: 1px solid var(--border-soft);
    margin-top: 10px;
    padding-top: 12px;
}

.comments-open .comments-panel {
    display: block;
}

.comment-item {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 9px;
}

.comment-form {
    display: flex;
    gap: 8px;
}

.comment-form input {
    flex: 1;
    height: 36px;
    padding: 0 12px;
}

.comment-form button {
    min-width: 58px;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
}

.poll-card {
    margin-top: 14px;
    display: grid;
    gap: 8px;
}

.poll-card button {
    min-height: 40px;
    border: 1px solid var(--border-color);
    background: #0b1725;
    border-radius: 6px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
}

/* Sidebar */
.right-sidebar {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-search {
    height: 46px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 21px;
}

.sidebar-search .icon {
    width: 24px;
    height: 24px;
    color: #eef4fb;
}

.sidebar-search input {
    flex: 1;
    height: 100%;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--text-primary);
}

.sidebar-search input::placeholder {
    color: var(--text-secondary);
}

.sidebar-card {
    padding: 16px 18px 10px;
}

.sidebar-card h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    margin-bottom: 13px;
}

.sidebar-card h2 .icon {
    width: 22px;
    height: 22px;
}

.contributors h2 .icon {
    color: var(--accent-strong);
}

.recent-item {
    min-height: 71px;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 52px;
    column-gap: 12px;
    align-items: center;
    position: relative;
}

.recent-item strong,
.recent-item small {
    display: block;
}

.recent-item strong {
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.32;
    overflow-wrap: anywhere;
}

.recent-item small,
.recent-item em {
    color: var(--text-secondary);
    font-size: 12px;
    font-style: normal;
}

.recent-item b {
    position: absolute;
    right: 0;
    bottom: 11px;
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 400;
}

.recent-item b .icon {
    width: 17px;
    height: 17px;
}

.sidebar-link {
    display: inline-flex;
    color: var(--link);
    margin-top: 5px;
    font-size: 14px;
}

.contributor-row {
    min-height: 45px;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.contributor-row strong,
.contributor-row small {
    display: block;
}

.contributor-row strong {
    font-size: 14px;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.contributor-row small {
    color: var(--text-secondary);
    font-size: 12px;
}

.contributor-row mark {
    background: var(--accent-dark);
    color: #ffc257;
    border-radius: 5px;
    padding: 4px 9px;
    font-size: 10.5px;
}

.event-row {
    min-height: 66px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 14px;
    margin-bottom: 8px;
}

.date-block {
    width: 46px;
    text-align: center;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 0 0 46px;
}

.date-block em {
    font-style: normal;
    font-size: 13px;
    color: var(--text-primary);
}

.date-block strong {
    font-size: 30px;
    line-height: 1;
}

.event-row strong,
.event-row small {
    display: block;
}

.event-row small {
    color: var(--text-secondary);
    font-size: 13px;
}

/* Interior Pages */
.page-header {
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 16px;
}

.page-header h1,
.profile-hero h1 {
    font-size: 24px;
    line-height: 1.15;
}

.page-header p,
.profile-hero p {
    color: var(--text-secondary);
    margin-top: 5px;
}

.page-search,
.in-panel-search {
    height: 46px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border-color);
    border-radius: 7px;
    background: var(--bg-card);
    padding: 0 14px;
}

.page-search {
    width: min(410px, 100%);
}

.page-search input,
.in-panel-search input {
    width: 100%;
    height: 100%;
    border: 0;
    background: transparent;
}

.service-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.chip {
    height: 36px;
    padding: 0 16px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: #0b1623;
    color: var(--text-primary);
}

.chip.active {
    color: #fff;
    border-color: rgba(230, 161, 70, .45);
    background: var(--accent-dark);
}

.app-card-grid,
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.service-card {
    min-height: 224px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.service-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    color: var(--accent);
    background: var(--accent-dark);
}

.service-card h2,
.metric-card strong,
.table-card h2,
.task-card h2,
.project-card h2,
.calendar-card h2,
.event-detail h2,
.settings-panel h2,
.profile-panel h2,
.mail-reader h2 {
    font-size: 17px;
}

.service-card p {
    color: var(--text-secondary);
    min-height: 63px;
}

.service-card div {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 12px;
}

.service-card div strong {
    color: var(--accent);
}

.service-card .ghost-button {
    width: 100%;
}

/* Work */
.segmented-control {
    height: 38px;
    border: 1px solid var(--border-color);
    border-radius: 7px;
    overflow: hidden;
    display: flex;
}

.segmented-control button {
    min-width: 92px;
    background: #0b1623;
    color: var(--text-secondary);
    border-right: 1px solid var(--border-color);
}

.segmented-control button:last-child {
    border-right: 0;
}

.segmented-control button.active {
    background: var(--accent-dark);
    color: #ffcf72;
}

.metrics-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 16px;
}

.metric-card {
    padding: 18px;
}

.metric-card span,
.metric-card small {
    color: var(--text-secondary);
    display: block;
}

.metric-card strong {
    display: block;
    font-size: 28px;
    margin: 6px 0 2px;
}

.work-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 16px;
}

.table-card,
.task-card,
.project-card {
    padding: 18px;
}

.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.work-sort {
    height: 34px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: #08121f;
    color: var(--text-primary);
    padding: 0 10px;
}

.responsive-table {
    overflow-x: auto;
}

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

th,
td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-soft);
}

th {
    color: var(--text-secondary);
    font-size: 13px;
}

td small {
    display: block;
    color: var(--text-secondary);
    margin-top: 3px;
}

.status-pill,
.priority {
    display: inline-flex;
    align-items: center;
    height: 24px;
    border-radius: 5px;
    padding: 0 9px;
    font-size: 12px;
}

.status-pill.progress {
    background: #172945;
    color: #9fc5ff;
}

.status-pill.blocked {
    background: var(--accent-dark);
    color: #ffcf72;
}

.status-pill.done {
    background: #123229;
    color: #76dab1;
}

.priority.high {
    color: #ff9aa2;
}

.priority.medium {
    color: #ffcf72;
}

.priority.low {
    color: #9fb5cb;
}

.work-side {
    display: grid;
    gap: 16px;
}

.task-row {
    width: 100%;
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr);
    gap: 12px;
    text-align: left;
    background: transparent;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-soft);
}

.task-row span:first-child {
    width: 8px;
    height: 8px;
    margin-top: 7px;
    border-radius: 50%;
    background: var(--accent);
}

.task-row strong,
.task-row small {
    grid-column: 2;
}

.task-row small {
    color: var(--text-secondary);
}

.task-row.active strong {
    color: var(--accent);
}

.health-row {
    display: grid;
    grid-template-columns: 1fr 110px 42px;
    gap: 10px;
    align-items: center;
    margin-top: 14px;
}

meter {
    width: 100%;
    height: 8px;
}

/* Calendar */
.calendar-controls {
    display: flex;
    gap: 8px;
}

.calendar-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 366px;
    gap: 16px;
}

.calendar-card,
.event-detail {
    padding: 18px;
}

.calendar-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.calendar-heading span {
    color: var(--text-secondary);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays {
    color: var(--text-secondary);
    font-size: 13px;
    border-bottom: 1px solid var(--border-soft);
}

.calendar-weekdays span {
    padding: 0 8px 10px;
}

.month-grid button {
    min-height: 98px;
    background: transparent;
    color: var(--text-primary);
    border-right: 1px solid var(--border-soft);
    border-bottom: 1px solid var(--border-soft);
    text-align: left;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.month-grid button:nth-child(7n) {
    border-right: 0;
}

.month-grid .muted {
    color: var(--text-muted);
}

.month-grid .has-event span {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    border-radius: 4px;
    padding: 3px 6px;
    background: var(--accent-dark);
    color: #ffcf72;
    font-size: 12px;
}

.month-grid .selected {
    outline: 1px solid var(--accent);
    outline-offset: -1px;
    background: rgba(230, 161, 70, .08);
}

.event-detail-row {
    width: 100%;
    min-height: 72px;
    display: flex;
    gap: 14px;
    align-items: center;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 7px;
    padding: 10px;
    margin-top: 10px;
    text-align: left;
}

.event-detail-row.active {
    border-color: rgba(230, 161, 70, .55);
    background: rgba(230, 161, 70, .08);
}

.event-detail-row small {
    display: block;
    color: var(--text-secondary);
}

.selected-event {
    margin-top: 16px;
    border-top: 1px solid var(--border-soft);
    padding-top: 16px;
}

.selected-event h3 {
    font-size: 17px;
}

.selected-event p,
.selected-event small {
    display: block;
    color: var(--text-secondary);
    margin-top: 6px;
}

.selected-event .gold-button {
    margin-top: 14px;
}

/* Messages and Mail */
.messages-layout,
.mail-layout {
    display: grid;
    grid-template-columns: 370px minmax(0, 1fr);
    min-height: 650px;
    overflow: hidden;
}

.conversation-list,
.mail-list {
    border-right: 1px solid var(--border-color);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.conversation-item,
.mail-item {
    min-height: 74px;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 7px;
    padding: 10px;
    text-align: left;
}

.conversation-item:hover,
.mail-item:hover,
.conversation-item.active,
.mail-item.active {
    background: #101d2c;
    border-color: var(--border-color);
}

.conversation-item strong,
.conversation-item small,
.mail-item strong,
.mail-item small {
    display: block;
}

.conversation-item small,
.mail-item small,
.conversation-item em,
.mail-item em {
    color: var(--text-secondary);
    font-style: normal;
    font-size: 12px;
}

.mail-item.unread strong {
    color: #fff;
}

.chat-panel,
.mail-reader {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.chat-head,
.mail-reader-head {
    min-height: 74px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 18px;
}

.chat-head small,
.mail-reader-head span {
    display: block;
    color: var(--text-secondary);
}

.chat-messages {
    flex: 1;
    padding: 22px;
    overflow-y: auto;
}

.message-bubble {
    max-width: 64%;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 12px;
    background: #0b1623;
}

.message-bubble.outgoing {
    margin-left: auto;
    background: var(--accent-dark);
    border-color: rgba(230, 161, 70, .35);
}

.message-bubble strong,
.message-bubble small {
    display: block;
}

.message-bubble small {
    color: var(--text-secondary);
    margin-top: 5px;
}

.chat-input {
    min-height: 70px;
    border-top: 1px solid var(--border-color);
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-input input {
    flex: 1;
    height: 42px;
    padding: 0 12px;
}

.mail-reader {
    padding: 22px;
}

.mail-reader-head {
    padding: 0 0 18px;
    min-height: auto;
    display: block;
}

.mail-reader p {
    color: var(--text-secondary);
    margin: 18px 0;
    max-width: 720px;
}

.inline-actions {
    justify-content: flex-start;
}

/* Settings */
.settings-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 16px;
}

.settings-nav {
    padding: 10px;
    align-self: start;
}

.settings-nav button {
    width: 100%;
    height: 42px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    text-align: left;
}

.settings-nav button.active,
.settings-nav button:hover {
    background: var(--accent-dark);
    color: #ffcf72;
}

.settings-panel {
    display: none;
    padding: 20px;
}

.settings-panel.active {
    display: block;
}

.profile-edit {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 18px 0;
}

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

label {
    color: var(--text-secondary);
    font-size: 13px;
}

label input,
label select,
label textarea {
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
    margin-top: 7px;
}

.toggle-row {
    min-height: 68px;
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.toggle-row span,
.toggle-row small {
    display: block;
}

.toggle-row span {
    color: var(--text-primary);
    font-size: 15px;
}

.toggle-row small {
    color: var(--text-secondary);
    margin-top: 2px;
}

.toggle-row input {
    width: 42px;
    height: 22px;
    margin: 0;
    accent-color: var(--accent);
}

/* Notifications */
.notification-page-list {
    padding: 8px;
}

.notification-line {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border-soft);
}

.notification-line:last-child {
    border-bottom: 0;
}

.notification-line.unread {
    background: rgba(230, 161, 70, .06);
}

.notice-icon {
    width: 44px;
    height: 44px;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    background: var(--accent-dark);
}

.notification-line h2 {
    font-size: 15px;
}

.notification-line p,
.notification-line small {
    color: var(--text-secondary);
}

/* Profile */
.profile-hero {
    min-height: 160px;
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr) auto;
    gap: 20px;
    align-items: center;
    padding: 24px;
    margin-bottom: 16px;
}

.profile-tags {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.profile-tags span {
    height: 26px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    background: var(--accent-dark);
    color: #ffcf72;
    font-size: 12px;
}

.profile-grid {
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 16px;
}

.profile-panel {
    padding: 20px;
}

.profile-panel.wide {
    grid-column: 1 / -1;
}

.profile-panel p {
    color: var(--text-secondary);
    margin-top: 10px;
}

dl {
    margin: 18px 0 0;
}

dl div {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-soft);
    padding: 10px 0;
}

dt {
    color: var(--text-secondary);
}

dd {
    margin: 0;
}

.activity-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-soft);
    padding: 14px 0;
}

.activity-row strong {
    font-size: 22px;
}

.profile-post-link {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-soft);
}

.profile-post-link span {
    color: var(--text-secondary);
}

/* Modals */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 150;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(1, 5, 10, .72);
    padding: 18px;
}

.modal-backdrop.open {
    display: flex;
}

.modal-panel {
    width: min(480px, 100%);
    max-height: calc(100vh - 36px);
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    padding: 22px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #0b1623;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .52);
}

.compose-panel {
    width: min(620px, 100%);
}

.modal-panel h2 {
    font-size: 18px;
    margin-bottom: 16px;
}

.modal-panel label {
    display: block;
    margin-bottom: 12px;
}

.poll-option-field {
    margin-bottom: 12px;
}

.poll-option-head {
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.remove-option-button {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: rgba(8, 18, 31, .8);
    color: var(--text-secondary);
}

.remove-option-button .icon {
    width: 15px;
    height: 15px;
}

.remove-option-button:hover {
    border-color: rgba(220, 68, 80, .55);
    color: #ff8790;
}

.remove-option-button[hidden] {
    display: none;
}

.add-option-button {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
    padding: 0 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: rgba(8, 18, 31, .8);
    color: var(--text-primary);
}

.add-option-button .icon {
    width: 17px;
    height: 17px;
}

.add-option-button:hover {
    border-color: rgba(230, 161, 70, .5);
    color: var(--accent);
}

.modal-panel textarea {
    min-height: 150px;
    padding: 10px 12px;
    resize: vertical;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: transparent;
    color: var(--text-primary);
    font-size: 22px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
}

.modal-actions .modal-cancel {
    position: static;
    width: auto;
    height: 38px;
    font-size: inherit;
}

.toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 200;
    min-width: 220px;
    max-width: min(360px, calc(100vw - 40px));
    min-height: 44px;
    display: none;
    align-items: center;
    padding: 10px 14px;
    border: 1px solid rgba(230, 161, 70, .42);
    border-radius: 7px;
    background: #111d2b;
    color: var(--text-primary);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .35);
}

.toast.show {
    display: flex;
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border-soft);
    background: var(--bg-header);
    color: var(--text-secondary);
}

.footer-inner {
    min-height: 60px;
    padding: 0 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.footer-inner nav {
    display: flex;
    gap: 20px;
}

.footer-inner a:hover {
    color: var(--accent);
}

/* Responsive */
@media (max-width: 1320px) {
    .brand {
        width: 180px;
        flex-basis: 180px;
    }

    .topnav {
        width: min(820px, calc(100% - 430px));
    }

    .top-actions .action-wrap,
    .top-actions > a.nav-icon {
        left: 0;
    }

    .top-actions {
        margin-left: 22px;
        gap: 0;
    }

    .content-grid {
        grid-template-columns: minmax(0, 1fr) 360px;
        gap: 18px;
    }

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

@media (max-width: 1100px) {
    .topbar {
        padding: 0 22px;
    }

    .brand {
        width: 160px;
        flex-basis: 160px;
    }

    .topnav {
        width: min(600px, calc(100% - 340px));
    }

    .top-actions {
        margin-left: 18px;
        gap: 0;
    }

    .app-shell {
        padding: 18px 22px 30px;
    }

    .content-grid,
    .work-layout,
    .calendar-layout {
        grid-template-columns: 1fr;
    }

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

    .sidebar-search,
    .events-card {
        grid-column: 1 / -1;
    }

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

@media (max-width: 820px) {
    :root {
        --header-height: 76px;
    }

    .topbar {
        position: sticky;
        min-height: var(--header-height);
        height: auto;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: center;
        justify-content: initial;
        gap: 12px;
    }

    .brand {
        grid-column: 1;
        grid-row: 1;
        justify-self: center;
        width: 126px;
        flex: 0 0 126px;
        min-width: 0;
    }

    .brand-logo {
        width: 116px;
        height: 116px;
    }

    .mobile-menu-toggle {
        width: 44px;
        height: 44px;
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        background: transparent;
        border: 1px solid var(--text-primary);
        border-radius: 4px;
        padding: 0;
        grid-column: 3;
        grid-row: 1;
        justify-self: end;
        order: initial;
    }

    .mobile-menu-toggle span {
        width: 22px;
        height: 2px;
        background: var(--text-primary);
    }

    .topnav {
        display: none;
        position: absolute;
        left: 0;
        right: 0;
        transform: none;
        top: var(--header-height);
        width: 100%;
        height: auto;
        padding: 11px 30px 12px;
        background: var(--bg-header);
        border-bottom: 1px solid var(--border-color);
        justify-content: space-between;
        align-items: center;
    }

    .topnav.open {
        display: flex;
    }

    .top-actions {
        grid-column: 2;
        grid-row: 1;
        justify-self: center;
        position: static;
        transform: none;
        margin-left: 0;
        gap: 0;
        order: initial;
    }

    .top-actions .nav-icon,
    .notification-trigger {
        width: 38px;
    }

    .top-actions .nav-icon .icon {
        width: 24px;
        height: 24px;
    }

    .avatar-top {
        width: 46px;
        height: 46px;
    }

    .profile-button {
        gap: 8px;
    }

    .profile-button .icon {
        display: none;
    }

    .content-grid,
    .right-sidebar,
    .messages-layout,
    .mail-layout,
    .settings-layout,
    .profile-grid {
        grid-template-columns: 1fr;
    }

    .conversation-list,
    .mail-list {
        border-right: 0;
        border-bottom: 1px solid var(--border-color);
        max-height: 360px;
        overflow-y: auto;
    }

    .page-header,
    .profile-hero {
        grid-template-columns: 1fr;
        display: grid;
        align-items: start;
    }

    .page-search {
        width: 100%;
    }

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

    .post-tabs {
        overflow-x: auto;
        gap: 22px;
        padding-bottom: 0;
        max-width: 100%;
    }

    .feed-toolbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
        padding: 0 18px 12px;
    }

    .feed-controls {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 620px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    body {
        font-size: 13.5px;
    }

    .topbar {
        padding: 0 12px;
        gap: 10px;
    }

    .brand {
        width: 112px;
        flex-basis: 112px;
    }

    .brand-logo {
        width: 104px;
        height: 104px;
    }

    .top-actions {
        gap: 0;
    }

    .avatar-top {
        width: 42px;
        height: 42px;
    }

    .mobile-menu-toggle {
        width: 40px;
        height: 40px;
    }

    .mobile-menu-toggle span {
        width: 21px;
    }

    .topnav {
        padding: 10px 24px 12px;
    }

    .topnav .nav-icon {
        width: 38px;
    }

    .topnav .nav-icon .icon {
        width: 25px;
        height: 25px;
    }

    .topnav .nav-icon .icon-settings {
        width: 24px;
        height: 24px;
    }

    .top-actions > .nav-icon:nth-of-type(1) {
        display: none;
    }

    .notifications-menu {
        right: -70px;
        width: min(330px, calc(100vw - 28px));
    }

    .profile-menu {
        right: 0;
    }

    .app-shell {
        padding: 14px 12px 24px;
        max-width: 100%;
        overflow-x: hidden;
    }

    .content-grid,
    .feed-column,
    .feed-panel,
    .post-list,
    .post-card,
    .create-post,
    .right-sidebar,
    .sidebar-card,
    .sidebar-search {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .create-post {
        min-height: 0;
        height: auto;
        padding: 16px;
    }

    .composer-row {
        height: auto;
        gap: 12px;
    }

    .composer-row textarea {
        min-height: 86px;
        padding-top: 5px;
    }

    .composer-actions {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
    }

    .composer-tools {
        gap: 6px;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .tool-button {
        padding: 0 4px;
        font-size: 12.5px;
    }

    .post-submit {
        width: 100%;
    }

    .selected-file,
    .poll-preview {
        margin-left: 0;
    }

    .post-card {
        padding: 16px;
        overflow: hidden;
    }

    .post-author {
        gap: 12px;
    }

    .post-author h2 {
        font-size: 15px;
    }

    .post-copy {
        font-size: 14.5px;
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    .attachment-box {
        padding: 10px;
        align-items: flex-start;
        min-width: 0;
    }

    .attachment-box > div {
        min-width: 0;
    }

    .pdf-icon {
        width: 40px;
        height: 40px;
    }

    .recent-item,
    .contributor-row,
    .conversation-item,
    .mail-item,
    .notification-line {
        grid-template-columns: 40px minmax(0, 1fr);
    }

    .recent-item em,
    .recent-item b,
    .contributor-row mark,
    .conversation-item em,
    .mail-item em,
    .notification-line .ghost-button {
        grid-column: 2;
        position: static;
        justify-self: start;
    }

    .app-card-grid,
    .metrics-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .service-tabs {
        overflow-x: auto;
    }

    .month-grid button {
        min-height: 70px;
        padding: 7px;
        font-size: 13px;
    }

    .month-grid .has-event span {
        display: none;
    }

    .message-bubble {
        max-width: 86%;
    }

    .chat-input {
        align-items: stretch;
    }

    .chat-input .gold-button {
        width: 46px;
        padding: 0;
    }

    .profile-hero {
        padding: 18px;
    }

    .footer-inner {
        padding: 14px;
        flex-direction: column;
        align-items: flex-start;
    }
}
