:root {
    --bg: #080c18;
    --panel: #11172a;
    --panel2: #161d34;
    --border: rgba(255,255,255,.09);
    --text: #f6f7fb;
    --muted: #99a4c2;
    --accent: #8b7cff;
    --green: #47df91;
    --yellow: #f2c14e;
}

* {
    box-sizing: border-box;
}

html {
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

body {
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(
            circle at 15% 10%,
            #1e3167 0,
            transparent 30%
        ),
        radial-gradient(
            circle at 90% 80%,
            #46245f 0,
            transparent 35%
        ),
        var(--bg);
    min-height: 100vh;
}

a {
    color: inherit;
}

.shell {
    width: min(1180px, calc(100% - 40px));
    margin: auto;
}

.topbar {
    border-bottom: 1px solid var(--border);
    background: rgba(8,12,24,.72);
    backdrop-filter: blur(20px);
}

.topbar-inner {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    font-weight: 800;
    letter-spacing: -.035em;
}

.brand span {
    color: var(--muted);
    font-weight: 500;
    margin-left: 8px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 12px;
    padding: 12px 18px;
    background: var(--accent);
    color: white;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
}

.button-secondary {
    background: rgba(255,255,255,.08);
}

.card {
    border: 1px solid var(--border);
    background: rgba(17,23,42,.84);
    border-radius: 20px;
    padding: 24px;
}

.muted {
    color: var(--muted);
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 30px;
}

.login-wrap {
    width: min(430px, 100%);
}

.login-brand {
    margin-bottom: 30px;
}

.login-brand small {
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .16em;
    font-weight: 800;
}

.login-brand h1 {
    font-size: clamp(2.5rem, 9vw, 4.5rem);
    letter-spacing: -.065em;
    line-height: .92;
    margin: 12px 0;
}

.login-brand p {
    color: var(--muted);
    line-height: 1.6;
}

.login-card {
    padding: 28px;
}

label {
    display: block;
    font-size: .9rem;
    font-weight: 700;
    margin-bottom: 8px;
}

input {
    width: 100%;
    border: 1px solid var(--border);
    background: rgba(255,255,255,.05);
    color: white;
    padding: 14px 15px;
    border-radius: 12px;
    outline: none;
    font: inherit;
}

input:focus {
    border-color: var(--accent);
}

.field {
    margin-bottom: 18px;
}

.login-card .button {
    width: 100%;
}

.error {
    background: rgba(220,70,70,.14);
    border: 1px solid rgba(255,90,90,.3);
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.dashboard {
    padding: 55px 0;
}

.dashboard h1 {
    font-size: clamp(2rem, 5vw, 3.4rem);
    letter-spacing: -.055em;
    margin: 0 0 8px;
}

.grid {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0,1fr));
    gap: 18px;
    margin-top: 32px;
}

.stat {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -.05em;
    margin-top: 12px;
}

@media (max-width: 760px) {
    .grid {
        grid-template-columns: 1fr;
    }

    .brand span {
        display: none;
    }
}

.admin-nav {
    display: flex;
    gap: 8px;
    align-items: center;
}

.admin-nav a {
    text-decoration: none;
    padding: 9px 12px;
    border-radius: 10px;
    color: var(--muted);
    font-weight: 700;
    font-size: .92rem;
}

.admin-nav a:hover,
.admin-nav a.active {
    background: rgba(255,255,255,.07);
    color: white;
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 28px;
}

.page-head h1 {
    margin-top: 4px;
}

.table-card {
    padding: 0;
    overflow: hidden;
}

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

