﻿
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600;700&family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --ink: #0f1923;
    --ink-mid: #2c3e50;
    --ink-soft: #607080;
    --ink-ghost: #99aabb;
    --gold: #b8965a;
    --gold-light: #d4b07a;
    --gold-pale: #f5edd8;
    --teal: #1a6a6a;
    --teal-mid: #1e8080;
    --teal-pale: #e4f0f0;
    --surface: #fafaf8;
    --canvas: #f2f0eb;
    --white: #ffffff;
    --border: #e2ddd4;
    --border-soft: #ede9e0;
    --row-alt: #f8f6f1;
    --row-hover: #f0ede5;
    --danger: #c0392b;
    --success: #1a7a4a;
    --warn: #b8860b;
    --info: #1a5f8a;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 4px rgba(15,25,35,0.06);
    --shadow-md: 0 4px 16px rgba(15,25,35,0.09);
    --shadow-lg: 0 8px 32px rgba(15,25,35,0.12);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: white;
    min-height: 100vh;
}

/* ── Wrapper ── */
.appraisal-wrapper {
    font-family: 'Outfit', sans-serif;
    color: var(--ink);
    max-width: 1500px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 5rem;
}

/* ── Page Header ── */
.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    position: relative;
}

    .page-header::after {
        content: '';
        position: absolute;
        bottom: -1px;
        left: 0;
        width: 80px;
        height: 3px;
        background: linear-gradient(90deg, var(--gold), var(--gold-light));
        border-radius: 2px;
    }

.page-eyebrow {
    font-family: 'Outfit', sans-serif;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 0.4rem;
}

.score-input {
    width: 70px;
    padding: 4px 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: center;
    font-size: 0.9rem;
}

    .score-input:focus {
        outline: none;
        border-color: var(--primary, #4f46e5);
        box-shadow: 0 0 0 2px rgba(79,70,229,0.15);
    }

.score-error {
    display: block;
    font-size: 0.72rem;
    min-height: 1rem;
}

.form-feedback {
    font-size: 0.85rem;
    font-weight: 500;
    margin-right: 1rem;
}

.feedback-success {
    color: #16a34a;
}

.feedback-error {
    color: #dc2626;
}

/* Spinner animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin 1s linear infinite;
}



.score-input:invalid {
    border-color: red;
}

.page-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 600;
    color: var(--ink);
    line-height: 1.15;
    letter-spacing: -0.01em;
}

    .page-title span {
        color: var(--teal);
    }

.page-meta {
    text-align: right;
    font-size: 0.72rem;
    color: var(--ink-ghost);
    line-height: 1.7;
}

/* ── Section Headings ── */
.section-heading {
    font-family: 'Outfit', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

    .section-heading .sh-num {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 30px;
        height: 30px;
        background: var(--teal);
        color: var(--white);
        border-radius: 50%;
        font-size: 0.6rem;
        font-weight: 700;
        flex-shrink: 0;
    }

    .section-heading::after {
        content: '';
        flex: 1;
        height: 1px;
        background: linear-gradient(90deg, var(--border), transparent);
    }

/* ── Cards / Panels ── */
.panel {
    background: var(--white);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
    overflow: hidden;
}

.panel-inner {
    padding: 1.5rem;
}

/* ── Info Grid ── */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1.25rem 2rem;
    padding: 1.5rem;
}

.info-item {
}

.info-label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-ghost);
    margin-bottom: 0.3rem;
}

.info-value {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--ink);
    line-height: 1.4;
}

    .info-value.accent {
        color: var(--teal);
        font-weight: 600;
    }

/* ── Tables ── */
.table-section {
    margin-bottom: 2rem;
}

