:root {
    --km-primary: var(--theme-primary, #164e3f);
    --km-accent: var(--theme-accent, #9b0b62);
    --km-gold: var(--theme-highlight, #d2a94f);
    --km-amber: #d97706;
    --km-ink: #1e293b;
    --km-muted: #64748b;
    --km-line: #e2e8f0;
}

.km-page {
    padding: 0.5rem 0 2rem;
}

/* Breadcrumb */
.km-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    font-size: 0.88rem;
    color: var(--km-muted);
}
.km-breadcrumb a {
    color: var(--km-muted);
    text-decoration: none;
    transition: color 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.km-breadcrumb a:hover {
    color: var(--km-primary);
}
.km-breadcrumb i.bi-chevron-right {
    font-size: 0.72rem;
    opacity: 0.6;
}
.km-breadcrumb span {
    color: var(--km-ink);
    font-weight: 600;
}

/* Hero Section */
.km-hero {
    position: relative;
    display: flex;
    min-height: 280px;
    padding: clamp(2rem, 4vw, 3.5rem);
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    overflow: hidden;
    color: #ffffff;
    background: linear-gradient(135deg, var(--km-primary) 0%, #153e34 100%);
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(22, 78, 63, 0.12);
    margin-bottom: 2rem;
}
.km-hero::after {
    content: "";
    position: absolute;
    top: -50px;
    right: -50px;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(210, 169, 79, 0.2) 0%, transparent 70%);
    pointer-events: none;
}
.km-hero-copy {
    position: relative;
    z-index: 1;
    max-width: 800px;
}
.km-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.85rem;
}
.km-hero-badge i {
    color: var(--km-gold);
}
.km-hero h1 {
    margin: 0 0 0.75rem;
    color: #ffffff;
    font-size: clamp(1.85rem, 3.8vw, 2.75rem);
    font-weight: 700;
    line-height: 1.25;
}
.km-hero p {
    margin: 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: clamp(0.95rem, 1.8vw, 1.12rem);
    line-height: 1.65;
}
.km-hero-mark {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.9);
    font-size: 4rem;
    flex-shrink: 0;
}

/* Category Filter Tabs */
.km-nav-tabs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #ffffff;
    border: 1px solid var(--km-line);
    border-radius: 0.85rem;
    margin-bottom: 2.25rem;
    overflow-x: auto;
    scrollbar-width: thin;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}
.km-nav-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.65rem 1.15rem;
    border-radius: 0.6rem;
    color: var(--km-muted);
    background: transparent;
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease;
    cursor: pointer;
}
.km-nav-tab:hover {
    color: var(--km-primary);
    background: #f1f5f9;
}
.km-nav-tab.active {
    color: #ffffff !important;
    background: var(--km-primary) !important;
    box-shadow: 0 4px 12px rgba(22, 78, 63, 0.2);
}
.km-nav-tab .tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 700;
    background: #e2e8f0;
    color: #475569;
}
.km-nav-tab.active .tab-count {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

/* Best Practices Highlights */
.km-section-header {
    margin-bottom: 1.5rem;
    text-align: left;
}
.km-section-header span {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--km-accent);
    text-transform: uppercase;
}
.km-section-header h2 {
    margin: 0.35rem 0 0.5rem;
    color: var(--km-primary);
    font-size: clamp(1.4rem, 2.5vw, 1.9rem);
    font-weight: 700;
}
.km-section-header p {
    margin: 0;
    color: var(--km-muted);
    font-size: 0.92rem;
}

.km-bp-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 3rem;
}
.km-bp-card {
    position: relative;
    padding: 1.75rem 1.5rem;
    background: #ffffff;
    border: 1px solid var(--km-line);
    border-radius: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
}
.km-bp-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
    border-color: #cbd5e1;
}
.km-bp-category {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: 4px;
    background: #eef5f2;
    color: var(--km-primary);
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.85rem;
    align-self: flex-start;
}
.km-bp-card h3 {
    margin: 0 0 0.75rem;
    color: var(--km-ink);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.45;
}
.km-bp-card p {
    margin: 0 0 1rem;
    color: var(--km-muted);
    font-size: 0.85rem;
    line-height: 1.65;
    flex-grow: 1;
}
.km-bp-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.85rem;
    border-top: 1px dashed var(--km-line);
    font-size: 0.8rem;
    color: #64748b;
}

/* KM Process 7 Steps */
.km-process-section {
    padding: 2.5rem;
    background: #ffffff;
    border: 1px solid var(--km-line);
    border-radius: 1rem;
    margin-bottom: 3rem;
}
.km-process-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.75rem;
}
.km-process-step {
    text-align: center;
    padding: 1rem 0.5rem;
    background: #f8fafc;
    border: 1px solid var(--km-line);
    border-radius: 0.75rem;
    transition: all 0.2s ease;
}
.km-process-step:hover {
    background: #eef5f2;
    border-color: var(--km-primary);
    transform: translateY(-2px);
}
.km-process-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--km-primary);
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.km-process-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--km-ink);
    margin-bottom: 0.25rem;
    line-height: 1.35;
}
.km-process-desc {
    font-size: 0.72rem;
    color: var(--km-muted);
    line-height: 1.4;
}

/* Document Cards */
.km-section {
    margin-bottom: 3rem;
    scroll-margin-top: 140px;
}
.km-section-title-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1rem;
    margin-bottom: 1.25rem;
    border-bottom: 2px solid #e2e8f0;
}
.km-section-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.km-section-title-wrap i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 0.65rem;
    background: var(--km-primary);
    color: #ffffff;
    font-size: 1.2rem;
}
.km-section-title-wrap h2 {
    margin: 0;
    color: var(--km-ink);
    font-size: 1.35rem;
    font-weight: 700;
}
.km-section-title-wrap small {
    display: block;
    color: var(--km-muted);
    font-size: 0.82rem;
    margin-top: 0.15rem;
}