.data-table th,
.data-table td {
    text-align: left;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table th {
    color: var(--muted);
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .1em;
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.data-table tbody tr:hover {
    background: rgba(255,255,255,.025);
}

.data-table a {
    text-decoration: none;
    font-weight: 700;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 99px;
    background: rgba(255,255,255,.08);
    color: var(--muted);
    font-size: .78rem;
    font-weight: 800;
}

.badge-active,
.badge-completed {
    background: rgba(71,223,145,.12);
    color: var(--green);
}

.badge-waiting_client {
    background: rgba(242,193,78,.14);
    color: var(--yellow);
}

.badge-inactive,
.badge-archived {
    opacity: .65;
}

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

.form-grid .full {
    grid-column: 1 / -1;
}

textarea,
select {
    width: 100%;
    border: 1px solid var(--border);
    background: rgba(255,255,255,.05);
    color: white;
    padding: 14px 15px;
    border-radius: 12px;
    outline: none;
    font: inherit;
}

textarea {
    min-height: 130px;
    resize: vertical;
}

select option {
    background: #11172a;
}

.actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
}

.alert-success {
    border: 1px solid rgba(71,223,145,.3);
    background: rgba(71,223,145,.1);
    color: #aef3cd;
    padding: 13px 15px;
    border-radius: 12px;
    margin-bottom: 22px;
}

.form-error {
    border: 1px solid rgba(255,90,90,.3);
    background: rgba(220,70,70,.12);
    padding: 13px 15px;
    border-radius: 12px;
    margin-bottom: 22px;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 8px;
}

.checkbox-row input {
    width: auto;
}

.empty-state {
    padding: 45px 25px;
    text-align: center;
}

.small-muted {
    color: var(--muted);
    font-size: .86rem;
}

@media (max-width: 850px) {
    .admin-nav {
        display: none;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-grid .full {
        grid-column: auto;
    }

    .page-head {
        flex-direction: column;
    }

    .data-table {
        min-width: 720px;
    }

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

.project-summary {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 16px;
    margin: 24px 0;
}

.project-section {
    margin-top: 28px;
}

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

.section-head h2 {
    margin: 0;
    font-size: 1.25rem;
}

.stage-list {
    display: grid;
    gap: 14px;
}

.stage-card {
    border: 1px solid var(--border);
    background: rgba(17,23,42,.72);
    border-radius: 16px;
    overflow: hidden;
}

.stage-head {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}

.stage-title {
    font-size: 1.05rem;
    font-weight: 800;
}

.stage-body {
    padding: 16px 20px 20px;
}

.stage-description {
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: 14px;
}

.deliverable-list {
    display: grid;
    gap: 8px;
}

.deliverable-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,.025);
    border-radius: 10px;
    padding: 11px 13px;
}

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

.requirement-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    background: rgba(255,255,255,.025);
}

.requirement-card strong {
    display: block;
    margin-bottom: 6px;
}

.milestone-amount {
    font-weight: 800;
    font-size: 1.15rem;
}

.mini-stack {
    display: grid;
    gap: 3px;
}

.danger-note {
    border: 1px solid rgba(242,193,78,.32);
    background: rgba(242,193,78,.08);
    padding: 14px 16px;
    border-radius: 12px;
    color: #f8d986;
    line-height: 1.55;
}

@media (max-width: 850px) {

    .project-summary {
        grid-template-columns: 1fr;
    }

    .requirement-grid {
        grid-template-columns: 1fr;
    }

    .stage-head,
    .deliverable-row {
        flex-direction: column;
    }
}

.stage-card select,
.deliverable-row select,
.requirement-card select,
.data-table select {
    width: auto;
    min-width: 145px;
    padding: 8px 30px 8px 10px;
    font-size: .82rem;
    font-weight: 700;
    border-radius: 9px;
}

.deliverable-row form,
.stage-head form {
    margin: 0;
}

.requirement-card form {
    margin-top: 10px;
}


.status-saving {
    opacity: .55;
    cursor: wait;
}

.portal-toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9999;

    padding: 12px 17px;

    border: 1px solid rgba(71,223,145,.35);
    border-radius: 12px;

    background: rgba(17,23,42,.96);
    color: #aef3cd;

    font-weight: 800;
    font-size: .9rem;

    box-shadow:
        0 18px 55px rgba(0,0,0,.35);

    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;

    transition:
        opacity .18s ease,
        transform .18s ease;
}

.portal-toast-visible {
    opacity: 1;
    transform: translateY(0);
}

.portal-toast-error {
    color: #ffb8b8;
    border-color: rgba(255,90,90,.35);
}


/* =========================================================
   CLIENT PORTAL SHELL
   ========================================================= */

.client-topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
}

.client-project-page {
    padding-top: 42px;
}


/* =========================================================
   ACCORDIONS
   ========================================================= */

.portal-accordion {
    border: 1px solid var(--border);
    background: rgba(17,23,42,.78);
    border-radius: 18px;
    overflow: hidden;
    margin-top: 16px;
}

.portal-accordion > summary {
    list-style: none;
    cursor: pointer;
    padding: 20px 22px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;

    user-select: none;
}

.portal-accordion > summary::-webkit-details-marker {
    display: none;
}

.portal-accordion > summary::after {
    content: "+";
    flex: 0 0 auto;

    width: 30px;
    height: 30px;

    display: grid;
    place-items: center;

    border-radius: 50%;
    background: rgba(255,255,255,.07);

    font-size: 1.25rem;
    font-weight: 500;
}

.portal-accordion[open] > summary::after {
    content: "−";
}

.portal-accordion-title {
    font-size: 1.08rem;
    font-weight: 800;
}

.portal-accordion-subtitle {
    color: var(--muted);
    margin-top: 4px;
    font-size: .88rem;
}