.appraisal-table-wrap {
    background: var(--white);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.appraisal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.845rem;
}

    .appraisal-table thead tr {
        background: var(--ink);
    }

    .appraisal-table thead th {
        padding: 0.9rem 1.1rem;
        font-weight: 600;
        font-size: 0.62rem;
        letter-spacing: 0.12em;
        text-transform: uppercase;
        text-align: left;
        color: rgba(255,255,255,0.75);
        border: none;
        white-space: nowrap;
    }

        .appraisal-table thead th:first-child {
            color: var(--gold-light);
        }

    .appraisal-table tbody tr {
        border-bottom: 1px solid var(--border-soft);
        transition: background 0.15s;
    }

        .appraisal-table tbody tr:nth-child(even) {
            background: var(--row-alt);
        }

        .appraisal-table tbody tr:last-child {
            border-bottom: none;
        }

        .appraisal-table tbody tr:hover {
            background: var(--row-hover);
        }

    .appraisal-table tbody td {
        padding: 0.9rem 1.1rem;
        color: var(--ink-mid);
        vertical-align: top;
        line-height: 1.5;
        border: none;
    }

    .appraisal-table tfoot tr {
        background: var(--surface);
        border-top: 1px solid var(--border);
    }

    .appraisal-table tfoot td {
        padding: 1rem 1.1rem;
        border: none;
    }

.goal-code {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.78rem;
    color: var(--teal);
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.no-data {
    text-align: center;
    padding: 2.5rem;
    color: var(--ink-ghost);
    font-size: 0.85rem;
    font-style: italic;
}

/* ── Form Controls ── */
.score-input,
.comment-input,
.rating-select {
    width: 100%;
    font-family: 'Outfit', sans-serif;
    font-size: 0.83rem;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.7rem;
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

    .score-input::-webkit-outer-spin-button,
    .score-input::-webkit-inner-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }

.score-input {
    -moz-appearance: textfield;
    min-width: 72px;
}

.comment-input {
    resize: vertical;
    min-height: 60px;
    line-height: 1.5;
}

.rating-select {
    min-width: 152px;
    padding-right: 2.2rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%2399aabb' d='M5 7L0 2h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
}

    .score-input:focus,
    .comment-input:focus,
    .rating-select:focus {
        outline: none;
        border-color: var(--teal-mid);
        box-shadow: 0 0 0 3px rgba(26,128,128,0.12);
        background: var(--white);
    }

.score-input.invalid {
    border-color: var(--danger) !important;
}

.rating-select.r-excellent {
    background-color: #dbeafe;
    color: #1e40af;
    border-color: #93c5fd;
}

.rating-select.r-good {
    background-color: #d1fae5;
    color: #065f46;
    border-color: #6ee7b7;
}

.rating-select.r-needs {
    background-color: #fef3c7;
    color: #92400e;
    border-color: #fcd34d;
}

.rating-select.r-bad {
    background-color: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}

/* Textarea for comment sections */
.form-textarea {
    width: 100%;
    font-family: 'Outfit', sans-serif;
    font-size: 0.875rem;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.7rem 0.9rem;
    resize: vertical;
    min-height: 80px;
    line-height: 1.6;
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

    .form-textarea:focus {
        outline: none;
        border-color: var(--teal-mid);
        box-shadow: 0 0 0 3px rgba(26,128,128,0.12);
        background: var(--white);
    }

    .form-textarea[readonly] {
        background: #f5f3ef;
        color: var(--ink-soft);
        cursor: not-allowed;
        border-style: dashed;
    }

/* ── Form Groups ── */
.form-group {
    margin-bottom: 1.1rem;
}

.form-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin-bottom: 0.4rem;
}

.form-control-static {
    width: 100%;
    padding: 0.55rem 0.9rem;
    background: #f5f3ef;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    font-family: 'Outfit', sans-serif;
    font-size: 0.875rem;
    color: var(--ink-soft);
    cursor: default;
}

/* Score summary chips */
.score-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
}

.score-chip {
    flex: 1;
    min-width: 160px;
    background: var(--teal-pale);
    border: 1px solid #b0d8d8;
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
}

.score-chip-label {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--teal);
    margin-bottom: 0.35rem;
}

.score-chip-value {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--ink);
}

/* ── Footer Action Bar ── */
.submit-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.submit-note {
    font-size: 0.75rem;
    color: var(--ink-ghost);
    font-style: italic;
}

.btn-row {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    align-items: center;
}

.add-target-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--teal);
    text-decoration: none;
    padding: 0.55rem 1.1rem;
    border: 1.5px solid var(--teal);
    border-radius: var(--radius-sm);
    background: transparent;
    transition: background 0.16s, color 0.16s;
    min-height: 42px;
    letter-spacing: 0.02em;
}

    .add-target-link:hover,
    .add-target-link:focus {
        background: var(--teal);
        color: var(--white);
        outline: none;
    }

