/* Marlow Digital CMS Shared Stylesheet */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&family=Rowdies:wght@300;400;700&display=swap');

:root {
    --color-bg: #f9f9f9;
    --color-text: #111827;
    --color-marlowblue: #3a5bb4;
    --color-marlowred: #b12323;
    --color-white: #ffffff;
    --color-border: #ddd;
    --color-green: #09971c;
    --color-red: #af0909;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-size: 1rem;
    font-family: 'Roboto', 'Poppins', Arial, sans-serif;
    line-height: 1.6;
    background-color: var(--color-bg);
    color: var(--color-text);
}
h1, h2, h3, h4, h5, h6 {
    font-family: 'Rowdies', sans-serif;
    color: var(--color-marlowblue);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

p {
    margin-bottom: 1rem;
}

.cms-page {
    margin: 0;
    min-height: 100vh;
    background: var(--color-bg);
    color: var(--color-text);
}

.cms-header,
.cms-footer {
    position: fixed;
    left: 0;
    width: 100vw;
    background: linear-gradient(135deg, var(--color-marlowblue) 0%, #2c4590 100%);
    color: var(--color-white);
    z-index: 1000;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
}

.cms-header {
    top: 0;
    font-family: 'Rowdies', 'Roboto', Arial, sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 1rem 0 0.75rem;
}

.cms-header-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    line-height: 1;
}

.cms-header-logo {
    display: block;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    flex-shrink: 0;
}

.cms-header-brand,
.cms-header-app {
    display: inline-flex;
    align-items: center;
}

.cms-header-brand {
    font-weight: 700;
}

.cms-header-app {
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: normal;
    opacity: 0.85;
}

.cms-header-app::before {
    content: '\2022';
    margin-right: 0.6rem;
    opacity: 0.6;
}

.cms-footer {
    bottom: 0;
    background: linear-gradient(135deg, #2c4590 0%, var(--color-marlowblue) 100%);
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 1rem;
    padding: 0.75rem 0 0.5rem;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.07);
}

.cms-main {
    min-height: calc(100vh - 120px);
    padding: 120px 24px 80px;
}

.cms-main--center {
    display: grid;
    place-items: center;
}

.cms-wrap {
    max-width: 920px;
    margin: 0 auto;
}

.cms-wrap--wide {
    max-width: 1200px;
}

.cms-panel {
    width: min(420px, 100%);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 18px 50px rgba(31, 42, 31, 0.12);
}

.cms-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 12px 30px rgba(31, 42, 31, 0.08);
}

.cms-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
}

.cms-page-intro {
    display: grid;
    gap: 4px;
}

.cms-auth-kicker {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin: 0;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    background: rgba(58, 91, 180, 0.12);
    color: var(--color-marlowblue);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 600;
}

.cms-heading {
    margin-top: 0;
    font-size: 2rem;
}

.cms-form-label {
    display: block;
    margin: 16px 0 6px;
    font-weight: 700;
}

.cms-form-input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border: 1px solid #aeb8ab;
    border-radius: 10px;
    font: inherit;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    border: 0;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}

.btn.primary {
    background-color: var(--color-marlowred);
    color: var(--color-white);
}

.btn.primary:hover {
    background-color: var(--color-marlowblue);
    color: var(--color-white);
}

.cms-button-block {
    margin-top: 18px;
    width: 100%;
}

.cms-password-field {
    position: relative;
}

.cms-password-field .cms-form-input {
    padding-right: 50px;
}

.cms-password-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #4b5a4b;
    cursor: pointer;
    display: grid;
    place-items: center;
}

.cms-password-toggle:hover {
    background: rgba(38, 70, 83, 0.08);
}

.cms-password-toggle:focus-visible {
    outline: 2px solid #264653;
    outline-offset: 2px;
}

.cms-password-toggle svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cms-password-toggle .eye-slash {
    display: none;
}

.cms-password-toggle.is-visible .eye-slash {
    display: inline;
}

.cms-password-toggle.is-visible .eye-open {
    display: none;
}

.cms-alert {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 10px;
}

.cms-alert--error {
    background: #ffeaea;
    color: var(--color-red);
}

.cms-alert--warning {
    background: #fff4d6;
    color: #8a5a00;
    border: 1px solid #f0c04a;
}

.cms-alert--success {
    display: block;
    margin-bottom: 20px;
    padding: 12px 14px;
    background: #e6f4ea;
    color: var(--color-green);
    border-radius: 12px;
}

