:root {
    --cd-font-family: "Inter", "Noto Sans Thai", "Sarabun", sans-serif;
    --cd-font-size-root: 15px;

    --cd-type-title: 2.125rem;
    --cd-type-section: 1.25rem;
    --cd-type-body: 0.9375rem;
    --cd-type-meta: 0.75rem;

    --cd-bg: #0b0f14;
    --cd-surface: #11161d;
    --cd-border: #1f2631;
    --cd-accent: #7c5cff;
    --cd-accent-hover: #6b4df0;
    --cd-text: #f5f5f7;
    --cd-text-secondary: #9aa3b2;
    --cd-danger: #ef4444;
    --cd-success: #22c55e;
    --cd-warning: #f59e0b;

    --cd-radius: 16px;
    --cd-radius-sm: 10px;
    --cd-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);

    /* Shared page shell — wider content column (≈75% zoom feel without CSS zoom) */
    --cd-page-max: 1500px;
    --cd-page-gutter: 1.5rem;

    --font-family: var(--cd-font-family);
    --font-size: var(--cd-font-size-root);
}

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

html {
    font-size: var(--cd-font-size-root);
}

body.cd-app {
    margin: 0;
    min-height: 100vh;
    font-family: var(--cd-font-family);
    font-size: var(--cd-type-body);
    line-height: 1.5;
    background-color: var(--cd-bg);
    background-image:
        linear-gradient(rgba(11, 15, 20, 0.60), rgba(11, 15, 20, 0.60)),
        url("../images/background.7bfd4d5e49d4.png");
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: var(--cd-text);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--cd-accent);
    text-decoration: none;
}

a:hover {
    color: #9b86ff;
}

/* Shared centered page container (header + main content) */
.cd-page-container,
.cd-topnav-inner,
.cd-app-body {
    width: 100%;
    max-width: var(--cd-page-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--cd-page-gutter);
    padding-right: var(--cd-page-gutter);
    box-sizing: border-box;
}

.cd-app-body {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
}

.cd-main {
    flex: 1;
    min-width: 0;
    padding-top: 2rem;
    padding-bottom: 4rem;
    min-height: calc(100vh - 4.5rem);
    background: transparent;
}

.cd-title {
    margin: 0;
    font-size: var(--cd-type-title);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.2;
    color: var(--cd-text);
}

.cd-section-title {
    margin: 0 0 1rem;
    font-size: var(--cd-type-section);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--cd-text);
}

.cd-subtitle,
.cd-hint {
    color: var(--cd-text-secondary);
    font-size: var(--cd-type-body);
}

.cd-hint {
    font-size: var(--cd-type-meta);
    line-height: 1.45;
}

.cd-surface {
    background: rgba(20, 25, 32, 0.55);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--cd-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.30);
}

/* ---- Top navigation ---- */

.cd-topnav {
    position: sticky;
    top: 0;
    z-index: 1030;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(11, 15, 20, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.cd-topnav-inner {
    min-height: 4.25rem;
    display: grid;
    grid-template-columns: 1fr minmax(0, 420px) 1fr;
    align-items: center;
    gap: 1rem;
}

.cd-topnav-left {
    justify-self: start;
}

.cd-topnav-center {
    justify-self: center;
    width: 100%;
}

.cd-topnav-right {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.cd-logo-cluster {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}

.cd-logo-home {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.3rem 0.2rem 0.3rem 0.3rem;
    border-radius: 0.7rem;
    color: var(--cd-text);
    text-decoration: none;
}

.cd-logo-home:hover,
.cd-logo-home:focus-visible {
    color: var(--cd-text);
    background: rgba(255, 255, 255, 0.03);
}

.cd-logo-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0.4rem;
    background: transparent;
    color: var(--cd-text-secondary);
    line-height: 0;
}

.cd-logo-menu-btn::after {
    display: none !important;
    content: none !important;
}

.cd-logo-menu-btn:hover,
.cd-logo-menu-btn:focus-visible,
.cd-logo-menu-btn[aria-expanded="true"] {
    color: var(--cd-text);
    background: rgba(255, 255, 255, 0.04);
}

.cd-logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.7rem;
    background: linear-gradient(135deg, var(--cd-accent), #4f46e5);
    color: #fff;
}

.cd-logo-mark svg {
    width: 1rem;
    height: 1rem;
}

.cd-logo-text {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1;
}

.cd-logo-caret,
.cd-logo-menu-btn svg {
    width: 14px !important;
    height: 14px !important;
    stroke-width: 1.75;
    color: inherit;
    display: block;
}

.cd-app-menu {
    width: min(340px, 92vw);
    max-height: min(80vh, 40rem);
    overflow-y: auto;
    padding: 0.65rem 0.7rem;
    margin-top: 0.5rem !important;
    background: var(--cd-surface) !important;
    border: 1px solid var(--cd-border) !important;
    border-radius: var(--cd-radius) !important;
    box-shadow: var(--cd-shadow);
}

.cd-app-menu-section + .cd-app-menu-section,
.cd-app-menu .cd-nav-section + .cd-nav-section {
    margin-top: 0.65rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--cd-border);
}

.cd-app-menu-label,
.cd-nav-label {
    padding: 0.15rem 0.65rem 0.45rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--cd-text-secondary);
}

.cd-app-rail {
    position: sticky;
    top: 4.5rem;
    flex: 0 0 14rem;
    width: 14rem;
    max-height: calc(100vh - 5rem);
    overflow-y: auto;
    margin-right: 0.15rem;
    padding: 1.15rem 0.85rem 2rem 0;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.cd-app-rail .cd-nav-section + .cd-nav-section {
    margin-top: 0.85rem;
}

.cd-app-rail .cd-nav-label {
    padding: 0 0.45rem 0.35rem;
}

.cd-app-rail .cd-nav-link {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.38rem 0.45rem;
    border-radius: 0.55rem;
    color: var(--cd-text);
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
}

.cd-app-rail .cd-nav-link:hover,
.cd-app-rail .cd-nav-link:focus-visible {
    color: var(--cd-text);
    background: rgba(255, 255, 255, 0.05);
}

.cd-app-rail .cd-nav-link.is-active {
    background: rgba(124, 92, 255, 0.16);
    color: #EDE9FE;
}

.cd-app-rail .cd-nav-link svg {
    width: 0.95rem;
    height: 0.95rem;
    flex-shrink: 0;
    color: var(--cd-text-secondary);
}

.cd-app-rail .cd-nav-link.is-active svg {
    color: #C4B5FD;
}

.cd-app-menu .cd-nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.65rem;
    border-radius: 0.7rem;
    color: var(--cd-text);
    font-size: 0.9rem;
}