.btn-submit {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.6rem;
    background: linear-gradient(135deg, var(--teal), var(--teal-mid));
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    min-height: 42px;
    letter-spacing: 0.04em;
    transition: opacity 0.18s, transform 0.12s, box-shadow 0.18s;
    box-shadow: 0 2px 10px rgba(26,106,106,0.3);
}

    .btn-submit:hover {
        opacity: 0.9;
        box-shadow: 0 4px 16px rgba(26,106,106,0.35);
    }

    .btn-submit:active {
        transform: scale(0.98);
    }

    .btn-submit:disabled {
        opacity: 0.55;
        cursor: not-allowed;
    }

/* ── Status Badge ── */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    background: var(--gold-pale);
    color: var(--gold);
    border: 1px solid #dfc98a;
}

    .status-badge::before {
        content: '';
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: var(--gold);
        animation: pulse-dot 1.8s infinite;
    }

@keyframes pulse-dot {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.35;
    }
}

/* ── Toast ── */
.toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    padding: 0.9rem 1.3rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--white);
    background: var(--teal);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.28s, transform 0.28s;
    pointer-events: none;
    z-index: 999;
    max-width: 320px;
}

    .toast.show {
        opacity: 1;
        transform: translateY(0);
    }

    .toast.error {
        background: var(--danger);
    }

/* ── Divider ── */
.section-divider {
    height: 1px;
    background: linear-gradient(90deg, var(--border), transparent);
    margin: 0.25rem 0 1.25rem;
}

/* ── 2-col layout for comment pairs ── */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

/* ── Tablet ── */
@media (max-width: 860px) {
    .two-col {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .appraisal-wrapper {
        padding: 1.25rem 1rem 3rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-meta {
        text-align: left;
    }

    .info-grid {
        grid-template-columns: 1fr 1fr;
        padding: 1rem;
        gap: 1rem 1.25rem;
    }
}

/* ── Mobile ── */
@media (max-width: 600px) {
    .appraisal-table thead {
        display: none;
    }

    .appraisal-table,
    .appraisal-table tbody,
    .appraisal-table tr,
    .appraisal-table td,
    .appraisal-table tfoot {
        display: block;
        width: 100%;
    }

    .appraisal-table-wrap {
        border-radius: 0;
        border-left: none;
        border-right: none;
        box-shadow: none;
    }

    .appraisal-table tbody tr {
        background: var(--white) !important;
        border: 1px solid var(--border-soft);
        border-radius: var(--radius-md);
        margin: 0.65rem 0;
        padding: 0.75rem 1rem;
    }

    .appraisal-table tbody td {
        padding: 0.4rem 0;
        display: flex;
        flex-direction: column;
        gap: 0.2rem;
        border: none;
        font-size: 0.875rem;
    }

        .appraisal-table tbody td::before {
            content: attr(data-label);
            font-size: 0.6rem;
            font-weight: 700;
            letter-spacing: 0.1em;
            text-transform: uppercase;
            color: var(--ink-ghost);
        }

        .appraisal-table tbody td.td-num::before {
            display: none;
        }

        .appraisal-table tbody td.td-num {
            font-size: 0.7rem;
            color: var(--ink-ghost);
            flex-direction: row;
            gap: 0.3rem;
            align-items: center;
            padding-bottom: 0.3rem;
            border-bottom: 1px solid var(--border-soft);
            margin-bottom: 0.35rem;
        }

    .appraisal-table tfoot tr {
        display: block;
        padding: 0.85rem 0;
    }

    .appraisal-table tfoot td {
        display: block;
        padding: 0;
    }

    .score-input, .comment-input, .rating-select {
        min-width: unset;
        width: 100%;
    }

    .score-chips {
        flex-direction: column;
    }

    .score-chip {
        min-width: unset;
    }

    .submit-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-row {
        flex-direction: column;
    }

    .btn-submit, .add-target-link {
        width: 100%;
        justify-content: center;
    }

    .toast {
        left: 1rem;
        right: 1rem;
        max-width: unset;
        bottom: 1rem;
    }
}

@media (max-width: 380px) {
    .info-grid {
        grid-template-columns: 1fr;
    }
}


