/* =========================================================
   KyuPlan v1.0
   KyuFin-Inspired Theme Extensions
========================================================= */

:root {
    --kp-primary: #31c48d;
    --kp-dark: #0b1a24;
    --kp-border: #e2ece8;
    --kp-muted: #728087;
    --kp-card: #ffffff;
}

/* =========================================================
   Sidebar Branding
========================================================= */

.kf-brand-mark {
    display: flex;
    align-items: center;
    justify-content: center;
}

.kp-current-date {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border: 1px solid var(--kf-border);
    background: #fff;
    border-radius: 10px;
    color: var(--kf-text-muted);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.kp-current-date i {
    color: var(--kf-teal);
}

.kp-logout-form {
    margin: 0;
}

.kp-logout-form button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 10px;
}

.kp-footer {
    padding: 15px 26px 22px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--kf-text-muted);
    font-size: 11px;
}

/* =========================================================
   Dashboard Summary
========================================================= */

.kp-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}

.kp-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 22px;
}

.kp-dashboard-grid > .kf-card {
    min-width: 0;
}

.kp-dashboard-grid .kf-card,
.kp-table-section {
    overflow: hidden;
}

.kp-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 19px 22px;
    border-bottom: 1px solid var(--kf-border);
}

.kp-section-header h2 {
    font-size: 15px;
    line-height: 1.4;
    font-weight: 700;
    color: var(--kf-text);
    margin: 0 0 4px;
}

.kp-section-header p {
    font-size: 11px;
    color: var(--kf-text-muted);
    margin: 0;
}

.kp-section-header > i {
    font-size: 19px;
    color: var(--kf-teal);
    flex-shrink: 0;
}

.kp-section-body {
    padding: 8px 22px 18px;
}

/* =========================================================
   Allocation List
========================================================= */

.kp-allocation-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 17px 0;
    border-bottom: 1px solid var(--kf-border);
}

.kp-allocation-item:last-child {
    border-bottom: 0;
}

.kp-allocation-icon {
    width: 37px;
    height: 37px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--kf-primary-soft);
    color: var(--kf-teal);
    flex-shrink: 0;
}

.kp-allocation-info {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
    gap: 4px;
}

.kp-allocation-info strong {
    font-size: 12px;
    font-weight: 700;
    color: var(--kf-text);
}

.kp-allocation-info span {
    font-size: 11px;
    color: var(--kf-text-muted);
    line-height: 1.5;
}

.kp-allocation-info small {
    font-size: 10px;
    color: var(--kf-teal);
}

/* =========================================================
   Status Badges
========================================================= */

.kp-status,
.kp-priority {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    max-width: 100%;
    padding: 5px 9px;
    border-radius: 7px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.kp-status-not_started,
.kp-status-pending,
.kp-status-planned {
    color: #64748b;
    background: #f1f5f9;
}

.kp-status-in_development,
.kp-status-in_progress {
    color: #2563eb;
    background: #eff6ff;
}

.kp-status-testing_review {
    color: #a16207;
    background: #fef9c3;
}

.kp-status-completed {
    color: #16805b;
    background: #e9faf3;
}

.kp-status-on_hold,
.kp-status-blocked,
.kp-status-postponed {
    color: #c2410c;
    background: #fff7ed;
}

.kp-priority-critical {
    color: #b91c1c;
    background: #fee2e2;
}

.kp-priority-high {
    color: #c2410c;
    background: #ffedd5;
}

.kp-priority-medium {
    color: #a16207;
    background: #fef9c3;
}

.kp-priority-low {
    color: #64748b;
    background: #f1f5f9;
}

.kp-muted {
    color: var(--kf-text-muted);
    font-size: 11px;
}

/* =========================================================
   Progress Bars
========================================================= */

.kp-progress-item {
    padding: 12px 0;
}

.kp-progress-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 9px;
    gap: 10px;
}

.kp-progress-label span {
    font-size: 12px;
    color: var(--kf-text-muted);
}

.kp-progress-label strong {
    color: var(--kf-text);
    font-size: 12px;
}

.kp-progress-track {
    height: 7px;
    width: 100%;
    overflow: hidden;
    background: #edf3f0;
    border-radius: 100px;
}

