/* ============================================================
   KCFCAI SHARED STYLESHEET
   One file, linked from every page, so sizing/spacing only ever
   needs fixing in ONE place going forward -- not 60+ files.
   Keeps the existing brand colors; fixes readability/touch-size.
   ============================================================ */

:root {
    --paper: #FAF6EC;
    --paper-dim: #F0E9D8;
    --ink: #26221D;
    --ink-soft: #5C5548;
    --forest: #2F4B3C;
    --forest-deep: #1D3129;
    --marigold: #E8A33D;
    --marigold-deep: #C6811F;
    --clay: #B24C3D;
    --line: #DCD3BC;
}

* { box-sizing: border-box; }

body {
    font-family: Arial, -apple-system, sans-serif;
    background: var(--paper);
    color: var(--ink);
    margin: 0;
    padding: 24px 16px;
    font-size: 17px;
    line-height: 1.55;
}

.wrap {
    width: 100%;
}

h1 { font-size: 26px; color: var(--forest-deep); margin: 0 0 10px; }
h2 { font-size: 18px; color: var(--forest-deep); }
h2.section-title {
    font-size: 15px;
    color: var(--marigold-deep);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin: 20px 0 12px;
}

a { color: var(--forest); }

label {
    display: block;
    font-size: 15px;
    font-weight: bold;
    color: var(--ink-soft);
    margin: 14px 0 6px;
}

input, select, textarea {
    width: 100%;
    padding: 14px 14px;
    border: 1.5px solid var(--line);
    border-radius: 8px;
    font-size: 17px;
    font-family: inherit;
    box-sizing: border-box;
    min-height: 48px;
}
textarea { min-height: unset; resize: vertical; }

button, .btn, .link-btn {
    display: inline-block;
    padding: 14px 22px;
    background: var(--forest);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    min-height: 48px;
}
button:hover, .btn:hover, .link-btn:hover { background: var(--forest-deep); }
.btn-secondary, .link-btn.secondary {
    background: transparent;
    color: var(--forest);
    border: 1.5px solid var(--forest);
}

/* ============================================================
   SLIM / SECONDARY BUTTONS
   For inline, in-context actions that shouldn't compete with a
   page's real primary action -- "View Details", "Edit", "Delete",
   "Check Status", pagination links, etc. Deliberately NOT the
   default for a bare <button>, since most primary Save/Submit
   buttons across the site rely on that default staying bold and
   full-size. Apply this class explicitly wherever a button is a
   secondary/utility action, not the main thing on the page.
   Uses !important throughout because it targets <button> elements,
   which the base `button` rule above already claims with equal
   selector weight -- without !important, source order alone would
   decide the winner inconsistently depending on where this class
   is loaded relative to other page-level styles.
   ============================================================ */
button.btn-slim, a.btn-slim, .btn-slim {
    display: inline-block !important;
    font-size: 12.5px !important;
    font-weight: bold !important;
    font-family: inherit !important;
    line-height: normal !important;
    padding: 4px 11px !important;
    margin: 0 !important;
    border-radius: 6px !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    box-shadow: none !important;
    min-height: 0 !important;
    height: auto !important;
    width: auto !important;
    text-decoration: none !important;
    background: transparent !important;
    color: var(--forest) !important;
    border: 1.5px solid var(--forest) !important;
}
button.btn-slim:hover, a.btn-slim:hover, .btn-slim:hover {
    background: var(--forest) !important;
    color: white !important;
}
/* Danger variant -- Delete/Remove actions specifically */
button.btn-slim.btn-slim-danger, a.btn-slim.btn-slim-danger, .btn-slim-danger {
    color: var(--clay) !important;
    border-color: var(--clay) !important;
}
button.btn-slim.btn-slim-danger:hover, a.btn-slim.btn-slim-danger:hover, .btn-slim-danger:hover {
    background: var(--clay) !important;
    color: white !important;
}

.top-links { font-size: 15px; margin-bottom: 18px; }
.top-links a { color: var(--forest); margin-right: 16px; }

.message, .success {
    background: #EEF4EE; border: 1px solid var(--forest); color: var(--forest-deep);
    padding: 14px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 15.5px;
}
.errors {
    background: #FCEDEA; border: 1px solid var(--clay); color: var(--clay);
    padding: 14px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 15.5px;
}

.card, .box {
    background: white;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 16px;
}

table { font-size: 15.5px; }
table th, table td { padding: 10px 8px; }

.role-badge, .tag {
    display: inline-block;
    font-size: 12.5px;
    font-weight: bold;
    padding: 5px 12px;
    border-radius: 14px;
    background: #EEF4EE;
    border: 1px solid var(--forest);
    color: var(--forest-deep);
    margin: 3px 4px 3px 0;
}