.cd-app-menu .cd-nav-link:hover,
.cd-app-menu .cd-nav-link:focus-visible,
.cd-app-menu .cd-nav-link.is-active {
    color: var(--cd-text);
    background: rgba(255, 255, 255, 0.05);
}

.cd-app-menu .cd-nav-link svg {
    width: 1rem;
    height: 1rem;
    color: var(--cd-text-secondary);
}

.cd-app-menu .dropdown-item,
.cd-dropdown-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.65rem;
    border-radius: 0.7rem;
    color: var(--cd-text);
    font-size: 0.9rem;
}

.cd-app-menu .dropdown-item svg,
.cd-dropdown-menu .dropdown-item svg {
    width: 1rem;
    height: 1rem;
    color: var(--cd-text-secondary);
}

.cd-app-menu .dropdown-item:hover,
.cd-app-menu .dropdown-item:focus,
.cd-dropdown-menu .dropdown-item:hover,
.cd-dropdown-menu .dropdown-item:focus {
    background: rgba(124, 92, 255, 0.12);
    color: var(--cd-text);
}

.cd-dropdown-menu {
    background: var(--cd-surface) !important;
    border: 1px solid var(--cd-border) !important;
    border-radius: 12px !important;
    padding: 0.4rem;
    box-shadow: var(--cd-shadow);
}

.cd-search {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    padding: 0.55rem 0.9rem;
    border: 1px solid var(--cd-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--cd-text-secondary);
}

.cd-search svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.cd-search input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--cd-text);
    font-size: 0.9rem;
}

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

.cd-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    border: 1px solid var(--cd-border);
    border-radius: 999px;
    background: transparent;
    color: var(--cd-text-secondary);
}

.cd-icon-btn svg {
    width: 1.05rem;
    height: 1.05rem;
}

.cd-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 999px;
    background: rgba(124, 92, 255, 0.2);
    border: 1px solid rgba(124, 92, 255, 0.35);
    color: var(--cd-text);
    font-size: 0.75rem;
    font-weight: 600;
}

.cd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 2.5rem;
    padding: 0.55rem 1rem;
    border-radius: 0.8rem;
    border: 1px solid transparent;
    font-size: var(--cd-type-body);
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
}

.cd-btn svg {
    width: 1rem;
    height: 1rem;
}

.cd-btn-sm {
    min-height: 2.25rem;
    padding: 0.45rem 0.85rem;
    font-size: 0.875rem;
}

.cd-btn-accent {
    background: var(--cd-accent);
    border-color: var(--cd-accent);
    color: #fff;
}

.cd-btn-accent:hover,
.cd-btn-accent:focus-visible {
    background: var(--cd-accent-hover);
    border-color: var(--cd-accent-hover);
    color: #fff;
}

.cd-btn-ghost {
    background: transparent;
    border-color: var(--cd-border);
    color: var(--cd-text-secondary);
}

.cd-btn-ghost:hover,
.cd-btn-ghost:focus-visible {
    color: var(--cd-text);
    border-color: #2b3442;
    background: rgba(255, 255, 255, 0.03);
}

.cd-btn.dropdown-toggle::after {
    display: none;
}

/* ---- Home layout ---- */

.cd-home-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.7fr);
    gap: 1.5rem;
    align-items: start;
}

.cd-home {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.cd-home-header {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    max-width: 40rem;
}

.cd-home-header .cd-list-heading {
    font-size: 1.2rem;
}

.cd-home-header .cd-list-lede {
    margin: 0;
    font-size: 0.82rem;
}

.cd-home-intro {
    max-width: 40rem;
}

.cd-home-heading {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.25;
    color: #F5F5F7;
}

.cd-home-lede {
    margin: 0.25rem 0 0;
    font-size: 0.85rem;
    color: #9AA3B2;
}

.cd-home-shell {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    align-items: stretch;
}

.cd-home-lower {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(14rem, 16rem);
    gap: 0.7rem;
    align-items: start;
}

.cd-home-lower .cd-home-chart {
    grid-column: 1;
}

.cd-home-lower .cd-home-resume {
    grid-column: 2;
}

.cd-home-lower:not(:has(.cd-home-chart)) .cd-home-resume {
    grid-column: 2;
}

.cd-home-capture,
.cd-home-start,
.cd-home-attention,
.cd-home-today,
.cd-home-chart,
.cd-home-resume,
.cd-home-recent,
.cd-home-work {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-width: 0;
}

.cd-home-panel {
    padding: 0.7rem 0.8rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0.85rem;
    background: rgba(20, 25, 34, 0.58);
}

.cd-home-panel-priority {
    border-color: rgba(124, 92, 255, 0.22);
    background: rgba(24, 28, 40, 0.72);
}

.cd-home-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.cd-home-panel-title {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #9AA3B2;
}

.cd-home-panel-hint {
    margin: 0.2rem 0 0;
    font-size: 0.78rem;
    color: #9AA3B2;
}

.cd-home-view-all {
    font-size: 0.78rem;
    color: #C5CAD3;
    text-decoration: none;
    white-space: nowrap;
}

.cd-home-view-all:hover {
    color: #F5F5F7;
    text-decoration: underline;
}

.cd-home-rows {
    list-style: none;
    margin: 0.65rem 0 0;
    padding: 0;
}

.cd-home-rows li + li {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.cd-home-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.1rem;
    color: inherit;
    text-decoration: none;
}

.cd-home-row:hover {
    color: inherit;
}

.cd-home-row:hover .cd-home-row-label {
    text-decoration: underline;
}

.cd-home-row-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 0.45rem;
    background: rgba(124, 92, 255, 0.16);
    color: #C4B5FD;
    flex-shrink: 0;
}