.kp-progress-fill {
    height: 100%;
    border-radius: inherit;
    background: var(--kf-primary);
}

.kp-progress-not_started {
    background: #94a3b8;
}

.kp-progress-in_development {
    background: #60a5fa;
}

.kp-progress-testing_review {
    background: #eab308;
}

.kp-progress-completed {
    background: #31c48d;
}

.kp-progress-on_hold {
    background: #fb923c;
}

/* =========================================================
   Project Table
========================================================= */

.kp-table-section {
    margin-bottom: 22px;
}

.kp-table-scroll {
    width: 100%;
    overflow-x: auto;
}

.kp-table {
    border-collapse: collapse;
    width: 100%;
    min-width: 760px;
    text-align: left;
}

.kp-table th {
    padding: 14px 19px;
    font-size: 11px;
    font-weight: 700;
    background: #f8fbfa;
    color: var(--kf-text-muted);
    border-bottom: 1px solid var(--kf-border);
    white-space: nowrap;
}

.kp-table td {
    padding: 16px 19px;
    font-size: 12px;
    color: var(--kf-text);
    border-bottom: 1px solid var(--kf-border);
    vertical-align: middle;
}

.kp-table tbody tr:last-child td {
    border-bottom: 0;
}

.kp-table tbody tr:hover {
    background: #fbfdfc;
}

.kp-table td strong {
    font-weight: 700;
}

.kp-table-empty {
    padding: 25px;
    text-align: center;
    color: var(--kf-text-muted);
}

.kp-table-progress {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 90px;
}

.kp-table-progress .kp-progress-track {
    width: 65px;
}

.kp-table-progress span {
    font-size: 10px;
    color: var(--kf-text-muted);
}

/* =========================================================
   Tasks and Maintenance
========================================================= */

.kp-task-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid var(--kf-border);
}

.kp-task-item:last-child {
    border-bottom: 0;
}

.kp-task-main {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.kp-task-main strong {
    font-size: 12px;
    line-height: 1.5;
}

.kp-task-main span {
    color: var(--kf-text-muted);
    font-size: 11px;
}

.kp-task-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 7px;
    flex-shrink: 0;
}

.kp-task-meta small {
    color: var(--kf-text-muted);
    font-size: 10px;
    white-space: nowrap;
}

/* =========================================================
   Empty States
========================================================= */

.kp-empty-state {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 42px 20px;
}

.kp-empty-state i {
    font-size: 27px;
    color: var(--kf-primary);
    margin-bottom: 12px;
}

.kp-empty-state strong {
    font-size: 13px;
    margin-bottom: 6px;
}

.kp-empty-state p {
    font-size: 11px;
    line-height: 1.6;
    color: var(--kf-text-muted);
    max-width: 260px;
    margin: 0;
}

/* =========================================================
   Dashboard Bottom Summary
========================================================= */

.kp-bottom-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.kp-bottom-summary > div {
    background: #fff;
    border: 1px solid var(--kf-border);
    border-radius: var(--kf-radius-lg);
    padding: 17px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.kp-bottom-summary span {
    font-size: 11px;
    color: var(--kf-text-muted);
}

.kp-bottom-summary strong {
    font-size: 19px;
    font-weight: 750;
    color: var(--kf-text);
}

/* =========================================================
   Responsive
========================================================= */

@media (max-width: 1150px) {
    .kp-stats-grid,
    .kp-bottom-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .kp-dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .kp-stats-grid {
        gap: 12px;
    }

    .kp-stats-grid .kf-stat-card {
        padding: 16px;
        min-height: 125px;
    }

    .kp-stats-grid .kf-stat-value {
        font-size: 22px;
    }

    .kp-current-date {
        display: none;
    }

    .kp-section-header {
        padding: 16px;
    }

    .kp-section-body {
        padding: 8px 16px 16px;
    }

    .kp-bottom-summary {
        gap: 10px;
    }

    .kp-bottom-summary > div {
        padding: 14px;
        flex-direction: column;
        align-items: flex-start;
    }

    .kp-footer {
        padding: 15px;
        flex-direction: column;
        gap: 4px;
    }
}

@media (max-width: 390px) {
    .kp-stats-grid,
    .kp-bottom-summary {
        grid-template-columns: 1fr;
    }

    .kp-task-item {
        align-items: flex-start;
    }
}


/* =========================================================
   KyuPlan Clients Module
========================================================= */

.kp-clients-card {
    overflow: hidden;
    margin-bottom: 24px;
}

.kp-clients-filters {
    display: grid;
    grid-template-columns: minmax(200px, 1fr) 165px 140px 120px auto auto;
    gap: 10px;
    padding: 18px 22px;
    align-items: center;
    border-bottom: 1px solid var(--kf-border);
}

.kp-clients-filters .kf-input,
.kp-clients-filters .kf-select {
    width: 100%;
    min-width: 0;
}

.kp-clients-filters .kf-btn {
    white-space: nowrap;
    justify-content: center;
}

.kp-cell-subtitle {
    margin-top: 5px;
    font-size: 11px;
    color: var(--kf-text-muted);
}

.kp-row-actions {
    display: flex;
    gap: 7px;
    align-items: center;
}

.kp-row-actions .kf-btn {
    padding: 8px 11px;
    font-size: 11px;
    white-space: nowrap;
}

.kp-archive-form {
    margin: 0;
}

.kp-clients-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 22px;
    border-top: 1px solid var(--kf-border);
    color: var(--kf-text-muted);
    font-size: 12px;
}