/* ============================================================
   BLOG POST CARDS
   Shared between blog.php's listing grid and the Dashboard's
   single latest/featured post widget, so both always look
   identical without duplicating the CSS in two places.
   ============================================================ */
.post-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 900px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .post-grid { grid-template-columns: 1fr; } }
.post-card { background: white; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.post-card a.post-link { text-decoration: none; color: inherit; display: block; height: 100%; }
.post-card img.cover { width: 100%; height: 160px; object-fit: cover; display: block; background: var(--paper-dim); }
.post-card img.cover.placeholder { object-fit: contain; padding: 24px; background: var(--paper); }
.post-card .content { padding: 14px 16px; }
.post-card .title {
    font-size: 15px; font-weight: bold; color: var(--forest-deep); line-height: 1.35;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; min-height: 2.7em;
}
.post-card .meta { font-size: 11px; color: var(--ink-soft); margin-top: 6px; }
.post-card .tag { font-size: 10px; padding: 2px 8px; margin-right: 6px; margin-bottom: 6px; }
.post-card .tag.national { background: #FEF6E8; color: #7A5B1D; border-color: var(--marigold); }
.post-card .tag.sector { background: #EEF4EE; color: var(--forest-deep); border-color: var(--forest); }
.post-card .tag.draft { background: var(--paper-dim); color: var(--ink-soft); border-color: var(--line); }
.post-card .tag.featured { background: var(--marigold); color: var(--forest-deep); border-color: var(--marigold-deep); }

@media (max-width: 480px) {
    body { padding: 18px 12px; font-size: 17px; }
    h1 { font-size: 22px; }
}

/* ============================================================
   SITE HEADER / FOOTER / WIDGET LAYOUT
   ============================================================ */
body.has-chrome { padding: 0; }

.preview-mode-bar {
    background: var(--marigold);
    color: var(--forest-deep);
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    padding: 10px 16px;
    position: sticky;
    top: 0;
    z-index: 200;
}
.preview-mode-bar a {
    color: var(--forest-deep);
    text-decoration: underline;
    margin-left: 10px;
}

.site-header {
    background: var(--forest);
    width: 100%;
}
.site-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.site-logo { display: flex; align-items: center; gap: 12px; text-decoration: none; color: white; font-weight: bold; font-size: 22px; }
.site-logo img { width: 56px; height: 56px; object-fit: contain; }

.site-nav { position: relative; }
.site-nav summary {
    list-style: none;
    cursor: pointer;
    color: white;
    font-weight: bold;
    font-size: 15px;
    padding: 10px 16px;
    border: 1.5px solid rgba(255,255,255,.4);
    border-radius: 8px;
}
.site-nav summary::-webkit-details-marker { display: none; }
.site-nav[open] summary { background: rgba(255,255,255,.12); }
.site-nav-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: white;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 18px;
    display: flex;
    gap: 26px;
    flex-wrap: wrap;
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
    z-index: 100;
    min-width: 280px;
}
.nav-col { min-width: 150px; }
.nav-col-title { font-size: 12px; font-weight: bold; color: var(--marigold-deep); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.nav-col a { display: block; font-size: 15px; color: var(--ink); padding: 6px 0; text-decoration: none; }
.nav-col a:hover { color: var(--forest); }
.nav-close { display: none; }

.site-user { display: flex; align-items: center; gap: 14px; }
.site-user-link { display: flex; align-items: center; gap: 10px; text-decoration: none; color: white; font-weight: bold; font-size: 16px; }
.site-user-avatar { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; border: 2.5px solid var(--marigold); }
.site-user-avatar.placeholder { background: rgba(255,255,255,.25); }
.site-logout { color: rgba(255,255,255,.85); font-size: 13.5px; text-decoration: none; border: 1px solid rgba(255,255,255,.4); padding: 6px 12px; border-radius: 7px; }
.site-logout:hover { background: rgba(255,255,255,.12); }

.page-body {
    width: 90%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 28px 0 40px;
}

.widget-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}
.widget {
    background: white;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 22px;
}
.widget-title {
    font-size: 13px;
    color: var(--marigold-deep);
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: bold;
    margin-bottom: 14px;
}

.site-footer { background: var(--forest-deep); color: rgba(255,255,255,.85); width: 100%; margin-top: 40px; }
.site-footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 24px;
}
.site-footer-inner strong { color: var(--marigold); font-size: 17px; }
.site-footer-inner p { font-size: 13.5px; line-height: 1.6; margin: 8px 0 0; }
.footer-title { font-size: 12px; color: var(--marigold); text-transform: uppercase; letter-spacing: .05em; font-weight: bold; margin-bottom: 10px; }
.site-footer a { display: block; color: rgba(255,255,255,.85); font-size: 14px; text-decoration: none; padding: 4px 0; }
.site-footer a:hover { color: var(--marigold); }
.site-footer-bottom { text-align: center; font-size: 12.5px; padding: 16px; border-top: 1px solid rgba(255,255,255,.15); }

@media (max-width: 700px) {
    .site-header-inner { flex-wrap: wrap; padding: 14px 16px; }
    .site-user span { display: none; }
    .site-logo span { display: none; }
    .site-logo img { width: 44px; height: 44px; }
    .site-user-avatar { width: 40px; height: 40px; }

    .site-nav-panel {
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        width: 100%;
        max-width: none;
        min-width: 0;
        border-radius: 0;
        margin: 0;
        overflow-y: auto;
        flex-direction: column;
        gap: 20px;
    }
    .nav-col { min-width: 0; }
    .nav-close {
        display: block;
        font-size: 16px;
        font-weight: bold;
        color: var(--clay);
        text-decoration: none;
        padding-bottom: 10px;
        border-bottom: 1px solid var(--line);
        margin-bottom: 4px;
    }

    .page-body { width: 94%; padding: 20px 0 32px; }
    .site-footer-inner { padding: 26px 18px; }
    .widget-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   SITE HEADER / FOOTER / MAIN LAYOUT
   ============================================================ */
body.has-chrome { padding: 0; }

.site-header {
    background: var(--forest-deep);
    width: 100%;
}
.site-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
}
.site-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.site-logo img { width: 38px; height: 38px; object-fit: contain; }
.site-logo span { color: white; font-weight: bold; font-size: 18px; letter-spacing: .03em; }

.site-header-right { display: flex; align-items: center; gap: 14px; }
.header-profile { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.header-profile img, .header-avatar-placeholder {
    width: 34px; height: 34px; border-radius: 50%; object-fit: cover;
    border: 2px solid var(--marigold); background: rgba(255,255,255,.15);
}
.header-name { color: white; font-weight: bold; font-size: 15px; }
.header-logout { color: var(--marigold); font-size: 22px; text-decoration: none; line-height: 1; }

.nav-toggle {
    display: none; flex-direction: column; justify-content: center; gap: 5px;
    background: none; border: none; cursor: pointer; padding: 8px; min-height: unset;
}
.nav-toggle span { width: 24px; height: 2.5px; background: white; border-radius: 2px; }

.site-nav-panel {
    background: var(--forest);
    display: flex; flex-wrap: wrap; gap: 4px;
    max-width: 1100px; margin: 0 auto; padding: 8px 20px 12px;
}
.site-nav-panel a {
    color: white; text-decoration: none; font-size: 14.5px; font-weight: bold;
    padding: 8px 14px; border-radius: 8px;
}
.site-nav-panel a:hover { background: rgba(255,255,255,.12); }

@media (max-width: 700px) {
    .header-name { display: none; }
    .nav-toggle { display: flex; }
    .site-nav-panel { display: none; flex-direction: column; }
    .site-nav-panel.open { display: flex; }
}

.main-content {
    width: 90%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 28px 0 40px;
}

.widget {
    background: white;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 22px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(29,49,41,.05);
}
.widget-title {
    font-size: 13px; color: var(--marigold-deep); text-transform: uppercase;
    letter-spacing: .05em; font-weight: bold; margin-bottom: 14px;
}


.stat-tile { flex: 1; min-width: 110px; background: var(--paper-dim); border-radius: 12px; padding: 14px; text-align: center; }
.stat-tile .num { font-size: 24px; font-weight: bold; color: var(--forest); }
.stat-tile .label { font-size: 11.5px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .03em; }

.site-footer { background: var(--forest-deep); color: #F0E9D8; margin-top: 40px; }
.site-footer-inner {
    max-width: 1100px; margin: 0 auto; padding: 32px 20px;
    display: flex; flex-wrap: wrap; gap: 28px; justify-content: space-between;
}
.footer-col { flex: 1; min-width: 180px; font-size: 14px; line-height: 1.9; }
.footer-col a { display: block; color: #F0E9D8; text-decoration: none; }
.footer-col a:hover { color: var(--marigold); }
.footer-logo { color: white; font-weight: bold; font-size: 15px; }
.footer-tagline { color: var(--marigold); font-weight: bold; font-size: 12.5px; margin-bottom: 8px; }
.footer-copy { font-size: 12px; color: #B7AF98; margin-top: 8px; }
.footer-heading { color: var(--marigold); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; font-weight: bold; margin-bottom: 8px; }