.portal-accordion-body {
    border-top: 1px solid var(--border);
    padding: 20px 22px 24px;
}


/* =========================================================
   NESTED STAGE ACCORDIONS
   ========================================================= */

.stage-accordion {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255,255,255,.02);
    margin-bottom: 10px;
}

.stage-accordion > summary {
    cursor: pointer;
    list-style: none;

    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;

    padding: 15px 16px;
}

.stage-accordion > summary::-webkit-details-marker {
    display: none;
}

.stage-accordion-body {
    padding: 0 16px 16px;
}


/* =========================================================
   CLIENT REQUESTS
   ========================================================= */

.client-request {
    border: 1px solid var(--border);
    background: rgba(255,255,255,.025);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 14px;
}

.client-request:last-child {
    margin-bottom: 0;
}

.client-request h3 {
    margin: 0 0 6px;
}

.client-request-form {
    margin-top: 16px;
}

.client-request-form textarea {
    min-height: 105px;
}

.file-input {
    margin-top: 12px;
}

.file-input input[type="file"] {
    padding: 10px;
}

.file-hint {
    margin-top: 7px;
    color: var(--muted);
    font-size: .78rem;
}

.submission-history {
    margin-top: 16px;
    border-top: 1px solid var(--border);
    padding-top: 14px;
}

.submission-item {
    background: rgba(255,255,255,.035);
    border-radius: 10px;
    padding: 12px;
    margin-top: 8px;
}

.submission-files {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 9px;
}

.submission-file {
    display: inline-flex;
    text-decoration: none;
    padding: 7px 9px;
    border-radius: 8px;
    background: rgba(255,255,255,.06);
    font-size: .8rem;
    font-weight: 700;
}

.request-submitted {
    border-color: rgba(71,223,145,.25);
}

@media (max-width: 700px) {

    .client-topbar .topbar-inner {
        min-height: 62px;
    }

    .portal-accordion > summary {
        padding: 16px;
    }

    .portal-accordion-body {
        padding: 16px;
    }
}


.asset-guide-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.asset-guide-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255,255,255,.025);
}

.asset-guide-image {
    aspect-ratio: 16 / 9;
    background: rgba(255,255,255,.04);
    overflow: hidden;
}

.asset-guide-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.asset-guide-content {
    padding: 14px;
}

.asset-guide-content > strong {
    display: block;
    font-size: .96rem;
    margin-bottom: 5px;
}

.asset-specs {
    display: grid;
    gap: 5px;
    margin-top: 12px;
    font-size: .8rem;
    color: var(--muted);
}

.asset-specs span {
    display: block;
}

.asset-specs strong {
    color: var(--text);
}

.asset-instructions {
    margin-top: 12px;
    padding: 10px 11px;
    border-radius: 9px;
    background: rgba(255,255,255,.045);
    color: var(--muted);
    font-size: .8rem;
    line-height: 1.5;
}