/* CoreSite overlay.dialog contract (backdrop + panel), restyled with CMS colours. */
.dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgb(0 0 0 / 0.6);
    opacity: 0;
    visibility: hidden;
    transition: opacity 200ms ease;
}

.dialog-backdrop[hidden] {
    display: flex;
    pointer-events: none;
}

.dialog-backdrop.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.dialog-panel {
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--color-white);
    border-radius: 16px;
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04);
    padding: 2rem;
}

.dialog-panel--sm {
    max-width: 26rem;
}

.dialog-backdrop--zoom .dialog-panel {
    transform: scale(0.92);
    transition: transform 200ms ease;
}

.dialog-backdrop--zoom.is-open .dialog-panel {
    transform: scale(1);
}

.dialog-title {
    margin: 0 0 1rem;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.dialog-actions .btn:not(.primary) {
    background: #e5e7eb;
    color: var(--color-text);
}

body.dialog-open {
    overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
    .dialog-backdrop,
    .dialog-backdrop .dialog-panel {
        transition: none;
    }
}

.cms-footer-link {
    color: inherit;
    text-decoration: underline;
}

.cms-changelog h2 {
    margin-top: 1.5rem;
    font-size: 1.4rem;
}

.cms-changelog h2:first-child {
    margin-top: 0;
}

.cms-changelog h3 {
    margin: 1rem 0 0.4rem;
    font-size: 1rem;
}

.cms-changelog-list {
    margin: 0 0 0.5rem 1.25rem;
}

.cms-changelog-list li {
    margin-bottom: 0.4rem;
}

.cms-recycle-bin {
    margin-top: 24px;
}

.cms-recycle-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.cms-recycle-table th,
.cms-recycle-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    vertical-align: middle;
}

.cms-recycle-actions {
    display: flex;
    gap: 8px;
}

.cms-recycle-actions .btn {
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
}

.cms-note {
    margin-top: 16px;
    font-size: 0.95rem;
    color: #465246;
}

.cms-inline-link {
    color: var(--color-marlowblue);
    text-decoration: underline;
    font-weight: 600;
}

.cms-inline-link:hover {
    color: var(--color-marlowred);
}

.cms-list {
    padding-left: 20px;
}

.cms-user-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.cms-user-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    transition: background 0.2s, border-color 0.2s;
}

.cms-user-row:hover {
    background: rgba(58, 91, 180, 0.08);
    border-color: rgba(58, 91, 180, 0.35);
}

.cms-user-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.cms-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    padding: 0;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.cms-icon-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cms-icon-btn--edit {
    color: var(--color-marlowblue);
}

.cms-icon-btn--edit:hover {
    background: rgba(58, 91, 180, 0.14);
    border-color: rgba(58, 91, 180, 0.35);
}

.cms-icon-btn--delete {
    color: var(--color-marlowred);
}

.cms-icon-btn--delete:hover {
    background: rgba(177, 35, 35, 0.12);
    border-color: rgba(177, 35, 35, 0.32);
}

.cms-app-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.cms-app-list-item {
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-white);
}

.cms-app-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(58, 91, 180, 0.25);
    border-radius: 10px;
    text-decoration: none;
    color: var(--color-text);
    background: rgba(58, 91, 180, 0.06);
    transition: background 0.2s, border-color 0.2s;
}

.cms-app-link:hover {
    background: rgba(58, 91, 180, 0.12);
    border-color: rgba(58, 91, 180, 0.45);
}

.cms-app-link.is-disabled {
    cursor: not-allowed;
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #6b7280;
}

.cms-app-link.is-disabled .cms-app-link-icon {
    background: #f9fafb;
    border-color: #d1d5db;
}

.cms-app-link.is-disabled .cms-app-link-icon svg {
    stroke: #9ca3af;
}

.cms-app-disabled-note {
    display: block;
    margin-top: 4px;
    color: #6b7280;
}

.cms-app-link-icon {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--color-white);
    border: 1px solid rgba(58, 91, 180, 0.25);
}

.cms-app-link-icon svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: var(--color-marlowblue);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cms-app-link-text {
    font-weight: 600;
}

.cms-tree {
    list-style: none;
    margin: 0;
    padding-left: 20px;
}

.cms-tree > .cms-tree-item {
    margin-top: 6px;
}

.cms-tree-folder {
    margin: 0;
}

.cms-tree-summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cms-tree-summary::-webkit-details-marker {
    display: none;
}

.cms-tree-summary::before {
    content: '▸';
    color: var(--color-marlowblue);
    font-size: 0.9rem;
}