.cd-home-row-icon[data-icon="tasks"],
.cd-home-row-icon[data-icon="pending_tasks"] {
    background: rgba(34, 197, 94, 0.14);
    color: #86EFAC;
}

.cd-home-row-icon[data-icon="contacts"] {
    background: rgba(59, 130, 246, 0.16);
    color: #93C5FD;
}

.cd-home-row-icon[data-icon="purchases"] {
    background: rgba(245, 158, 11, 0.16);
    color: #FCD34D;
}

.cd-home-row-icon[data-icon="documents"],
.cd-home-row-icon[data-icon="draft_vouchers"] {
    background: rgba(248, 113, 113, 0.14);
    color: #FCA5A5;
}

.cd-home-row-icon svg {
    width: 0.95rem;
    height: 0.95rem;
}

.cd-home-row-copy {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.08rem;
}

.cd-home-row-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #F5F5F7;
}

.cd-home-row-hint,
.cd-home-row-meta {
    font-size: 0.75rem;
    color: #9AA3B2;
}

.cd-home-row-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.cd-home-row-chevron {
    color: #6E7681;
    font-size: 1.1rem;
    line-height: 1;
}

.cd-home-badge {
    margin-left: auto;
    min-width: 1.25rem;
    padding: 0.08rem 0.4rem;
    border-radius: 999px;
    background: rgba(239, 68, 68, 0.18);
    color: #FCA5A5;
    font-size: 0.72rem;
    font-weight: 700;
    text-align: center;
}

.cd-home-tag {
    display: inline-flex;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: #C5CAD3;
    font-size: 0.68rem;
}

.cd-home-time {
    font-size: 0.72rem;
    color: #9AA3B2;
    white-space: nowrap;
}

.cd-home-empty {
    margin: 0.7rem 0 0;
    font-size: 0.85rem;
    color: #9AA3B2;
}

.cd-home-workflow-queue {
    margin-top: 0.75rem;
    padding-top: 0.65rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.cd-home-chart .cd-home-wf-rows {
    margin-top: 0.45rem;
}

.cd-home-workflow-queue .cd-home-panel-title {
    margin-bottom: 0.35rem;
}

.cd-home-wf-rows {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cd-home-wf-row {
    display: grid;
    grid-template-columns: minmax(0, 7.5rem) minmax(0, 1fr) auto;
    gap: 0.45rem;
    align-items: center;
    padding: 0.28rem 0;
    color: inherit;
    text-decoration: none;
}

.cd-home-wf-row:hover {
    color: inherit;
}

.cd-home-wf-row:hover .cd-home-wf-label {
    text-decoration: underline;
}

.cd-home-wf-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #F5F5F7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cd-home-wf-track {
    display: block;
    height: 0.4rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.cd-home-wf-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: rgba(124, 92, 255, 0.72);
}

.cd-home-wf-count {
    min-width: 1.25rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: #C5CAD3;
    text-align: right;
}

.cd-home-new-event {
    display: inline-block;
    margin-top: 0.7rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #C4B5FD;
    text-decoration: none;
}

.cd-home-new-event:hover {
    color: #F5F5F7;
    text-decoration: underline;
}

.cd-home-new-event-label {
    font-size: 0.92rem;
    font-weight: 600;
}

.cd-home-new-event-hint {
    font-size: 0.75rem;
    color: rgba(245, 245, 247, 0.78);
}

.cd-event-card {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

.cd-event-card-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 2rem;
}

.cd-event-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 0.9rem;
    background: rgba(124, 92, 255, 0.14);
    color: var(--cd-accent);
    flex-shrink: 0;
}

.cd-event-card-icon svg {
    width: 1.35rem;
    height: 1.35rem;
}

.cd-field {
    margin-bottom: 1.15rem;
}

.cd-label {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--cd-text-secondary);
}

.cd-input,
.cd-select,
.cd-app .form-control,
.cd-app .form-select {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.7rem 0.9rem;
    border: 1px solid #252d38;
    border-radius: var(--cd-radius-sm);
    background: #141922;
    color: var(--cd-text);
    font-size: var(--cd-type-body);
    box-shadow: none;
    backdrop-filter: none;
}

.cd-app textarea.cd-input,
.cd-app textarea.form-control {
    min-height: 7rem;
    resize: vertical;
    line-height: 1.5;
}

/* Suggestion approval: compact multiline fields (~60–80px), still resizable */
body.cd-suggestion-detail textarea.form-control,
body.cd-suggestion-detail textarea.cd-input {
    min-height: 60px;
    height: 72px;
    resize: vertical;
    line-height: 1.45;
}

.cd-home-page .cd-event-card textarea.cd-input,
.cd-home-page .cd-event-card #id_note {
    min-height: 80px;
    height: 84px;
    max-height: 120px;
}

.cd-input:focus,
.cd-select:focus,
.cd-app .form-control:focus,
.cd-app .form-select:focus {
    border-color: rgba(124, 92, 255, 0.7);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.18);
    background: #171e27;
    color: var(--cd-text);
}

.cd-app .form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239AA3B2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    background-size: 1rem;
    padding-right: 2.4rem;
}

.cd-app .form-control::placeholder {
    color: #6b7382;
}

.cd-field-error,
.cd-form-errors {
    margin-top: 0.35rem;
    color: var(--cd-danger);
    font-size: var(--cd-type-meta);
}

.cd-attach-block {
    margin: 1.5rem 0 0;
    padding-top: 1.25rem;
    border-top: 1px solid var(--cd-border);
}

.cd-attach-list {
    list-style: none;
    margin: 0.85rem 0;
    padding: 0;
    display: grid;
    gap: 0.45rem;
}

.cd-attach-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--cd-border);
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    color: var(--cd-text-secondary);
    font-size: 0.85rem;
}

.cd-attach-item svg {
    width: 0.95rem;
    height: 0.95rem;
}

.cd-attach-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--cd-text);
}

.cd-attach-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--cd-text-secondary);
}

.cd-event-card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.75rem;
}

.cd-panel {
    padding: 1.35rem 1.35rem 1.15rem;
}