@media (max-width: 760px) {

    .asset-guide-grid {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   THEME TOKENS
   ========================================================= */

:root {
    color-scheme: dark;
}

html[data-theme="light"] {
    color-scheme: light;
}

html[data-theme="light"] body {
    background:
        radial-gradient(circle at top right, rgba(103,80,255,.10), transparent 35%),
        linear-gradient(180deg, #f6f8fc 0%, #edf1f8 100%);
    color: #152033;
}

html[data-theme="light"] .topbar {
    background: rgba(255,255,255,.86);
    border-bottom: 1px solid rgba(21,32,51,.10);
    backdrop-filter: blur(14px);
}

html[data-theme="light"] .brand,
html[data-theme="light"] .topbar a,
html[data-theme="light"] .topbar button {
    color: #152033;
}

html[data-theme="light"] .card,
html[data-theme="light"] .portal-accordion,
html[data-theme="light"] .stage-accordion,
html[data-theme="light"] .stage-card,
html[data-theme="light"] .requirement-card,
html[data-theme="light"] .client-request,
html[data-theme="light"] .asset-guide-card,
html[data-theme="light"] .table-card {
    background: rgba(255,255,255,.88);
    border-color: rgba(21,32,51,.10);
    color: #152033;
    box-shadow: 0 10px 30px rgba(21,32,51,.05);
}

html[data-theme="light"] .muted,
html[data-theme="light"] .small-muted,
html[data-theme="light"] .portal-accordion-subtitle,
html[data-theme="light"] .asset-instructions,
html[data-theme="light"] .stage-description,
html[data-theme="light"] .file-hint {
    color: #5c6880;
}

html[data-theme="light"] input,
html[data-theme="light"] textarea,
html[data-theme="light"] select {
    background: #ffffff;
    color: #152033;
    border-color: rgba(21,32,51,.14);
}

html[data-theme="light"] .button.button-secondary,
html[data-theme="light"] .theme-toggle {
    background: rgba(21,32,51,.06);
    color: #152033;
    border: 1px solid rgba(21,32,51,.10);
}

html[data-theme="light"] .submission-item,
html[data-theme="light"] .asset-instructions,
html[data-theme="light"] .submission-file {
    background: rgba(21,32,51,.05);
}

html[data-theme="light"] .data-table th,
html[data-theme="light"] .data-table td {
    border-color: rgba(21,32,51,.08);
}

html[data-theme="light"] .asset-guide-image {
    background: rgba(21,32,51,.04);
}

html[data-theme="light"] .portal-accordion > summary::after {
    background: rgba(21,32,51,.08);
    color: #152033;
}

/* =========================================================
   CLIENT HEADER ACTIONS / THEME TOGGLE
   ========================================================= */

.client-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.theme-toggle {
    appearance: none;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.06);
    color: var(--text);
    border-radius: 12px;
    padding: 10px 13px;
    font-weight: 800;
    font-size: .88rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform .15s ease, opacity .15s ease;
}

.theme-toggle:hover {
    transform: translateY(-1px);
}

.theme-toggle-icon {
    font-size: 1rem;
    line-height: 1;
}

.theme-toggle-label {
    text-transform: lowercase;
}

/* =========================================================
   REQUEST AREA EMPHASIS
   ========================================================= */

.portal-accordion:first-of-type > summary {
    background:
        linear-gradient(135deg, rgba(103,80,255,.14), rgba(71,223,145,.06));
}

html[data-theme="light"] .portal-accordion:first-of-type > summary {
    background:
        linear-gradient(135deg, rgba(103,80,255,.10), rgba(71,223,145,.05));
}

.portal-accordion-subtitle-strong {
    margin-top: 8px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.35;
}

.request-summary-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.request-pending-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 84px;
    padding: 9px 14px;
    border-radius: 999px;
    background: rgba(71,223,145,.14);
    border: 1px solid rgba(71,223,145,.26);
    color: #b9f6d7;
    font-size: .84rem;
    font-weight: 800;
    letter-spacing: .02em;
    text-transform: uppercase;
}

html[data-theme="light"] .request-pending-badge {
    background: rgba(71,223,145,.12);
    border-color: rgba(71,223,145,.24);
    color: #1f7a4e;
}

@media (max-width: 700px) {
    .client-header-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .request-summary-meta {
        width: 100%;
        justify-content: flex-start;
    }

    .portal-accordion > summary {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* View Website Progress must stay white in both themes */
.client-header-actions > a.button:not(.button-secondary),
.client-header-actions > a.button:not(.button-secondary):visited,
html[data-theme="light"] .client-header-actions > a.button:not(.button-secondary),
html[data-theme="dark"] .client-header-actions > a.button:not(.button-secondary) {
    color: #ffffff !important;
}


/* =========================================================
   ADMIN FIXED HEADER
   ========================================================= */

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(14px);
}

.admin-topbar .topbar-inner {
    min-height: 70px;
}


/* =========================================================
   ADMIN THEME TOGGLE
   ========================================================= */

.admin-topbar .theme-toggle {
    margin-left: auto;
}


/* =========================================================
   LIGHT MODE — ADMIN NAV
   ========================================================= */

html[data-theme="light"] .admin-nav a {
    color: #5c6880;
}

html[data-theme="light"] .admin-nav a:hover,
html[data-theme="light"] .admin-nav a.active {
    color: #152033;
}


/* =========================================================
   LIGHT MODE — GENERAL ADMIN ELEMENTS
   ========================================================= */

html[data-theme="light"] .dashboard {
    color: #152033;
}

html[data-theme="light"] .data-table {
    color: #152033;
}

html[data-theme="light"] .data-table th {
    color: #5c6880;
}

html[data-theme="light"] .data-table td {
    color: #152033;
}

html[data-theme="light"] .form-error {
    color: #8f2d2d;
    background: rgba(220,70,70,.08);
    border-color: rgba(220,70,70,.20);
}

html[data-theme="light"] .alert-success {
    color: #1f7a4e;
    background: rgba(71,223,145,.10);
    border-color: rgba(71,223,145,.24);
}

html[data-theme="light"] .danger-note {
    color: #8f2d2d;
}

html[data-theme="light"] .badge {
    border-color: rgba(21,32,51,.10);
}


/* =========================================================
   ADMIN CLIENT SUBMISSION REVIEW
   ========================================================= */

.admin-submission-review {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.admin-submission-heading {
    font-size: .8rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.admin-response-block {
    padding: 12px;
    border-radius: 10px;
    background: rgba(255,255,255,.035);
    margin-bottom: 12px;
}

.admin-response-text {
    margin-top: 7px;
    line-height: 1.55;
}

.admin-submission-files {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.admin-submission-file-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255,255,255,.025);
}

.admin-upload-preview {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    display: block;
}

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

.asset-compare > div {
    min-width: 0;
}

.asset-compare .small-muted {
    padding: 8px 10px 0;
}

.asset-compare img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}

.admin-file-meta {
    padding: 12px;
    display: grid;
    gap: 5px;
}

.button-small {
    margin-top: 7px;
    padding: 8px 10px;
    font-size: .8rem;
}

.admin-review-form {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.admin-review-actions {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
}

.admin-review-history {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.admin-review-history-item {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255,255,255,.03);
    display: grid;
    gap: 7px;
}


/* =========================================================
   CLIENT REVIEW FEEDBACK
   ========================================================= */

.client-review-feedback {
    margin-top: 16px;
    padding: 13px 14px;
    border-radius: 10px;

    background: rgba(255,176,59,.10);
    border: 1px solid rgba(255,176,59,.24);
}

.client-review-feedback strong {
    display: block;
    margin-bottom: 5px;
}

.client-review-accepted {
    margin-top: 16px;
    padding: 10px 12px;
    border-radius: 10px;

    background: rgba(71,223,145,.10);
    border: 1px solid rgba(71,223,145,.24);

    font-weight: 800;
}


html[data-theme="light"] .admin-response-block,
html[data-theme="light"] .admin-submission-file-card,
html[data-theme="light"] .admin-review-history-item {
    background: rgba(21,32,51,.035);
}


@media (max-width: 800px) {

    .admin-submission-files {
        grid-template-columns: 1fr;
    }

    .asset-compare {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   FORMAL APPROVAL WORKFLOW
   ========================================================= */

.approval-admin-box {
    margin-bottom: 18px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: rgba(255,255,255,.025);
}

.deliverable-approval-control {
    margin-left: 12px;
    display: flex;
    align-items: flex-end;
    flex-direction: column;
    gap: 7px;
}

.approval-client-comment {
    margin-top: 6px;
    line-height: 1.5;
    font-style: italic;
}

.client-approval-card {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 14px;
    background: rgba(255,255,255,.025);
}

.client-approval-card:last-child {
    margin-bottom: 0;
}

.client-approval-pending {
    border-color: rgba(132,108,255,.34);
    box-shadow:
        0 12px 34px rgba(70,58,180,.08);
}

.client-approval-head {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
}

.client-approval-head h3 {
    margin:
        4px 0 3px;
}

.client-approval-description {
    margin-top: 15px;
    line-height: 1.6;
}

.client-approval-notice {
    margin-top: 18px;
    padding: 13px 15px;
    border-radius: 11px;
    background: rgba(132,108,255,.08);
    border: 1px solid rgba(132,108,255,.18);
    line-height: 1.5;
}

.client-approval-form {
    margin-top: 18px;
}

.approval-decision-note {
    margin:
        4px 0 14px;
    font-size: .9rem;
    color: var(--muted);
}

.approval-decision-history {
    margin-top: 16px;
    padding: 13px 15px;
    border-radius: 11px;
    background: rgba(255,255,255,.035);
}

html[data-theme="light"] .approval-admin-box,
html[data-theme="light"] .client-approval-card,
html[data-theme="light"] .approval-decision-history {
    background: rgba(21,32,51,.025);
}

html[data-theme="light"] .client-approval-notice {
    background: rgba(132,108,255,.06);
}

@media (max-width: 760px) {

    .approval-admin-box {
        align-items: flex-start;
        flex-direction: column;
    }

    .deliverable-approval-control {
        width: 100%;
        margin-left: 0;
        align-items: flex-start;
    }

    .client-approval-head {
        flex-direction: column;
    }
}


/* =========================================================
   CLIENT CONFIRMATION MODAL
   ========================================================= */

.portal-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 3000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px;

    background: rgba(8,12,24,.58);
    backdrop-filter: blur(8px);
}

.portal-modal-card {
    position: relative;

    width: min(460px, 100%);

    padding: 34px;

    border-radius: 22px;
    border: 1px solid var(--border);

    background: #11172a;
    color: var(--text);

    box-shadow:
        0 30px 90px rgba(0,0,0,.30);

    text-align: center;
}

.portal-modal-icon {
    width: 54px;
    height: 54px;

    margin: 0 auto 18px;

    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(71,223,145,.14);
    border: 1px solid rgba(71,223,145,.26);

    font-size: 1.5rem;
    font-weight: 900;
}

.portal-modal-card h2 {
    margin: 0 0 10px;
}

.portal-modal-card p {
    margin: 0 0 22px;
}

.portal-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;

    width: 36px;
    height: 36px;

    border: 0;
    border-radius: 50%;

    background: rgba(255,255,255,.06);
    color: var(--text);

    font-size: 1.5rem;
    line-height: 1;

    cursor: pointer;
}

html[data-theme="light"] .portal-modal-backdrop {
    background: rgba(21,32,51,.26);
}

html[data-theme="light"] .portal-modal-card {
    background: #ffffff;
    color: #152033;

    border-color: rgba(21,32,51,.10);

    box-shadow:
        0 30px 90px rgba(21,32,51,.18);
}

html[data-theme="light"] .portal-modal-close {
    background: rgba(21,32,51,.06);
    color: #152033;
}


/* =========================================================
   NOTIFICATIONS
   ========================================================= */

.notification-bell {
    position: relative;

    width: 40px;
    height: 40px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    border: 1px solid var(--border);
    border-radius: 10px;

    color: var(--text);
    text-decoration: none;

    background: rgba(255,255,255,.04);
}

.notification-bell:hover {
    transform: translateY(-1px);
}

.notification-bell-icon {
    font-size: 1rem;
    line-height: 1;
}

.notification-bell-count {
    position: absolute;

    top: -6px;
    right: -7px;

    min-width: 19px;
    height: 19px;

    padding: 0 5px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 999px;

    background: #dc3545;
    color: #fff;

    font-size: 10px;
    font-weight: 800;

    border: 2px solid var(--page-bg, #fff);
}

.notification-page {
    max-width: 960px;
}

.notification-list {
    display: grid;
    gap: 12px;
}

.notification-card {
    padding: 18px 20px;

    border: 1px solid var(--border);
    border-radius: 14px;

    background: rgba(255,255,255,.025);
}

.notification-unread {
    border-color: rgba(117,104,255,.40);
    background: rgba(117,104,255,.055);
}

.notification-card-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;
}

.notification-title-row {
    display: flex;
    align-items: center;
    gap: 9px;

    margin-bottom: 4px;
}

.notification-new-dot {
    display: inline-flex;
    align-items: center;

    padding: 2px 7px;

    border-radius: 999px;

    background: rgba(117,104,255,.14);
    color: inherit;

    font-size: 10px;
    font-weight: 800;

    text-transform: uppercase;
    letter-spacing: .04em;
}

.notification-message {
    margin: 12px 0;
    line-height: 1.55;
}

html[data-theme="light"] .notification-bell,
html[data-theme="light"] .notification-card {
    background: #fff;
}

html[data-theme="light"] .notification-unread {
    background: rgba(117,104,255,.05);
}

@media (max-width: 680px) {

    .notification-card-main {
        flex-direction: column;
    }
}



/* =========================================================
   UNIVERSAL PORTAL HEADER
   ========================================================= */

.portal-header-actions {
    margin-left: auto;

    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 10px;

    flex: 0 0 auto;
}


.admin-topbar .theme-toggle {
    margin-left: 0;
}


.portal-header-actions .notification-bell,
.portal-header-actions .theme-toggle {
    height: 42px;
}


.portal-header-actions .notification-bell {
    width: 42px;
}


.portal-header-actions .button-secondary {
    min-height: 42px;
}


@media (max-width: 850px) {

    .portal-header-actions {
        gap: 8px;
    }

}


@media (max-width: 620px) {

    .topbar-inner {
        gap: 10px;
    }

    .theme-toggle-label {
        display: none;
    }

    .theme-toggle {
        width: 42px;
        height: 42px;

        padding: 0;

        justify-content: center;
    }

    .portal-header-actions .button-secondary {
        padding-left: 12px;
        padding-right: 12px;
    }

}


/* =========================================================
   NOTIFICATION PREFERENCES
   ========================================================= */

.notification-preference-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 24px;

    padding: 16px 0;

    margin: 0;

    border-bottom: 1px solid var(--border);

    cursor: pointer;
}


.notification-preference-row:last-of-type {
    border-bottom: 0;
}


.notification-preference-row input[type="checkbox"] {
    width: 20px;
    height: 20px;

    flex: 0 0 auto;

    accent-color: var(--accent);
}


.notification-preference-row strong {
    display: block;
    margin-bottom: 4px;
}


@media (max-width: 600px) {

    .notification-preference-row {
        align-items: flex-start;
    }

}


/* =========================================================
   PROJECT / STAGE / DELIVERABLE CONVERSATIONS
   ========================================================= */

.comment-section {
    margin-top: 18px;
}

.comment-section-title {
    margin-bottom: 10px;

    font-size: .78rem;
    font-weight: 800;

    letter-spacing: .08em;
    text-transform: uppercase;

    color: var(--muted);
}

.comment-thread {
    display: grid;
    gap: 9px;
}

.comment-empty {
    padding: 6px 0 10px;
}

.comment-item {
    padding: 12px 14px;

    border: 1px solid var(--border);
    border-radius: 11px;

    background: rgba(255,255,255,.028);
}

.comment-internal {
    border-color: rgba(242,193,78,.28);
    background: rgba(242,193,78,.07);
}

.comment-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 8px;

    margin-bottom: 7px;

    font-size: .78rem;
    color: var(--muted);
}

.comment-meta strong {
    color: var(--text);
}

.comment-body {
    line-height: 1.55;
    white-space: normal;
}

.comment-internal-badge {
    display: inline-flex;

    padding: 2px 7px;

    border-radius: 999px;

    background: rgba(242,193,78,.14);
    color: var(--yellow);

    font-size: .68rem;
    font-weight: 800;

    text-transform: uppercase;
    letter-spacing: .04em;
}

.comment-form {
    margin-top: 14px;
}

.comment-form textarea {
    min-height: 88px;
}

.comment-form-compact textarea {
    min-height: 72px;
}

.comment-form .button {
    margin-top: 9px;
}

.comment-internal-toggle {
    margin-top: 9px;

    display: flex;
    align-items: center;

    gap: 9px;

    font-size: .8rem;
    font-weight: 600;

    color: var(--muted);
}

.comment-internal-toggle input {
    width: auto;
    margin: 0;
}

.deliverable-comment-thread {
    margin-top: 10px;
    margin-bottom: 14px;

    padding: 12px;

    border-left: 2px solid var(--border);
}

.client-deliverable-comments {
    margin-bottom: 14px;
    padding: 12px;

    border-left: 2px solid var(--border);
}

.stage-comment-section,
.client-stage-comments {
    margin-bottom: 18px;

    padding-bottom: 18px;

    border-bottom: 1px solid var(--border);
}


html[data-theme="light"] .comment-item {
    background: rgba(21,32,51,.025);
}

html[data-theme="light"] .comment-internal {
    background: rgba(242,193,78,.08);
}

html[data-theme="light"] .comment-meta strong {
    color: #152033;
}


/* =========================================================
   ADMIN STAGE ACCORDIONS
   ========================================================= */

.admin-stage-accordion {
    overflow: hidden;
}

.admin-stage-accordion > summary {
    list-style: none;
}

.admin-stage-accordion > summary::-webkit-details-marker {
    display: none;
}

.admin-stage-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 18px;

    padding: 18px 20px;

    cursor: pointer;
    user-select: none;
}