.km-docs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}
.km-doc-card {
    display: flex;
    align-items: flex-start;
    gap: 1.15rem;
    padding: 1.25rem;
    background: #ffffff;
    border: 1px solid var(--km-line);
    border-radius: 0.85rem;
    transition: all 0.2s ease;
}
.km-doc-card:hover {
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
    border-color: #cbd5e1;
    transform: translateY(-2px);
}
.km-doc-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 54px;
    border-radius: 0.5rem;
    flex-shrink: 0;
    font-size: 1.4rem;
}
.km-doc-icon.is-pdf { background: #fee2e2; color: #dc2626; }
.km-doc-icon.is-word { background: #dbeafe; color: #2563eb; }
.km-doc-icon.is-excel { background: #dcfce7; color: #16a34a; }
.km-doc-icon.is-file { background: #f1f5f9; color: #64748b; }
.km-doc-icon small { font-size: 0.62rem; font-weight: 700; margin-top: -2px; }
.km-doc-content { flex-grow: 1; min-width: 0; }
.km-doc-title {
    margin: 0 0 0.35rem;
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--km-ink);
    line-height: 1.4;
    word-break: break-word;
}
.km-doc-desc {
    margin: 0 0 0.65rem;
    font-size: 0.82rem;
    color: var(--km-muted);
    line-height: 1.5;
}
.km-doc-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.78rem;
    color: #94a3b8;
    margin-bottom: 0.75rem;
}
.km-doc-meta span { display: inline-flex; align-items: center; gap: 0.25rem; }
.km-doc-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.km-btn-preview {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    border-radius: 0.45rem;
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
    cursor: pointer;
}
.km-btn-preview:hover { background: #e2e8f0; color: var(--km-ink); }
.km-btn-download {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    border-radius: 0.45rem;
    background: var(--km-primary);
    color: #ffffff;
    border: none;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
}
.km-btn-download:hover { background: #0f372c; color: #ffffff; }

/* Empty state */
.km-empty-card {
    padding: 2rem;
    background: #ffffff;
    border: 1px dashed #cbd5e1;
    border-radius: 0.85rem;
    text-align: center;
}
.km-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #f8fafc;
    color: var(--km-primary);
    font-size: 1.8rem;
    margin-bottom: 0.85rem;
}
.km-empty-card h4 {
    margin: 0 0 0.35rem;
    color: var(--km-ink);
    font-size: 1.05rem;
    font-weight: 600;
}
.km-empty-card p {
    margin: 0 0 1rem;
    color: var(--km-muted);
    font-size: 0.85rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* SNRU KM Portal Banner */
.km-portal-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 2rem 2.5rem;
    background: linear-gradient(135deg, #1e3a8a 0%, #1e1b4b 100%);
    border-radius: 1rem;
    color: #ffffff;
}
.km-portal-banner h3 {
    margin: 0 0 0.35rem;
    font-size: 1.35rem;
    font-weight: 700;
}
.km-portal-banner p {
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.9rem;
}
.km-portal-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.7rem 1.4rem;
    border-radius: 0.5rem;
    background: #ffffff;
    color: #1e3a8a;
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.km-portal-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
    transform: translateY(-2px);
}

/* Document Preview Link & Card Enhancements */
.km-doc-title-link {
    color: var(--km-ink);
    text-decoration: none;
    transition: color 0.15s ease;
}
.km-doc-title-link:hover {
    color: var(--km-primary);
}
.km-doc-icon {
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.km-doc-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.12);
}
.km-doc-icon.is-image { background: #fdf2f8; color: #db2777; }
.km-doc-icon.is-ppt { background: #ffedd5; color: #ea580c; }

/* KM Quick Search Bar */
.km-search-wrap {
    max-width: 680px;
    margin: 0 auto 2rem;
}
.km-search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 9999px;
    padding: 0.35rem 1rem 0.35rem 1.25rem;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.04);
    transition: all 0.2s ease;
}
.km-search-box:focus-within {
    border-color: var(--km-primary);
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.15);
}
.km-search-icon {
    color: #94a3b8;
    font-size: 1.1rem;
    margin-right: 0.75rem;
}
.km-search-input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 0.95rem;
    background: transparent;
    color: var(--km-ink);
}
.km-search-clear {
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
}
.km-search-clear:hover { color: #475569; }
.km-search-feedback {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #64748b;
    text-align: center;
}
.km-att-badge {
    font-size: 0.78rem;
    border-radius: 6px;
    text-decoration: none;
    background: #f8fafc;
    transition: all 0.15s ease;
}
.km-att-badge:hover {
    background: #e2e8f0;
    color: var(--km-primary);
    border-color: #cbd5e1;
}

/* Responsive */
@media (max-width: 1199.98px) {
    .km-bp-grid { grid-template-columns: repeat(2, 1fr); }
    .km-process-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 991.98px) {
    .km-docs-grid { grid-template-columns: 1fr; }
    .km-portal-banner { flex-direction: column; align-items: flex-start; padding: 1.75rem; }
    .km-portal-btn { width: 100%; justify-content: center; }
}

@media (max-width: 767.98px) {
    .km-hero { padding: 1.75rem; min-height: auto; }
    .km-hero-mark { display: none; }
    .km-bp-grid { grid-template-columns: 1fr; }
    .km-process-grid { grid-template-columns: repeat(2, 1fr); }
    .km-process-section { padding: 1.5rem; }
}

