/* UpdateNotes SaaS theme */
.upn-page {
    --upn-bg-top: #f7fbff;
    --upn-bg-bottom: #eff5ff;
    --upn-surface: #ffffff;
    --upn-border: #d8e4f4;
    --upn-border-strong: #c5d6ef;
    --upn-text: #1f2d45;
    --upn-muted: #60748f;
    --upn-primary: #2563eb;
    --upn-primary-strong: #1d4ed8;
    --upn-shadow-sm: 0 10px 28px rgba(22, 44, 87, 0.1);
    font-family: "Manrope", "Plus Jakarta Sans", "Avenir Next", "Segoe UI", sans-serif;
    color: var(--upn-text);
}

.upn-surface {
    background:
        radial-gradient(900px 260px at 50% -120px, #dceaff 0%, transparent 72%),
        linear-gradient(180deg, var(--upn-bg-top), var(--upn-bg-bottom));
    border-radius: 14px;
    padding-top: .95rem;
    padding-bottom: .25rem;
    padding-inline: .5rem;
}

.upn-page .container-narrow {
    max-width: 900px;
    margin-inline: auto;
}

.upn-page .upn-page-header {
    margin-top: .35rem;
    margin-bottom: 1rem !important;
}

.upn-page .upn-list-wrap,
.upn-page.upn-detail-wrap {
    max-width: 860px;
    margin-inline: auto;
    width: 100%;
}

.upn-page .container-narrow.container-narrow-sm {
    max-width: 720px;
}

.upn-page .card {
    border: 1px solid var(--upn-border);
    border-radius: 1rem;
    background: var(--upn-surface);
    box-shadow: var(--upn-shadow-sm);
}

.upn-page .card-title,
.upn-page h2,
.upn-page h3,
.upn-page h4,
.upn-page h5 {
    color: #112743;
    letter-spacing: .01em;
}

.upn-page .text-muted,
.upn-page .small {
    color: var(--upn-muted) !important;
}

.upn-page .form-control,
.upn-page .form-select {
    border-color: var(--upn-border-strong);
    border-radius: 10px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85);
}

.upn-page .form-control:focus,
.upn-page .form-select:focus {
    border-color: #7da6ff;
    box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .15);
}

.upn-page .btn {
    border-radius: 10px;
    font-weight: 700;
    letter-spacing: .01em;
}

.upn-page .btn-primary {
    border-color: transparent;
    background: linear-gradient(180deg, #3576f4 0%, var(--upn-primary) 100%);
    box-shadow: 0 8px 18px rgba(37, 99, 235, .24);
}

.upn-page .btn-primary:hover {
    background: linear-gradient(180deg, #2f6cea 0%, var(--upn-primary-strong) 100%);
}

.upn-page .btn-secondary {
    border-color: transparent;
    background: linear-gradient(180deg, #728cab 0%, #5d789b 100%);
}

.upn-page .btn-outline-secondary {
    border-color: #bfd1e9;
    color: #35567d;
    background: #f9fbff;
}

.upn-page .btn-outline-danger {
    border-color: #ecb3bb;
}

.upn-page .btn-link {
    color: #2957b8;
}

.upn-page .title-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.upn-page .hover-lift {
    transition: transform .12s ease, box-shadow .12s ease;
    border-radius: 1rem;
}

.upn-page .hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 .75rem 1.25rem rgba(20, 45, 89, .12) !important;
}

.upn-page .content-preview {
    position: relative;
    overflow: hidden;
    max-height: 260px;
    min-height: 170px;
    padding-bottom: 6px;
}

.upn-page .content-preview:after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 48px;
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,1));
}

.upn-page .content-preview img {
    display: block;
    max-width: 100%;
    max-height: 180px;
    width: auto;
    height: auto !important;
    margin: .5rem auto;
    object-fit: contain;
}

.upn-page .content-preview img.index-auto-capped {
    max-height: 160px;
}

.upn-page .content-preview h1,
.upn-page .content-preview h2,
.upn-page .content-preview h3,
.upn-page .content-preview h4,
.upn-page .content-preview h5,
.upn-page .content-preview h6,
.upn-page .content-preview p,
.upn-page .content-preview ul,
.upn-page .content-preview ol {
    margin-bottom: .5rem;
}

.upn-page .upn-list-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .7rem;
}

.upn-page .upn-list-preview-thumb {
    width: 320px;
    max-width: 100%;
    height: 200px;
    flex: 0 0 auto;
    border: 1px solid var(--upn-border);
    border-radius: .7rem;
    background: #f8fbff;
    overflow: hidden;
}

.upn-page .upn-list-preview-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.upn-page .upn-list-preview-text {
    min-width: 0;
    color: #1f4ea8;
    font-size: 1.03rem;
    line-height: 1.5;
    text-align: left;
    width: 100%;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 768px) {
    .upn-page .content-preview {
        max-height: 220px;
        min-height: 150px;
    }

    .upn-page .content-preview img {
        max-height: 140px;
    }

    .upn-page .upn-list-preview {
        gap: .6rem;
    }

    .upn-page .upn-list-preview-thumb {
        width: 100%;
        max-width: 280px;
        height: 160px;
        flex-basis: auto;
    }

    .upn-page .upn-list-preview-text {
        font-size: .96rem;
    }
}

.upn-page .upn-fab-create {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1030;
}

.upn-page .content-body {
    font-size: 1.05rem;
    line-height: 1.7;
}

/* Create/Edit editor */
.upn-page .editor {
    min-height: 280px;
    border: 1px solid #d5e1f3;
    border-radius: .65rem;
    padding: 1rem;
    background: #fff;
}

.upn-page .editor:focus {
    outline: none;
    border-color: #86b7fe;
    box-shadow: 0 0 0 .2rem rgba(13,110,253,.1);
}

.upn-page .editor img {
    max-width: 100%;
    height: auto;
    cursor: pointer;
}

.upn-page .upn-editor-img {
    max-width: 100%;
    height: auto;
}

.upn-page .toolbar .btn {
    border-radius: .55rem;
}

.upn-page .img-tools {
    position: absolute;
    z-index: 1050;
    background: #fff;
    border: 1px solid #d8e3f3;
    border-radius: .65rem;
    padding: .5rem .75rem;
    box-shadow: 0 .75rem 1.5rem rgba(0,0,0,.12);
    display: none;
}

.upn-page .img-tools .form-range {
    width: 180px;
}

.upn-page .img-tools .btn {
    --bs-btn-padding-y: .125rem;
    --bs-btn-padding-x: .5rem;
}

/* Image manager */
.upn-page .upn-uploader {
    min-height: 120px;
}

.upn-page .upn-manage-thumb {
    width: 140px;
    height: auto;
    max-height: 120px;
    object-fit: contain;
}

/* Optional modal polish for future UpdateNotes modals */
.upn-page .modal-content {
    border: 1px solid #d6e3f5;
    border-radius: 16px;
    box-shadow: 0 20px 46px rgba(20, 44, 84, .2);
}

.upn-page .modal-header {
    background: linear-gradient(180deg, #ebf3ff 0%, #f6faff 100%);
    border-bottom: 1px solid #d6e2f5;
}

.upn-page .modal-footer {
    background: #f7fbff;
    border-top: 1px solid #dbe6f6;
}