.admin-stage-summary:hover {
    background: rgba(255,255,255,.025);
}

.admin-stage-summary-main {
    min-width: 0;
}

.admin-stage-summary-meta {
    display: flex;
    align-items: center;

    gap: 12px;

    flex: 0 0 auto;
}

.admin-stage-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 28px;
    height: 28px;

    font-size: 1.15rem;

    transition: transform .18s ease;
}

.admin-stage-accordion[open]
.admin-stage-chevron {
    transform: rotate(180deg);
}

.admin-stage-accordion[open]
.admin-stage-summary {
    border-bottom: 1px solid var(--border);
}

.admin-stage-accordion .stage-body {
    padding: 20px;
}

.admin-stage-controls {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 16px;

    margin-bottom: 18px;
}

.admin-stage-status-form {
    margin-top: 6px;
}

.admin-stage-status-form select {
    min-width: 190px;
}


html[data-theme="light"]
.admin-stage-summary:hover {
    background: rgba(21,32,51,.025);
}


@media (max-width: 700px) {

    .admin-stage-summary {
        padding: 15px;
    }

    .admin-stage-summary-meta {
        gap: 7px;
    }

    .admin-stage-accordion .stage-body {
        padding: 15px;
    }

    .admin-stage-controls {
        display: block;
    }

    .admin-stage-status-form select {
        width: 100%;
        min-width: 0;
    }
}