.cd-panel + .cd-panel {
    margin-top: 1rem;
}

.cd-overview-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cd-overview-list li + li {
    margin-top: 0.35rem;
}

.cd-overview-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem 0.75rem;
    border-radius: 0.8rem;
    color: var(--cd-text);
}

.cd-overview-list a:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--cd-text);
}

.cd-overview-label {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--cd-text-secondary);
    font-size: 0.9rem;
}

.cd-overview-label svg {
    width: 1rem;
    height: 1rem;
    color: var(--cd-accent);
}

.cd-overview-count {
    font-weight: 600;
    color: var(--cd-text);
}

.cd-activity-feed {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cd-activity-feed li + li {
    border-top: 1px solid var(--cd-border);
}

.cd-activity-row {
    display: flex;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 0.85rem 0;
    color: inherit;
}

.cd-activity-row:hover .cd-activity-title {
    color: var(--cd-accent);
}

.cd-activity-main {
    min-width: 0;
    display: grid;
    gap: 0.15rem;
}

.cd-activity-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--cd-text);
}

.cd-activity-detail,
.cd-activity-time {
    font-size: var(--cd-type-meta);
    color: var(--cd-text-secondary);
}

.cd-activity-time {
    white-space: nowrap;
}

.cd-footer {
    display: none;
}

.alert {
    border-radius: 12px;
    border: 1px solid var(--cd-border);
    background: var(--cd-surface);
    color: var(--cd-text);
}

.autocomplete-wrapper {
    position: relative;
}

.autocomplete-results {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    z-index: 1050;
    max-height: 220px;
    overflow-y: auto;
    border-radius: 10px;
    border: 1px solid var(--cd-border);
    background: var(--cd-surface);
    box-shadow: var(--cd-shadow);
}

.autocomplete-results .list-group-item {
    background: transparent;
    border-color: var(--cd-border);
    color: var(--cd-text);
}

.autocomplete-results .list-group-item:hover,
.autocomplete-results .list-group-item.active {
    background: rgba(124, 92, 255, 0.12);
}

.record-resolver-similar-item {
    border-radius: 8px;
    padding: 0.5rem 0.75rem !important;
    border: 1px solid transparent;
}

.record-resolver-similar-item:hover {
    background: rgba(124, 92, 255, 0.08);
}

.record-resolver-similar-item-active {
    border-color: rgba(124, 92, 255, 0.45);
    background: rgba(124, 92, 255, 0.12);
}

.record-resolver-selected {
    border-color: rgba(56, 189, 248, 0.45) !important;
    background: rgba(56, 189, 248, 0.08);
}

.product-item-approval-form {
    overflow: visible;
    position: relative;
    z-index: 2;
}

.cd-extracted-name .payload-preview {
    margin-bottom: 0;
}

.product-item-resolver-column {
    position: sticky;
    top: 1rem;
    overflow: visible;
}

.product-item-resolver-card,
.product-item-resolver-card > .card-body {
    overflow: visible;
}

.suggestion-workflow-layout {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.suggestion-workflow-layout > .suggestion-workflow-primary {
    position: relative;
    z-index: 2;
}

.suggestion-secondary-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.suggestion-reject-card {
    max-width: 42rem;
}

.product-item-similar-list {
    max-height: 220px;
    overflow-y: auto;
}

.product-intent-banner {
    border: 1px solid var(--cd-border);
}

.product-intent-create {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.35);
}

.product-intent-update {
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.4);
}

body.cd-suggestion-detail .product-item-approval-form .form-label {
    margin-bottom: 0.25rem;
}

body.cd-suggestion-detail .product-item-approval-form .mb-3 {
    margin-bottom: 0.75rem !important;
}

.card {
    background: rgba(20, 25, 32, 0.55);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--cd-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.30);
    color: var(--cd-text);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--cd-text);
}

.table {
    color: var(--cd-text);
    --bs-table-bg: #141922;
    --bs-table-color: var(--cd-text);
    --bs-table-border-color: #252d38;
    --bs-table-striped-bg: #171e27;
    background-color: #141922;
}

.btn {
    font-size: var(--cd-type-body);
    font-weight: 500;
}

.btn-primary {
    --bs-btn-bg: var(--cd-accent);
    --bs-btn-border-color: var(--cd-accent);
    --bs-btn-hover-bg: var(--cd-accent-hover);
    --bs-btn-hover-border-color: var(--cd-accent-hover);
    --bs-btn-active-bg: #5b3fd6;
    --bs-btn-active-border-color: #5b3fd6;
}

/* ---- App-wide glass (cards) + opaque controls ---- */

@media (max-width: 991.98px) {
    body.cd-app {
        background-attachment: scroll;
    }
}

/* Home-only: compact Description field */
body.cd-home-page .cd-event-card textarea.cd-input,
body.cd-home-page .cd-event-card #id_note {
    min-height: 80px;
    height: 84px;
    max-height: 120px;
}

/* ---- List page row hover ---- */

.cd-app .table {
    --bs-table-hover-bg: rgba(124, 92, 255, 0.14);
    --bs-table-hover-color: #F5F5F7;
}

.cd-app .table-hover > tbody > tr {
    cursor: pointer;
    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        transform 0.12s ease,
        box-shadow 0.18s ease;
}

.cd-app .table-hover > tbody > tr > * {
    background-color: transparent;
    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease,
        box-shadow 0.18s ease;
    border-bottom-color: var(--cd-border);
}

.cd-app .table-hover > tbody > tr:hover {
    --bs-table-bg-type: rgba(124, 92, 255, 0.14);
    --bs-table-color-state: #F5F5F7;
    background-color: rgba(124, 92, 255, 0.14) !important;
    transform: translateY(-1px);
}

.cd-app .table-hover > tbody > tr:hover > * {
    --bs-table-bg-state: rgba(124, 92, 255, 0.14);
    --bs-table-color-state: #F5F5F7;
    background-color: rgba(124, 92, 255, 0.14) !important;
    color: #F5F5F7 !important;
    border-color: rgba(124, 92, 255, 0.45) !important;
    box-shadow: inset 0 0 0 1px rgba(124, 92, 255, 0.35);
}