.kp-pagination-links {
    display: flex;
    align-items: center;
    gap: 12px;
}

.kp-pagination-links .kf-btn {
    font-size: 11px;
    padding: 8px 13px;
}

.kp-disabled {
    opacity: .45;
    pointer-events: none;
}

/* Forms */

.kp-form-card {
    width: 100%;
    padding: 26px;
    margin-bottom: 24px;
}

.kp-form-section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--kf-text);
    margin-bottom: 22px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--kf-border);
}

.kp-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 22px;
    margin-bottom: 20px;
}

.kp-form-grid .kf-form-group {
    margin-bottom: 0;
}

.kp-textarea {
    min-height: 120px;
    resize: vertical;
    height: auto;
    line-height: 1.6;
}

.kp-form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--kf-border);
}

.kp-form-message:not(:empty) {
    padding: 12px 14px;
    border-radius: 9px;
    font-size: 12px;
    margin-top: 16px;
}

.kp-form-error {
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.kp-form-success {
    color: #047857;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
}

@media (max-width: 1150px) {
    .kp-clients-filters {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .kp-clients-filters input[name="search"] {
        grid-column: 1 / -1;
    }
}

@media (max-width: 700px) {
    .kp-clients-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 15px;
    }

    .kp-clients-filters input[name="search"] {
        grid-column: 1 / -1;
    }

    .kp-form-card {
        padding: 18px;
    }

    .kp-form-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .kp-clients-pagination {
        padding: 15px;
    }
}

@media (max-width: 430px) {
    .kp-clients-filters {
        grid-template-columns: 1fr;
    }

    .kp-clients-filters input[name="search"] {
        grid-column: auto;
    }

    .kp-form-actions {
        flex-wrap: wrap;
    }
}


/* =========================================================
   KyuPlan Projects Module
========================================================= */

.kp-projects-card {
    overflow: hidden;
    margin-bottom: 24px;
}

.kp-project-filters {
    display: grid;
    grid-template-columns:
        minmax(180px, 1.5fr)
        minmax(160px, 1.2fr)
        minmax(110px, .8fr)
        minmax(145px, 1fr);
    gap: 12px;
    padding: 20px 22px;
    border-bottom: 1px solid var(--kf-border);
    align-items: center;
}

.kp-project-filters .kf-input,
.kp-project-filters .kf-select {
    width: 100%;
    min-width: 0;
}

.kp-project-filters .kf-btn {
    justify-content: center;
    white-space: nowrap;
}

.kp-project-search {
    min-width: 0;
}

.kp-progress-count {
    display: block;
    margin-top: 6px;
    font-size: 10px;
    color: var(--kf-text-muted);
}

.kp-deadline-overdue {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #dc2626;
    font-weight: 600;
    font-size: 11px;
    white-space: nowrap;
}

.kp-projects-card .kp-table td,
.kp-projects-card .kp-table th {
    vertical-align: middle;
}

.kp-projects-card .kp-row-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.kp-projects-card .kp-row-actions .kf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    padding: 7px 11px;
    flex-shrink: 0;
}