/* =========================================================
   PROJECT ACTIVITY / AUDIT TRAIL
   ========================================================= */

.activity-accordion {
    margin-top: 24px;
}

.activity-timeline {
    position: relative;
    display: grid;
    gap: 0;
}

.activity-item {
    position: relative;

    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);

    gap: 12px;

    padding: 0 0 20px;
}

.activity-item:not(:last-child)::before {
    content: "";

    position: absolute;

    left: 6px;
    top: 14px;
    bottom: -2px;

    width: 1px;

    background: var(--border);
}

.activity-marker {
    position: relative;
    z-index: 1;

    width: 13px;
    height: 13px;

    margin-top: 5px;

    border: 3px solid var(--surface, #111827);
    border-radius: 50%;

    background: var(--accent);
}

.activity-content {
    min-width: 0;

    padding: 0 0 2px;
}

.activity-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 16px;
}

.activity-action {
    font-size: .95rem;
}

.activity-entity {
    display: inline-flex;

    margin-left: 7px;
    padding: 2px 7px;

    border: 1px solid var(--border);
    border-radius: 999px;

    font-size: .68rem;
    font-weight: 700;

    color: var(--muted);
}

.activity-time {
    flex: 0 0 auto;

    font-size: .75rem;
    color: var(--muted);
}