.cd-app .card .table-responsive {
    border-radius: inherit;
}

/* ---- List page section spacing + readability ---- */

.cd-list-page {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.cd-list-page .cd-list-section,
.cd-list-page > .card,
.cd-list-page > form.card {
    margin-bottom: 0 !important;
}

.cd-list-title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.25;
    color: #F5F5F7;
}

.cd-list-subtitle {
    color: #9AA3B2;
    font-size: 0.9rem;
    margin: 0;
}

.cd-list-page .text-muted {
    color: #9AA3B2 !important;
}

.cd-active-filters-card .cd-active-filters-label {
    display: inline-block;
    margin-right: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #F5F5F7;
}

.cd-active-filters-card .cd-active-filters-empty {
    font-size: 0.85rem;
    color: #9AA3B2;
}

.cd-filter-chip {
    display: inline-flex;
    align-items: center;
    margin: 0.15rem 0.25rem 0.15rem 0;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(124, 92, 255, 0.35);
    background: rgba(124, 92, 255, 0.14);
    color: #F5F5F7;
    font-size: 0.75rem;
    font-weight: 500;
}

/* ---- Hub pages (Master Data / System) ---- */

.cd-hub-section {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.cd-hub-section-header {
    padding: 0 0.15rem;
}

.cd-hub-section-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #F5F5F7;
}

.cd-hub-section-desc {
    margin: 0.25rem 0 0;
    font-size: 0.875rem;
    color: #9AA3B2;
}

.cd-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.cd-hub-card {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    min-height: 180px;
    padding: 1.25rem 1.35rem;
    border-radius: 1rem;
    text-decoration: none;
    color: #F5F5F7;
    transition:
        transform 0.16s ease,
        border-color 0.16s ease,
        box-shadow 0.16s ease,
        background 0.16s ease;
}

a.cd-hub-card:hover {
    transform: translateY(-2px);
    border-color: rgba(124, 92, 255, 0.45) !important;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
    color: #F5F5F7;
}

.cd-hub-card.is-disabled {
    opacity: 0.58;
    cursor: not-allowed;
}

.cd-hub-card-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(124, 92, 255, 0.16);
    color: #B6A4FF;
    flex-shrink: 0;
}

.cd-hub-card-icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

.cd-hub-card-body {
    flex: 1;
}

.cd-hub-card-title {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #F5F5F7;
}

.cd-hub-card-desc {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.45;
    color: #9AA3B2;
}

.cd-hub-card-action {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: auto;
    font-size: 0.8rem;
    font-weight: 600;
    color: #B6A4FF;
}

.cd-hub-card-action svg {
    width: 0.95rem;
    height: 0.95rem;
}

.cd-hub-work {
    max-width: 72rem;
}

.cd-hub-work .cd-hub-section + .cd-hub-section {
    margin-top: 1.25rem;
}

.cd-hub-card-badge {
    align-self: flex-start;
    margin-top: auto;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: #9AA3B2;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

@media (min-width: 992px) {
    .cd-logo-menu-btn {
        display: none;
    }
}

@media (max-width: 991.98px) {
    .cd-home,
    .cd-home-shell {
        max-width: none;
    }

    .cd-home-layout,
    .cd-home-shell,
    .cd-home-lower {
        grid-template-columns: 1fr;
    }

    .cd-home-lower .cd-home-chart,
    .cd-home-lower .cd-home-resume {
        grid-column: auto;
    }

    .cd-app-rail {
        display: none;
    }

    .cd-app-body {
        gap: 0;
    }

    .cd-topnav-inner {
        grid-template-columns: 1fr auto;
    }

    .cd-topnav-center {
        display: none !important;
    }
}

@media (max-width: 575.98px) {
    :root {
        --cd-page-gutter: 1rem;
    }

    .cd-main {
        padding-top: 1.25rem;
    }

    .cd-event-card {
        padding: 1.25rem;
    }

    .cd-event-card-actions {
        flex-direction: column-reverse;
    }

    .cd-event-card-actions .cd-btn {
        width: 100%;
    }

    .cd-logo-text {
        display: none;
    }
}

/* ---- UX-008 List workspace (Tasks reference) ---- */

.cd-list-page.cd-list-workspace {
    gap: 0.75rem;
}

.cd-list-workspace-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    padding: 0.15rem 0.1rem 0;
}

.cd-list-workspace-header-actions {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.cd-list-workspace-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: #F5F5F7;
}

.cd-list-workspace-subtitle {
    margin: 0.2rem 0 0;
    font-size: 0.85rem;
    color: #9AA3B2;
    max-width: 42rem;
}

.cd-list-workspace-toolbar {
    /* Keep dropdowns above following table cards without huge z-index. */
    position: relative;
    z-index: 2;
    overflow: visible;
    padding: 0.65rem 0.85rem;
    border-radius: 0.85rem;
}

.cd-list-workspace-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin: -0.15rem 0 0;
    padding: 0 0.1rem;
}

.cd-list-workspace-toolbar-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.cd-list-workspace-search {
    flex: 1 1 14rem;
    min-width: 11rem;
}

.cd-list-workspace-control {
    flex: 0 1 9.5rem;
    min-width: 7.5rem;
}

.cd-list-workspace-actions {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.cd-list-workspace-count {
    margin-left: auto;
    flex: 0 0 auto;
}

.cd-list-workspace-count-text {
    font-size: 0.8rem;
    color: #9AA3B2;
    white-space: nowrap;
}

.cd-list-workspace-more {
    position: relative;
}

.cd-list-workspace-more-menu {
    min-width: 14rem;
    z-index: 1080;
}

.cd-list-workspace-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    max-width: 100%;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    border: 1px solid rgba(124, 92, 255, 0.35);
    background: rgba(124, 92, 255, 0.14);
    color: #F5F5F7;
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.3;
    text-decoration: none;
}

a.cd-list-workspace-chip:hover,
button.cd-list-workspace-chip:hover {
    background: rgba(124, 92, 255, 0.24);
    color: #F5F5F7;
    border-color: rgba(124, 92, 255, 0.5);
}

.cd-list-workspace-chip-x {
    font-size: 0.95rem;
    line-height: 1;
    opacity: 0.8;
}