@media (max-width: 1150px) {
    .kp-project-filters {
        grid-template-columns: repeat(
            3,
            minmax(0, 1fr)
        );
    }

    .kp-project-search {
        grid-column: 1 / -1;
    }
}

@media (max-width: 700px) {
    .kp-project-filters {
        grid-template-columns: repeat(
            2,
            minmax(0, 1fr)
        );
        padding: 16px;
    }

    .kp-project-search {
        grid-column: 1 / -1;
    }

    .kp-project-filters .kf-btn {
        width: 100%;
    }
}

@media (max-width: 430px) {
    .kp-project-filters {
        grid-template-columns: 1fr;
    }

    .kp-project-search {
        grid-column: auto;
    }
}


/* KyuPlan Project Form */

.kp-field-help {
    display: block;
    margin-top: 7px;
    font-size: 11px;
    line-height: 1.5;
    color: var(--kf-text-muted);
}

#projectForm .kf-form-group {
    min-width: 0;
}

#projectForm .kf-input,
#projectForm .kf-select {
    width: 100%;
}

#projectForm .kp-form-section-title:not(:first-child) {
    margin-top: 25px;
}

#projectForm .kp-textarea {
    width: 100%;
    resize: vertical;
}


/* =========================================================
   KyuPlan - KyuFin Style Summary Cards
========================================================= */

.kp-stats-grid .kf-stat-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 138px;
    padding: 22px 20px;
    border-radius: 16px;
}

/* Icon at top-right */

.kp-stats-grid .kf-stat-top {
    position: absolute;
    top: 19px;
    right: 20px;
    margin: 0;
}

.kp-stats-grid .kf-stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* Title */

.kp-stats-grid .kf-stat-label {
    margin: 0 55px 8px 0;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
    color: var(--kf-text-muted);
}

/* Value */

.kp-stats-grid .kf-stat-value {
    margin: 0;
    font-size: 25px;
    line-height: 1.3;
    font-weight: 800;
    letter-spacing: -0.6px;
    color: var(--kf-text);
}

/* Description */

.kp-stats-grid .kf-stat-meta {
    margin-top: 10px;
    color: var(--kf-text-muted);
    font-size: 11px;
    line-height: 1.5;
}

/* Responsive */

@media (max-width: 640px) {
    .kp-stats-grid .kf-stat-card {
        min-height: 130px;
        padding: 18px;
    }

    .kp-stats-grid .kf-stat-top {
        top: 16px;
        right: 16px;
    }

    .kp-stats-grid .kf-stat-icon {
        width: 38px;
        height: 38px;
    }

    .kp-stats-grid .kf-stat-value {
        font-size: 23px;
    }
}


/* Vertically Center Summary Card Icons */

.kp-stats-grid .kf-stat-top {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    margin: 0;
}

.kp-stats-grid .kf-stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}


/* =========================================================
   KyuPlan — Long-Term Project Directory
========================================================= */

.kp-workspace-directory {
    overflow: hidden;
    margin-bottom: 24px;
}

.kp-workspace-view-switch {
    display: flex;
    align-items: center;
    gap: 8px;
}

.kp-workspace-view-switch .kf-btn {
    font-size: 11px;
    padding: 8px 12px;
}

.kp-workspace-filters {
    display: grid;
    grid-template-columns:
        minmax(180px, 1.5fr)
        minmax(150px, 1.2fr)
        minmax(100px, .8fr)
        minmax(120px, .9fr)
        110px auto auto;
    gap: 10px;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid var(--kf-border);
}

.kp-workspace-filters .kf-input,
.kp-workspace-filters .kf-select {
    width: 100%;
    min-width: 0;
}

.kp-project-groups {
    padding: 22px;
}

.kp-project-group {
    margin-bottom: 28px;
}

.kp-project-group:last-child {
    margin-bottom: 0;
}

.kp-project-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.kp-project-group-title {
    display: flex;
    align-items: center;
    gap: 11px;
}

.kp-project-group-title > i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    color: #168f82;
    background: #e7f8f2;
    border-radius: 11px;
    font-size: 17px;
}

.kp-project-group-title h3 {
    margin: 0 0 3px;
    font-size: 14px;
    font-weight: 700;
}