.activity-description {
    margin-top: 5px;

    line-height: 1.5;
}

.activity-meta {
    display: flex;
    flex-wrap: wrap;

    gap: 7px 14px;

    margin-top: 7px;

    font-size: .74rem;
    color: var(--muted);
}

.activity-metadata {
    margin-top: 9px;
}

.activity-metadata > summary {
    cursor: pointer;

    font-size: .75rem;
    font-weight: 700;

    color: var(--muted);
}

.activity-metadata pre {
    overflow-x: auto;

    margin: 8px 0 0;
    padding: 10px;

    border: 1px solid var(--border);
    border-radius: 8px;

    font-size: .72rem;
    line-height: 1.45;

    white-space: pre-wrap;
    word-break: break-word;
}

html[data-theme="light"] .activity-marker {
    border-color: #fff;
}


@media (max-width: 700px) {

    .activity-head {
        display: block;
    }

    .activity-time {
        display: block;

        margin-top: 4px;
    }

    .activity-item {
        grid-template-columns: 18px minmax(0, 1fr);
        gap: 9px;
    }

    .activity-item:not(:last-child)::before {
        left: 6px;
    }
}


/* =========================================================
   ACTIVITY FILTERS
   ========================================================= */

.activity-filters {
    display: grid;

    grid-template-columns:
        minmax(260px, 1fr)
        minmax(160px, 220px)
        minmax(140px, 180px)
        auto;

    gap: 12px;

    align-items: end;

    margin-bottom: 10px;
}