.cd-list-workspace-chip-more {
    cursor: pointer;
}

.cd-list-workspace-table-card {
    position: relative;
    z-index: 1;
    overflow: visible;
}

.cd-list-workspace-table-card > .table-responsive {
    overflow-x: auto;
    overflow-y: visible;
}

.cd-list-workspace-table > :not(caption) > * > * {
    padding: 0.55rem 0.75rem;
    vertical-align: middle;
}

.cd-list-workspace-table thead th {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #9AA3B2;
    background: rgba(255, 255, 255, 0.03);
    border-bottom-color: rgba(255, 255, 255, 0.08);
    white-space: nowrap;
}

.cd-list-workspace-primary {
    font-size: 0.92rem;
    font-weight: 500;
    color: #F5F5F7;
    line-height: 1.35;
}

.cd-list-workspace-secondary {
    font-size: 0.82rem;
    color: #9AA3B2;
    white-space: nowrap;
}

.cd-list-workspace-pagination {
    margin-top: 0.25rem;
}

@media (max-width: 767.98px) {
    .cd-list-workspace-search {
        flex: 1 1 100%;
    }

    .cd-list-workspace-control {
        flex: 1 1 calc(50% - 0.5rem);
        min-width: 0;
    }

    .cd-list-workspace-actions {
        width: 100%;
    }

    .cd-list-workspace-count {
        margin-left: 0;
        width: 100%;
    }
}

/* ---- A1.3 List pattern (Event List is the first reference) ---- */

.cd-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cd-list-shell {
    display: grid;
    grid-template-columns: minmax(16.5rem, 19.5rem) minmax(0, 1fr);
    gap: 1.15rem 1.35rem;
    align-items: start;
}

.cd-list-control {
    position: sticky;
    top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    min-width: 0;
    padding: 0.85rem 0.9rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0.85rem;
    background: rgba(20, 25, 34, 0.58);
}

.cd-list-identity {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.cd-list-heading {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: #F5F5F7;
}

.cd-list-lede {
    margin: 0;
    font-size: 0.82rem;
    color: #9AA3B2;
}

.cd-list-result-badge {
    align-self: flex-start;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: rgba(124, 92, 255, 0.18);
    border: 1px solid rgba(124, 92, 255, 0.28);
    font-size: 0.72rem;
    font-weight: 600;
    color: #F5F5F7;
}

.cd-list-control-label,
.cd-list-control-title {
    display: block;
    margin: 0 0 0.3rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #9AA3B2;
}

.cd-list-search-hint {
    margin: 0.3rem 0 0;
    font-size: 0.72rem;
    color: #9AA3B2;
}

.cd-list-control-form {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.cd-list-control-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.cd-list-control-title {
    margin: 0;
}

.cd-list-date-range {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 0.3rem;
    align-items: center;
}

.cd-list-date-sep {
    color: #9AA3B2;
    font-size: 0.75rem;
}

.cd-list-columns {
    display: grid;
    gap: 0.28rem;
}

.cd-list-column-option {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: #F5F5F7;
}

.cd-list-column-optional {
    margin-left: auto;
    font-size: 0.68rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #9AA3B2;
}

.cd-list-control-actions {
    display: flex;
    gap: 0.45rem;
    margin-top: 0.25rem;
}

.cd-list-control-actions .btn {
    flex: 1 1 auto;
}

.cd-list-data {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.cd-list-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 0.75rem;
    padding: 0.45rem 0.15rem;
    background: transparent;
    border: 0;
}

.cd-list-toolbar-main {
    flex: 1 1 12rem;
    min-width: 0;
}

.cd-list-toolbar-tools {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-left: auto;
}

.cd-list-sort {
    width: 9.5rem;
}

.cd-list-clear-all {
    margin-left: 0.15rem;
    font-size: 0.75rem;
    color: #9AA3B2;
    text-decoration: none;
}

.cd-list-clear-all:hover {
    color: #F5F5F7;
    text-decoration: underline;
}

.cd-list-empty {
    padding: 1.25rem 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0.85rem;
    background: rgba(20, 25, 34, 0.4);
    color: #9AA3B2;
    font-size: 0.9rem;
}

.cd-list-data-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
}

.cd-list-row {
    cursor: pointer;
}

.cd-list-row-link {
    color: inherit;
    text-decoration: none;
}

.cd-list-row-link:hover {
    color: inherit;
}

.cd-list-row:hover td {
    background: rgba(255, 255, 255, 0.04);
}

.cd-list-workspace-secondary {
    max-width: 18rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 991.98px) {
    .cd-list-shell {
        grid-template-columns: 1fr;
    }

    .cd-list-control {
        position: static;
    }
}

.cd-record-spine {
    gap: 0;
}

.cd-fact-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0 0 0.85rem;
}