.kp-project-group-title span {
    font-size: 11px;
    color: var(--kf-text-muted);
}

.kp-project-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.kp-project-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 20px;
    background: #fff;
    border: 1px solid var(--kf-border);
    border-radius: 14px;
    color: inherit;
    text-decoration: none;
    transition: border-color .2s, box-shadow .2s;
}

.kp-project-card:hover {
    border-color: #31c48d;
    box-shadow: 0 8px 24px rgba(11, 26, 36, .07);
}

.kp-project-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 16px;
}

.kp-project-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 39px;
    height: 39px;
    border-radius: 11px;
    color: #168f82;
    background: #e7f8f2;
    font-size: 18px;
}

.kp-project-card h4 {
    margin: 0 0 11px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.5;
    color: var(--kf-text);
}

.kp-project-card-condition {
    margin-bottom: 18px;
}

.kp-project-card-metrics {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: auto;
    padding-bottom: 17px;
}

.kp-project-card-metrics > div {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--kf-text-muted);
    font-size: 11px;
}

.kp-project-card-metrics i {
    color: #1faf9a;
    font-size: 13px;
}

.kp-project-card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 13px;
    border-top: 1px solid var(--kf-border);
    font-size: 11px;
    color: var(--kf-text-muted);
}

.kp-project-card-bottom > i {
    color: #168f82;
    font-size: 15px;
}

.kp-workspace-directory .kp-status-planned {
    color: #64748b;
    background: #f1f5f9;
}

.kp-workspace-directory .kp-status-active {
    color: #2563eb;
    background: #eff6ff;
}

.kp-workspace-directory .kp-status-live {
    color: #047857;
    background: #dcfce7;
}

.kp-workspace-directory .kp-status-on_hold {
    color: #c2410c;
    background: #fff7ed;
}

@media (max-width: 1200px) {
    .kp-workspace-filters {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .kp-workspace-filters input[name="search"] {
        grid-column: 1 / -1;
    }
}

@media (max-width: 1050px) {
    .kp-project-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .kp-project-groups {
        padding: 16px;
    }

    .kp-project-cards {
        grid-template-columns: 1fr;
    }

    .kp-workspace-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 15px;
    }

    .kp-workspace-filters input[name="search"] {
        grid-column: 1 / -1;
    }

    .kp-workspace-view-switch {
        flex-wrap: wrap;
    }
}

@media (max-width: 430px) {
    .kp-workspace-filters {
        grid-template-columns: 1fr;
    }

    .kp-workspace-filters input[name="search"] {
        grid-column: auto;
    }

    .kp-workspace-directory .kp-section-header {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* =========================================================
   KyuPlan Quick Project Creation
========================================================= */

.kp-project-quick-create {
    width: 100%;
}

.kp-project-quick-create .kf-form-group {
    min-width: 0;
}

.kp-project-quick-create .kf-input,
.kp-project-quick-create .kf-select {
    width: 100%;
}

.kp-project-quick-create .kp-form-grid {
    margin-bottom: 24px;
}

.kp-project-quick-create .kp-textarea {
    width: 100%;
    min-height: 110px;
    resize: vertical;
}

.kp-project-quick-create .kp-field-help {
    display: block;
    margin-top: 7px;
    font-size: 11px;
    color: var(--kf-text-muted);
    line-height: 1.6;
}

.kp-project-quick-create .kp-form-actions {
    margin-top: 24px;
}


/* =========================================================
   KyuPlan — Project Workspace
========================================================= */

.kp-workspace-heading {
    margin-bottom: 22px;
}

.kp-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--kf-text-muted);
    font-size: 12px;
    text-decoration: none;
    margin-bottom: 16px;
}

.kp-back-link:hover {
    color: var(--kp-primary);
}

.kp-workspace-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 8px;
}

.kp-workspace-owner {
    font-size: 12px;
    color: var(--kf-text-muted);
    margin-bottom: 5px;
}

.kp-workspace-flags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.kp-project-workspace {
    overflow: hidden;
    margin-bottom: 24px;
}

.kp-workspace-tabs {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--kf-border);
    overflow-x: auto;
}

.kp-workspace-tab {
    flex-shrink: 0;
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 9px;
    color: var(--kf-text-muted);
    font-size: 12px;
    font-weight: 600;
}

