/* CathcoreCMS staff theme – warm and friendly: a coloured side menu, soft cream page, rounded cards, large touch targets.
   Bump CC_CSS_VERSION in layout.php when editing. */
:root {
    --cc-orange: #3b82f6;          /* accent blue (name kept for the rules below) */
    --cc-orange-deep: #1d4ed8;
    --cc-primary: #1e40af;          /* buttons/links: white text on it and it on the page both pass AA */
    --cc-primary-hover: #1a3591;
    --cc-ink: #1b2333;
    --cc-muted: #566072;
    --cc-line: #dde4ef;
    --cc-bg: #edf1f8;
    --cc-card: #ffffff;
    --cc-ok: #e5f6e8;     --cc-ok-ink: #165c27;
    --cc-err: #fde7e4;    --cc-err-ink: #8c1d14;
    --cc-info: #e8f1fb;   --cc-info-ink: #173a63;
    --cc-warn: #fff1cc;   --cc-warn-ink: #6b4500;
    --cc-side-w: 264px;
    --cc-radius: 18px;
    --cc-shadow: 0 1px 2px rgba(15, 30, 60, .06), 0 6px 20px rgba(15, 30, 60, .07);
    --cc-focus: 0 0 0 3px rgba(37, 99, 235, .4);
    --cc-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.cc { margin: 0; background: var(--cc-bg); color: var(--cc-ink); font: 16px/1.55 var(--cc-font); }
a { color: var(--cc-primary); }
h1, h2, h3 { line-height: 1.25; }
h2 { font-size: 1.2rem; margin: 0 0 .9rem; }
h3 { font-size: 1.05rem; margin: 0 0 .5rem; }
code { background: #eef2f8; padding: .1em .35em; border-radius: 6px; font-size: .92em; }
.cc-icon { fill: currentColor; flex: none; display: block; }
.cc-muted { color: var(--cc-muted); }
.cc-center { text-align: center; }
.cc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cc-skip { position: absolute; left: -999px; top: 0; z-index: 100; background: #fff; padding: .5rem 1rem; border-radius: 8px; }
.cc-skip:focus { left: 1rem; top: 1rem; }

/* ---- side menu */
.cc-side { position: fixed; z-index: 40; inset: 0 auto 0 0; width: var(--cc-side-w); display: flex; flex-direction: column; color: #fff;
           background: linear-gradient(170deg, #1f45b8 0%, #1a3591 55%, #142a6e 100%); padding: 1.1rem .9rem 1rem; transition: transform .22s ease; }
.cc-logo { display: block; padding: .2rem .5rem .9rem; }
.cc-logo img { display: block; width: 190px; height: auto; }
.cc-store { display: flex; align-items: center; gap: .5rem; margin: 0 .3rem 1rem; padding: .45rem .8rem; border-radius: 999px;
            background: rgba(255, 255, 255, .14); font-size: .85rem; font-weight: 600; }
.cc-store span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: .2rem; }
.cc-nav a { display: flex; align-items: center; gap: .85rem; padding: .7rem .9rem; border-radius: 14px; color: #fff; text-decoration: none;
            font-weight: 600; font-size: 1rem; }
.cc-nav a:hover { background: rgba(255, 255, 255, .12); }
.cc-nav a:focus-visible { outline: none; box-shadow: 0 0 0 3px #fff; }
.cc-nav a[aria-current="page"] { background: #fff; color: var(--cc-primary); box-shadow: 0 4px 12px rgba(10, 20, 60, .25); }
.cc-nav .cc-nav-admin { margin-top: .6rem; border-top: 1px solid rgba(255, 255, 255, .2); border-radius: 0 0 14px 14px; padding-top: .9rem; }
.cc-count { margin-left: auto; min-width: 24px; height: 24px; padding: 0 .45rem; border-radius: 12px; background: #fff; color: #1a3591;
            font-size: .78rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.cc-nav a[aria-current="page"] .cc-count { background: var(--cc-primary); color: #fff; }
.cc-me { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .7rem; padding: .9rem .6rem .2rem; border-top: 1px solid rgba(255, 255, 255, .2); }
.cc-me-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.cc-me-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-me-text small { opacity: .8; }
.cc-signout { flex-basis: 100%; display: inline-flex; align-items: center; gap: .45rem; margin-left: 52px; color: #fff; text-decoration: none;
              font-size: .88rem; font-weight: 600; opacity: .9; padding: .25rem 0; }
.cc-signout:hover { opacity: 1; text-decoration: underline; }
.cc-avatar { width: 42px; height: 42px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none;
             color: #fff; font-weight: 800; font-size: .95rem; letter-spacing: .02em; box-shadow: 0 0 0 3px rgba(255, 255, 255, .55); }
.cc-scrim { position: fixed; inset: 0; z-index: 35; background: rgba(15, 23, 42, .45); }

/* ---- main column and top bar */
.cc-main { margin-left: var(--cc-side-w); min-height: 100vh; display: flex; flex-direction: column; }
.cc-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .75rem; min-height: 72px; padding: .6rem 1.75rem;
          background: rgba(237, 241, 248, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--cc-line); }
.cc-title { margin: 0; font-size: 1.6rem; font-weight: 800; letter-spacing: -.01em; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-actions { display: flex; align-items: center; gap: .4rem; }
.cc-iconbtn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 50%;
              color: var(--cc-ink); background: none; border: 0; cursor: pointer; }
.cc-iconbtn:hover { background: rgba(37, 99, 235, .1); color: var(--cc-primary); }
.cc-iconbtn:focus-visible { outline: none; box-shadow: var(--cc-focus); }
.cc-dot { position: absolute; top: 4px; right: 3px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #d93025; color: #fff;
          font-size: 11px; font-weight: 800; line-height: 20px; text-align: center; box-shadow: 0 0 0 2px var(--cc-bg); }
.cc-burger { display: none; }
.cc-menu { position: relative; }
.cc-avatar-btn { cursor: pointer; list-style: none; width: 44px; height: 44px; box-shadow: 0 0 0 3px #fff, 0 2px 6px rgba(0, 0, 0, .15); }
.cc-avatar-btn::-webkit-details-marker { display: none; }
.cc-avatar-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px #fff, var(--cc-focus); }
.cc-menu-list { position: absolute; right: 0; top: calc(100% + 10px); z-index: 50; min-width: 230px; padding: .4rem; background: #fff;
                border-radius: 14px; box-shadow: 0 10px 30px rgba(15, 30, 60, .18); }
.cc-menu-head { display: flex; flex-direction: column; padding: .6rem .8rem .7rem; border-bottom: 1px solid var(--cc-line); margin-bottom: .3rem; }
.cc-menu-head small { color: var(--cc-muted); }
.cc-menu-list a { display: flex; align-items: center; gap: .7rem; padding: .65rem .8rem; border-radius: 10px; color: var(--cc-ink); text-decoration: none; font-weight: 500; }
.cc-menu-list a:hover { background: #eef3ff; color: var(--cc-primary); }
.cc-content { flex: 1; width: 100%; max-width: 1180px; padding: 1.75rem; }

/* ---- building blocks */
.cc-card { background: var(--cc-card); border-radius: var(--cc-radius); box-shadow: var(--cc-shadow); padding: 1.4rem 1.5rem; margin: 0 0 1.5rem; }
.cc-card-flush { padding: 0; overflow: hidden; }
.cc-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: 1rem; }
.cc-card-head h2 { margin: 0; }
.cc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; margin-bottom: 1.5rem; align-items: start; }
.cc-grid > .cc-card { margin: 0; }
.cc-hello { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; padding: 1.6rem 1.75rem; margin-bottom: 1.5rem; border-radius: 22px; color: #fff;
            background: linear-gradient(120deg, #2148bf, #1a3591 65%, #142a6e); box-shadow: 0 10px 30px rgba(30, 64, 175, .25); }
.cc-hello h2 { font-size: 1.6rem; margin: 0 0 .2rem; }
.cc-hello p { margin: 0; opacity: .95; }
.cc-hello .cc-hello-text { flex: 1; min-width: 220px; }
.cc-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.cc-tile { display: flex; align-items: center; gap: .9rem; background: #fff; border-radius: 16px; box-shadow: var(--cc-shadow); padding: 1.1rem 1.2rem;
           text-decoration: none; color: var(--cc-ink); }
.cc-tile:hover { box-shadow: 0 0 0 2px var(--cc-orange), var(--cc-shadow); }
.cc-tile .cc-icon { color: var(--cc-orange-deep); background: #e8efff; border-radius: 12px; padding: 8px; box-sizing: content-box; }
.cc-tile strong { display: block; font-size: 1.5rem; line-height: 1.1; }
.cc-tile small { color: var(--cc-muted); }
.cc-flash { border-radius: 14px; padding: .85rem 1.1rem; margin: 0 0 1.1rem; background: var(--cc-info); color: var(--cc-info-ink); }
.cc-flash-ok { background: var(--cc-ok); color: var(--cc-ok-ink); }
.cc-flash-error { background: var(--cc-err); color: var(--cc-err-ink); }
.cc-flash-warn { background: var(--cc-warn); color: var(--cc-warn-ink); }
.cc-chip { display: inline-flex; align-items: center; height: 26px; padding: 0 .7rem; border-radius: 999px; font-size: .78rem; font-weight: 700;
           background: #e9eef6; color: var(--cc-muted); white-space: nowrap; vertical-align: middle; }
.cc-chip-new { background: #dbe6ff; color: #1e3a8a; }
.cc-chip-ok { background: var(--cc-ok); color: var(--cc-ok-ink); }
.cc-chip-warn { background: var(--cc-err); color: var(--cc-err-ink); }

/* lists (inbox, memos, logs) */
.cc-list { list-style: none; margin: 0; padding: 0; }
.cc-list > li { border-top: 1px solid var(--cc-line); }
.cc-list > li:first-child { border-top: 0; }
.cc-item { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.4rem; color: inherit; text-decoration: none; }
a.cc-item:hover { background: #f6f9ff; }
.cc-item-main { flex: 1; min-width: 0; }
.cc-item-main strong, .cc-item-main span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-item-main span { color: var(--cc-muted); font-size: .92rem; }
.cc-item-meta { color: var(--cc-muted); font-size: .85rem; text-align: right; white-space: nowrap; display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; }
.cc-unread .cc-item-main strong { font-weight: 800; }
.cc-unread { box-shadow: inset 4px 0 0 var(--cc-orange); }
.cc-empty { padding: 2.2rem 1.4rem; text-align: center; color: var(--cc-muted); }

/* reading a message / memo / news post */
.cc-read h2 { font-size: 1.45rem; margin-bottom: .3rem; }
.cc-read .cc-meta { color: var(--cc-muted); margin-bottom: 1.2rem; }
.cc-body { line-height: 1.7; overflow-wrap: anywhere; }
.cc-body img { max-width: 100%; height: auto; border-radius: 10px; }
.cc-quote { border-left: 4px solid var(--cc-orange); background: #f4f8ff; border-radius: 0 12px 12px 0; padding: .8rem 1rem; margin: 1rem 0; }

/* news on the home page */
.cc-post { padding: 1.4rem 1.5rem; border-top: 1px solid var(--cc-line); }
.cc-post:first-child { border-top: 0; }
.cc-post h3 { font-size: 1.2rem; margin: 0 0 .2rem; }
.cc-post .cc-meta { color: var(--cc-muted); font-size: .88rem; margin-bottom: .6rem; }

/* tabs */
.cc-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.4rem; }
.cc-tabs a { display: inline-flex; align-items: center; gap: .45rem; padding: .55rem 1.1rem; border-radius: 999px; text-decoration: none; font-weight: 700;
             color: var(--cc-muted); background: #e6ecf6; }
.cc-tabs a:hover { color: var(--cc-primary); }
.cc-tabs a[aria-current="page"] { background: var(--cc-primary); color: #fff; }
.cc-tabs .cc-count { background: rgba(255, 255, 255, .9); color: var(--cc-primary); min-width: 22px; height: 22px; }

/* forms */
.cc-form { display: flex; flex-direction: column; gap: 1rem; }
.cc-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem 1.25rem; }
label { display: flex; flex-direction: column; gap: .4rem; font-weight: 700; font-size: .92rem; }
label small { font-weight: 400; color: var(--cc-muted); }
input, select, textarea { font: inherit; font-weight: 400; color: var(--cc-ink); background: #fff; border: 2px solid var(--cc-line); border-radius: 12px;
                          padding: .7rem .9rem; min-height: 50px; max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--cc-orange-deep); box-shadow: var(--cc-focus); }
textarea { width: 100%; resize: vertical; min-height: 150px; }
input[type=color] { padding: .3rem; width: 70px; height: 50px; cursor: pointer; }
.cc-check { flex-direction: row; align-items: center; gap: .6rem; font-weight: 600; }
.cc-check input { min-height: 0; width: 20px; height: 20px; accent-color: var(--cc-primary); }
.cc-actions-row { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; }
.cc-radios { display: flex; flex-wrap: wrap; gap: .5rem; }
.cc-radios label { flex-direction: row; align-items: center; gap: .5rem; padding: .55rem 1rem; border: 2px solid var(--cc-line); border-radius: 999px; cursor: pointer; font-weight: 600; }
.cc-radios label:has(input:checked) { border-color: var(--cc-orange-deep); background: #e8efff; color: #1e3a8a; }
.cc-radios input { min-height: 0; accent-color: var(--cc-primary); }

/* buttons */
.cc-btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 48px; padding: 0 1.4rem; border-radius: 14px;
          border: 2px solid var(--cc-line); background: #fff; color: var(--cc-ink); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.cc-btn:hover { border-color: var(--cc-orange); color: var(--cc-primary); }
.cc-btn:focus-visible { outline: none; box-shadow: var(--cc-focus); }
.cc-btn-primary { background: var(--cc-primary); border-color: var(--cc-primary); color: #fff; box-shadow: 0 4px 12px rgba(29, 78, 216, .25); }
.cc-btn-primary:hover { background: var(--cc-primary-hover); border-color: var(--cc-primary-hover); color: #fff; }
.cc-btn-danger { color: #a3261c; }
.cc-btn-danger:hover { border-color: #d93025; color: #8c1d14; background: #fff5f4; }
.cc-btn-small { min-height: 38px; padding: 0 .9rem; font-size: .9rem; border-radius: 10px; }
.cc-btn-block { width: 100%; }

/* tables (access logs) */
.cc-table-wrap { overflow-x: auto; }
.cc-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.cc-table th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--cc-muted); padding: .8rem 1.1rem; background: #f6f9ff; border-bottom: 1px solid var(--cc-line); white-space: nowrap; }
.cc-table td { padding: .75rem 1.1rem; border-bottom: 1px solid var(--cc-line); vertical-align: top; }
.cc-table tr:last-child td { border-bottom: 0; }
.cc-pager { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.4rem; }

/* ---- sign-in screen */
.cc-signin-body { min-height: 100vh; }
.cc-signin { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.cc-signin-hero { color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: center; gap: 1rem;
                  background: radial-gradient(circle at 20% 15%, rgba(255, 255, 255, .18), transparent 40%), linear-gradient(150deg, #2148bf, #1a3591 55%, #142a6e); }
.cc-signin-hero img { width: 230px; height: auto; }
.cc-signin-hero h1 { font-size: 2.4rem; margin: 1rem 0 0; letter-spacing: -.02em; }
.cc-signin-hero p { font-size: 1.15rem; margin: 0; opacity: .95; max-width: 32rem; }
.cc-signin-card { align-self: center; justify-self: center; width: min(440px, calc(100% - 2rem)); background: #fff; border-radius: 24px; box-shadow: 0 20px 50px rgba(15, 30, 60, .12); padding: 2.2rem; margin: 2rem 0; }
.cc-signin-card h2 { font-size: 1.6rem; margin-bottom: 1.2rem; }

/* ---- phones and small tablets */
@media (max-width: 960px) {
    .cc-side { transform: translateX(-100%); box-shadow: 0 0 40px rgba(0, 0, 0, .25); }
    html.cc-side-open .cc-side { transform: none; }
    .cc-main { margin-left: 0; }
    .cc-burger { display: inline-flex; }
    .cc-top { padding: .5rem .9rem; min-height: 64px; }
    .cc-title { font-size: 1.25rem; }
    .cc-content { padding: 1rem 16px 2rem; }
    .cc-card { padding: 1.1rem; border-radius: 16px; }
    .cc-item { padding: .9rem 1rem; }
    .cc-signin { grid-template-columns: 1fr; }
    .cc-signin-hero { padding: 2rem 1.5rem 3.5rem; min-height: auto; }
    .cc-signin-hero h1 { font-size: 1.7rem; }
    .cc-signin-card { margin-top: -2rem; padding: 1.6rem; }
    input, select, textarea { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.cc-edit { margin-left: .4rem; font-size: .95rem; text-decoration: none; color: var(--cc-muted); padding: .1rem .4rem; border-radius: 8px; }
.cc-edit:hover { background: #e8efff; color: var(--cc-primary); }
.cc-card h2, .cc-card-head h2 { display: flex; align-items: center; gap: .5rem; }
.cc-card h2 .cc-icon { color: var(--cc-orange-deep); }

/* ---- sign-in pop-up (visitors, site status Open) */
.cc-dialog { width: min(420px, calc(100% - 2rem)); border: 0; border-radius: 22px; padding: 2rem 2rem 1.6rem; color: var(--cc-ink);
             box-shadow: 0 24px 60px rgba(15, 30, 60, .3); }
.cc-dialog::backdrop { background: rgba(15, 23, 42, .55); backdrop-filter: blur(3px); }
.cc-dialog h2 { font-size: 1.5rem; margin: .4rem 0 1rem; }
.cc-dialog-mark { display: block; border-radius: 12px; }
.cc-dialog-close-form { position: absolute; top: .7rem; right: .7rem; margin: 0; }
.cc-dialog-close { width: 40px; height: 40px; font-size: 1.1rem; color: var(--cc-muted); }
.cc-dialog[open] { animation: cc-pop .18s ease-out; }
@keyframes cc-pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.cc-selectall { padding: .8rem 1.4rem .8rem 1.2rem; border-bottom: 1px solid var(--cc-line); background: #f6f9ff; }
.cc-selectall .cc-check { margin: 0; font-size: .92rem; }
.cc-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }   /* spam trap: hidden from people */
/* captcha on Contact us (visitors) */
.cc-captcha { display: flex; flex-direction: column; gap: .5rem; padding: 1rem; border: 2px dashed var(--cc-line); border-radius: 14px; background: #f8faff; }
.cc-captcha-label { font-weight: 700; font-size: .92rem; }
.cc-captcha-row { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.cc-captcha-row img { border-radius: 10px; border: 1px solid var(--cc-line); background: #fff; }
.cc-captcha-input { max-width: 220px; letter-spacing: .2em; text-transform: uppercase; font-weight: 700; }