.cms-tree-folder[open] > .cms-tree-summary::before {
    content: '▾';
}

.cms-tree-label {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.95rem;
}

.cms-tree-icon {
    width: 18px;
    height: 18px;
    display: inline-grid;
    place-items: center;
}

.cms-tree-icon svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: var(--color-marlowblue);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cms-tree-file-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
}

.cms-tree-node {
    cursor: pointer;
}

.cms-file-manager-toolbar {
    border: 1px dashed var(--color-border);
    border-radius: 12px;
    padding: 12px;
    margin: 16px 0 18px;
    display: grid;
    gap: 12px;
}

.cms-file-manager-toolbar .cms-note {
    margin: 0;
}

.cms-toolbar-row {
    display: grid;
    align-items: center;
    gap: 10px;
}

.cms-toolbar-row--message {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
}

.cms-toolbar-row--buttons {
    grid-template-columns: repeat(4, max-content);
    justify-content: center;
    padding-bottom: 12px;
    border-bottom: 1px dotted var(--color-border);
    margin-bottom: 2px;
}

.cms-toolbar-row--action {
    grid-template-columns: 120px minmax(220px, 1fr) auto;
}

.cms-toolbar-row--action .cms-target-note {
    grid-column: 1 / -1;
    margin-top: -2px;
}

.cms-inline-input {
    width: 100%;
}

.cms-selection-note {
    color: var(--color-marlowblue);
    font-weight: 500;
    margin: 0;
}

.cms-target-note {
    color: var(--color-marlowblue);
    font-size: 0.9rem;
    margin: 0;
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

.cms-file-manager-toolbar .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.cms-btn-icon {
    width: 16px;
    height: 16px;
    display: inline-grid;
    place-items: center;
}

.cms-btn-icon svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cms-tree-node.is-selected .cms-tree-label,
.cms-tree-node.is-selected.cms-tree-summary .cms-tree-label {
    background: rgba(177, 35, 35, 0.14);
    color: var(--color-marlowred);
}

.cms-tree-node--archived .cms-tree-label {
    text-decoration: line-through;
    opacity: 0.85;
}

.cms-alert-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 2200;
    width: min(460px, calc(100vw - 36px));
    padding-top: 16px;
    padding-bottom: 16px;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.18);
    margin: 0;
    opacity: 1;
    transform: translate(-50%, -50%);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.cms-alert-toast.is-hiding {
    opacity: 0;
    transform: translate(-50%, -58%);
}

@media (max-width: 600px) {
    .cms-header,
    .cms-footer {
        font-size: 1rem;
        padding: 0.5rem 0;
    }

    .cms-header-inner {
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    .cms-header-logo {
        width: 26px;
        height: 26px;
    }

    .cms-header-app {
        width: 100%;
        justify-content: center;
    }

    .cms-header-app::before {
        content: none;
    }

    .cms-main {
        min-height: calc(100vh - 96px);
        padding: 90px 8px 60px;
    }

    .cms-page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .cms-toolbar-row--message,
    .cms-toolbar-row--buttons,
    .cms-toolbar-row--action {
        grid-template-columns: 1fr;
    }
}


.cms-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.cms-section-heading p {
    margin-bottom: 0;
}

.cms-activity-detail {
    margin-top: 28px;
}

.cms-activity-detail h3 {
    margin-top: 28px;
}

.cms-activity-table-wrap {
    overflow-x: auto;
    margin-top: 16px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
}

.cms-activity-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
}

.cms-activity-table th,
.cms-activity-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    vertical-align: middle;
}

.cms-activity-table th {
    background: var(--color-bg);
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.cms-activity-table td {
    font-size: 0.95rem;
}

.cms-activity-table td small {
    display: block;
    margin-top: 2px;
    color: #6b7280;
    font-size: 0.85rem;
}

.cms-activity-table tbody tr:last-child td {
    border-bottom: none;
}

.cms-activity-table tbody tr:nth-child(even) {
    background: rgba(58, 91, 180, 0.025);
}

.cms-activity-table tbody tr:hover {
    background: rgba(58, 91, 180, 0.06);
}

.cms-activity-table td.cms-activity-table-numeric,
.cms-activity-table th.cms-activity-table-numeric {
    text-align: right;
}

.cms-activity-table td.cms-activity-table-nowrap {
    white-space: nowrap;
}

@media (max-width: 700px) {
    .cms-section-heading {
        display: block;
    }

    .cms-section-heading .cms-inline-link {
        display: inline-block;
        margin-top: 8px;
    }
}