.kp-workspace-tab:hover {
    background: #f2f8f5;
    color: var(--kf-text);
}

.kp-workspace-tab.active {
    background: #e7f8f2;
    color: #158568;
}

.kp-workspace-content {
    padding: 24px;
}

.kp-workspace-panel-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.kp-workspace-panel {
    min-width: 0;
    padding: 22px;
    border: 1px solid var(--kf-border);
    border-radius: 14px;
    background: #fff;
}

.kp-workspace-panel h2,
.kp-workspace-section-heading h2 {
    margin: 0 0 18px;
    font-size: 15px;
    font-weight: 700;
}

.kp-workspace-section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.kp-workspace-section-heading h2 {
    margin-bottom: 5px;
}

.kp-workspace-section-heading p {
    margin: 0;
    font-size: 12px;
    color: var(--kf-text-muted);
}

.kp-detail-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid var(--kf-border);
}

.kp-detail-list > div:last-child {
    border-bottom: 0;
}

.kp-detail-list span {
    color: var(--kf-text-muted);
    font-size: 12px;
}

.kp-detail-list strong {
    font-size: 12px;
    font-weight: 600;
    text-align: right;
    overflow-wrap: anywhere;
}

.kp-workspace-highlight {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    border-radius: 12px;
    background: #f5faf8;
}

.kp-workspace-highlight strong {
    font-size: 14px;
}

.kp-workspace-highlight > span:not(.kp-status) {
    font-size: 12px;
    color: var(--kf-text-muted);
}

.kp-workspace-subheading {
    margin-top: 25px !important;
}

.kp-inline-empty {
    padding: 24px;
    border: 1px dashed var(--kf-border);
    border-radius: 12px;
    text-align: center;
    color: var(--kf-text-muted);
    font-size: 12px;
}

.kp-workspace-notes,
.kp-workspace-history {
    margin-top: 20px;
}

.kp-workspace-notes p {
    font-size: 12px;
    line-height: 1.8;
    color: var(--kf-text-muted);
}

.kp-component-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.kp-component-card {
    border: 1px solid var(--kf-border);
    border-radius: 14px;
    padding: 20px;
    min-width: 0;
}

.kp-component-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.kp-component-card h3 {
    font-size: 14px;
    margin: 0 0 5px;
}

.kp-component-card p {
    font-size: 12px;
    color: var(--kf-text-muted);
    margin: 0 0 15px;
}

.kp-workspace-records {
    display: flex;
    flex-direction: column;
}

.kp-workspace-record {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 17px 0;
    border-bottom: 1px solid var(--kf-border);
}

.kp-workspace-record:last-child {
    border-bottom: 0;
}

.kp-workspace-record > div:first-child {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.kp-workspace-record strong {
    font-size: 12px;
    line-height: 1.5;
}

.kp-workspace-record span:not(.kp-status),
.kp-workspace-record small {
    font-size: 11px;
    color: var(--kf-text-muted);
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.kp-record-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 7px;
    flex-shrink: 0;
}

@media (max-width: 1050px) {
    .kp-component-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 800px) {
    .kp-workspace-panel-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .kp-workspace-content {
        padding: 15px;
    }

    .kp-workspace-tabs {
        padding: 10px;
    }

    .kp-workspace-title-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .kp-component-grid {
        grid-template-columns: 1fr;
    }

    .kp-workspace-panel {
        padding: 16px;
    }

    .kp-workspace-record {
        align-items: flex-start;
    }
}


/* KyuPlan Component Management */

#componentFormSection[hidden] {
    display: none !important;
}

#componentFormSection {
    scroll-margin-top: 85px;
}

.kp-component-status-planned,
.kp-component-status-retired {
    background: #f1f5f9;
    color: #64748b;
}

.kp-component-status-development {
    background: #eff6ff;
    color: #2563eb;
}

.kp-component-status-testing {
    background: #fef9c3;
    color: #a16207;
}

.kp-component-status-live {
    background: #dcfce7;
    color: #047857;
}

.kp-component-status-paused {
    background: #fff7ed;
    color: #c2410c;
}

.kp-edit-component {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    white-space: nowrap;
    min-height: 36px;
}