.cd-fact-group + .cd-fact-group {
    padding-top: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.cd-fact-group:last-child {
    padding-bottom: 0;
}

.cd-fact-group-identity {
    gap: 0.4rem;
}

.cd-record-identity-type {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.35;
    color: #F5F5F7;
}

.cd-record-identity-date {
    font-weight: 500;
    color: #C5CAD3;
}

.cd-fact-list {
    display: grid;
    gap: 0.5rem;
    margin: 0;
}

.cd-fact {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
}

.cd-fact dt,
.cd-record-spine .cd-list-control-title {
    margin: 0;
}

.cd-fact dt {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #9AA3B2;
}

.cd-fact dd,
.cd-fact-value {
    margin: 0;
    font-size: 0.85rem;
    color: #F5F5F7;
}

.cd-fact a,
.cd-fact-value a {
    color: #F5F5F7;
    text-decoration: none;
}

.cd-fact a:hover,
.cd-fact-value a:hover {
    text-decoration: underline;
}

.cd-record-work {
    align-self: start;
    width: 100%;
    max-width: 56rem;
}

.cd-record-work .cd-action-toolbar {
    padding-top: 0;
}

.cd-record-work .cd-page-work-block,
.cd-record-note {
    max-width: 40rem;
}

.cd-record-work form .cd-page-work-block {
    max-width: 44rem;
}

.cd-record-related-list {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.85rem;
    color: #C5CAD3;
}

.cd-record-related-list li {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.15rem 0;
}

.cd-record-related-list span {
    color: #9AA3B2;
}

.cd-process-chain {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cd-process-step {
    display: flex;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.28rem 0;
    font-size: 0.85rem;
}

.cd-process-step + .cd-process-step {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.cd-process-label {
    color: #C5CAD3;
}

.cd-process-label a {
    color: inherit;
    text-decoration: none;
}

.cd-process-label a:hover {
    color: #F5F5F7;
    text-decoration: underline;
}

.cd-process-step.is-current .cd-process-label {
    font-weight: 600;
    color: #F5F5F7;
}

.cd-process-meta {
    color: #9AA3B2;
    text-align: right;
    white-space: nowrap;
}

.cd-record-work.cd-purchase-work {
    max-width: 60rem;
}

.cd-record-delete {
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: #f0a0a0;
    text-decoration: none;
}

.cd-record-delete:hover {
    color: #ffb4b4;
    text-decoration: underline;
}

.cd-action-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem 0.75rem;
    padding: 0 0 0.55rem;
    margin: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cd-action-toolbar-nav {
    min-width: 0;
}

.cd-action-toolbar .cd-page-crumb {
    margin: 0;
}

.cd-action-toolbar-actions {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-left: auto;
}

.cd-action-toolbar-actions:empty {
    display: none;
}

.cd-record-note {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.45;
    color: #F5F5F7;
}

.cd-record-work-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
}

.cd-record-detail {
    display: grid;
    grid-template-columns: 7.5rem minmax(0, 1fr);
    gap: 0.4rem 1.1rem;
    margin: 0;
    font-size: 0.9rem;
}

.cd-record-detail dt {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #9AA3B2;
    padding-top: 0.12rem;
}

.cd-record-detail dd {
    margin: 0;
    color: #F5F5F7;
}

.cd-record-detail a {
    color: #F5F5F7;
    text-decoration: none;
}

.cd-record-detail a:hover {
    text-decoration: underline;
}

.cd-record-related-work {
    width: max-content;
    max-width: min(36rem, 100%);
    padding-top: 0.55rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.cd-record-related-work .table-responsive {
    width: max-content;
    max-width: 100%;
}

.cd-record-related-table {
    width: auto;
    max-width: 100%;
    font-size: 0.82rem;
}

.cd-record-related-table th,
.cd-record-related-table td {
    padding: 0.28rem 0.4rem;
    border-color: rgba(255, 255, 255, 0.06);
}

.cd-record-related-table td:nth-child(2) {
    max-width: 16rem;
    overflow-wrap: anywhere;
}

.cd-record .cd-page-work-block {
    padding: 0;
}

.cd-record .cd-page-work-actions {
    justify-content: flex-start;
}

/* —— Purchase Create (from Document) compact lines —— */
.cd-purchase-create-lines {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cd-purchase-create-line {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--cd-radius-sm);
    background: rgba(255, 255, 255, 0.03);
    padding: 0.55rem 0.75rem;
    transition: opacity 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.cd-purchase-create-line.is-excluded {
    opacity: 0.55;
    border-style: dashed;
    background: rgba(239, 68, 68, 0.06);
}

.cd-purchase-create-line.is-included {
    border-color: rgba(34, 197, 94, 0.35);
}

.cd-purchase-create-line-main {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.9fr) auto;
    gap: 0.75rem 1rem;
    align-items: center;
}

.cd-purchase-create-line-id {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    min-width: 0;
}

.cd-purchase-create-line-title {
    font-weight: 600;
    font-size: 0.92rem;
    line-height: 1.3;
}

.cd-purchase-create-line-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    white-space: nowrap;
}

.cd-purchase-create-line-include .form-check-inline {
    margin-right: 0.75rem;
}

.cd-purchase-create-line-product {
    margin-top: 0.4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 0.35rem;
}

.cd-purchase-create-line-product > summary {
    cursor: pointer;
    list-style: none;
    font-size: 0.82rem;
    color: var(--cd-text-secondary);
    user-select: none;
}

.cd-purchase-create-line-product > summary::-webkit-details-marker {
    display: none;
}

.cd-purchase-create-line-product > summary::before {
    content: "▸ ";
    color: var(--cd-accent);
}

.cd-purchase-create-line-product[open] > summary::before {
    content: "▾ ";
}

.cd-purchase-create-line-product-body {
    padding: 0.5rem 0 0.15rem;
}

.cd-purchase-create-line.is-excluded .cd-purchase-create-line-product {
    pointer-events: none;
    opacity: 0.45;
}

@media (max-width: 991.98px) {
    .cd-purchase-create-line-main {
        grid-template-columns: 1fr;
        gap: 0.4rem;
    }
}

/* —— Purchase Detail —— */
.cd-purchase-detail-page {
    gap: 0.75rem;
}

.cd-purchase-detail-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #9AA3B2;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cd-purchase-detail-table td.is-product {
    min-width: 11rem;
    vertical-align: top;
}

.cd-purchase-detail-desc {
    margin-top: 0.1rem;
    color: #9AA3B2;
    font-size: 0.78rem;
    line-height: 1.35;
}

.cd-purchase-detail-eq {
    margin-top: 0.15rem;
    color: #9AA3B2;
    font-size: 0.78rem;
    line-height: 1.35;
}

.cd-purchase-detail-item-amount {
    color: #F5F5F7;
    font-weight: 600;
}

.cd-purchase-detail-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem 0.85rem;
    padding: 0.55rem 0.75rem;
}

.cd-purchase-detail-kv dt {
    color: #9AA3B2;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.cd-purchase-detail-kv dd {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.35;
    word-break: break-word;
}

.cd-purchase-detail-secondary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.cd-purchase-detail-panel {
    padding: 0.55rem 0.75rem;
    font-size: 0.88rem;
}

.cd-purchase-detail-workflow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.55rem;
}

.cd-purchase-detail-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.cd-purchase-detail-thumb {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    width: 4.75rem;
    text-decoration: none;
    color: #9AA3B2;
    font-size: 0.68rem;
}