.activity-filters label {
    display: block;

    margin-bottom: 5px;

    font-size: .72rem;
    font-weight: 800;

    letter-spacing: .04em;
    text-transform: uppercase;

    color: var(--muted);
}

.activity-filters input,
.activity-filters select {
    width: 100%;
}

.activity-results-summary {
    margin-bottom: 18px;
}

.activity-item[hidden] {
    display: none !important;
}


@media (max-width: 900px) {

    .activity-filters {
        grid-template-columns:
            1fr
            1fr;
    }

}


@media (max-width: 600px) {

    .activity-filters {
        grid-template-columns: 1fr;
    }

    .activity-filters .button {
        width: 100%;
    }

}


/* =========================================================
   PROJECT DOCUMENTS
   ========================================================= */

.project-document-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.project-document-upload {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.project-document-upload input[type="file"] {
    max-width: 240px;
    font-size: .78rem;
}

.project-document-list {
    display: grid;
    gap: 12px;
}

.project-document-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 24px;

    padding: 16px;

    border: 1px solid var(--border);
    border-radius: 12px;
}

.project-document-summary {
    max-width: 760px;

    margin-top: 7px;
    margin-bottom: 7px;

    font-size: .88rem;
    line-height: 1.5;

    color: var(--muted);
}


@media (max-width: 700px) {

    .project-document-card {
        display: block;
    }

    .project-document-card > div + div {
        margin-top: 14px;
    }

    .project-document-upload {
        display: grid;
        width: 100%;
    }

    .project-document-upload input[type="file"] {
        max-width: none;
        width: 100%;
    }

}


/* =========================================================
   ADMIN ACTION CENTER
   ========================================================= */

.action-center-summary {
    margin-bottom: 24px;
}

.action-center-list {
    display: grid;
    gap: 9px;
}

.action-center-item {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 13px 15px;

    border: 1px solid var(--border);
    border-radius: 11px;

    color: inherit;
    text-decoration: none;

    transition:
        border-color .15s ease,
        background .15s ease;
}

.action-center-item:hover {
    background: rgba(255,255,255,.03);
}

.action-center-client {
    margin-bottom: 3px;

    font-size: .68rem;
    font-weight: 800;

    letter-spacing: .06em;
    text-transform: uppercase;

    color: var(--muted);
}

html[data-theme="light"]
.action-center-item:hover {
    background: rgba(21,32,51,.025);
}


@media (max-width: 700px) {

    .action-center-item {
        align-items: flex-start;
        flex-direction: column;

        gap: 9px;
    }

}