.cd-purchase-detail-thumb img {
    width: 4.75rem;
    height: 4.75rem;
    object-fit: cover;
    border-radius: var(--cd-radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cd-purchase-line-amount[readonly] {
    background-color: rgba(255, 255, 255, 0.04);
    pointer-events: none;
}

.cd-purchase-amount-summary {
    max-width: 18rem;
    margin-left: auto;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.5rem 0.75rem 0.65rem;
    font-size: 0.85rem;
}

@media (max-width: 767.98px) {
    .cd-purchase-detail-meta-grid,
    .cd-purchase-detail-secondary {
        grid-template-columns: 1fr;
    }

    .cd-purchase-detail-table thead {
        display: none;
    }

    .cd-purchase-detail-table,
    .cd-purchase-detail-table tbody,
    .cd-purchase-detail-table tr,
    .cd-purchase-detail-table td {
        display: block;
        width: 100%;
    }

    .cd-purchase-detail-table tr {
        padding: 0.55rem 0.75rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    .cd-purchase-detail-table td {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 0.75rem;
        padding: 0.12rem 0;
        border: 0;
        text-align: right;
    }

    .cd-purchase-detail-table td.is-product {
        display: block;
        text-align: left;
        padding-bottom: 0.3rem;
    }

    .cd-purchase-detail-table td::before {
        content: attr(data-label);
        color: #9AA3B2;
        font-size: 0.72rem;
        font-weight: 600;
        letter-spacing: 0.03em;
        text-transform: uppercase;
    }

    .cd-purchase-detail-table td.is-product::before {
        content: none;
    }

    .cd-purchase-amount-summary {
        max-width: none;
        margin-left: 0;
    }
}

/* —— Purchase Edit / Create form items —— */
.cd-purchase-vendor-summary {
    margin-top: 0.55rem;
    padding: 0.45rem 0.65rem;
    border-radius: var(--cd-radius-sm);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.cd-purchase-vendor-name {
    font-weight: 600;
    font-size: 0.92rem;
    line-height: 1.3;
}

.cd-purchase-vendor-meta {
    margin-top: 0.15rem;
    color: var(--cd-text-secondary);
    font-size: 0.8rem;
    line-height: 1.35;
    white-space: pre-wrap;
}

.cd-purchase-item-table {
    overflow-x: auto;
}

.cd-purchase-item-head,
.cd-purchase-item-grid {
    display: grid;
    grid-template-columns: minmax(11rem, 1.15fr) minmax(8rem, 1fr) 4.6rem 4.6rem 6.4rem 4.6rem 6.4rem 4.6rem;
    gap: 0.35rem 0.5rem;
    align-items: center;
    min-width: 52rem;
}

.cd-purchase-item-head {
    padding: 0.45rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--cd-text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.cd-purchase-items {
    display: flex;
    flex-direction: column;
}

.cd-purchase-item-row {
    padding: 0.35rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cd-purchase-item-row:last-child {
    border-bottom: none;
}

.cd-purchase-item-row.is-removed {
    display: none;
}

.cd-purchase-item-grid .form-control,
.cd-purchase-item-grid .form-select {
    width: 100%;
    min-height: 2rem;
    padding: 0.25rem 0.45rem;
    font-size: 0.875rem;
}

.cd-purchase-item-remove {
    display: flex;
    justify-content: flex-end;
}

.cd-purchase-item-remove-btn {
    padding: 0.15rem 0.4rem;
    font-size: 0.75rem;
    line-height: 1.2;
}

/* ---- A1.2 / A1.3 page split (Create User is the first reference) ---- */

.cd-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cd-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    padding: 0.15rem 0.1rem 0;
}

.cd-page-header-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: #F5F5F7;
}

.cd-page-header-subtitle {
    margin: 0.2rem 0 0;
    font-size: 0.85rem;
    color: #9AA3B2;
    max-width: 42rem;
}

.cd-page-header-actions {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.cd-page-split {
    display: grid;
    grid-template-columns: minmax(15rem, 20rem) minmax(0, 1fr);
    gap: 1.5rem 2rem;
    align-items: start;
}

.cd-page-context,
.cd-page-work {
    min-width: 0;
    padding-top: 0;
}

.cd-page-context {
    font-size: 0.85rem;
    color: #C5CAD3;
}

.cd-page-work-intro {
    margin: 0 0 1.15rem;
}

.cd-page-crumb {
    margin: 0 0 0.4rem;
    font-size: 0.875rem;
    line-height: 1.35;
    color: #9AA3B2;
}

.cd-page-crumb-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.15rem 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cd-page-crumb-list li {
    display: inline-flex;
    align-items: center;
}

.cd-page-crumb-list li:not(:last-child)::after {
    content: "/";
    margin: 0 0.4rem;
    color: #6E7681;
    font-weight: 400;
}

.cd-page-crumb a {
    color: #9AA3B2;
    text-decoration: none;
}

.cd-page-crumb a:hover,
.cd-page-crumb a:focus {
    color: #F5F5F7;
    text-decoration: underline;
}

.cd-page-crumb [aria-current="page"] {
    color: #F5F5F7;
    font-weight: 600;
}

.cd-page-work-heading {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: #F5F5F7;
}

.cd-page-work-lede {
    margin: 0.3rem 0 0;
    font-size: 0.85rem;
    color: #9AA3B2;
    max-width: 42rem;
}

.cd-page-context dl {
    margin: 0;
}

.cd-page-context dt {
    margin-top: 0.65rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #9AA3B2;
}

.cd-page-context dt:first-child {
    margin-top: 0;
}

.cd-page-context dd {
    margin: 0.15rem 0 0;
    color: #F5F5F7;
}

.cd-page-work-title {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #F5F5F7;
}

.cd-page-work-block + .cd-page-work-block {
    margin-top: 1.25rem;
    padding-top: 1.15rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.cd-page-work-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

.cd-page-work .form-check {
    min-height: 1.4rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.cd-page-work .form-check input[type="checkbox"] {
    margin-top: 0;
    flex: 0 0 auto;
}

@media (max-width: 991.98px) {
    .cd-page-split {
        grid-template-columns: 1fr;
    }
}
