/* =========================================================
   SiMas — sistem informasi ormas Pesisir Selatan
   Design language: compact administrative portal, flat,
   hairline borders, restrained emerald palette.
   ========================================================= */

:root {
    --c-primary: #0f6b52;
    --c-primary-600: #0b5541;
    --c-primary-050: #e9f2ee;
    --c-accent: #b26a1c;
    --c-ink: #16211d;
    --c-text: #33403b;
    --c-muted: #6a7873;
    --c-line: #e2e7e4;
    --c-line-2: #eef1ef;
    --c-surface: #ffffff;
    --c-bg: #f3f5f4;
    --radius: 8px;
    --radius-sm: 6px;
    --nav-h: 56px;
    --shadow-sm: 0 1px 2px rgba(22, 33, 29, .05);
    --shadow: 0 4px 16px rgba(22, 33, 29, .07);

    /* legacy aliases still referenced by admin inline styles */
    --sidomas-primary: var(--c-primary);
    --sidomas-primary-dark: var(--c-primary-600);
    --sidomas-accent: var(--c-accent);
}

* { font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }

html { font-size: 15px; }

body {
    background: var(--c-bg);
    color: var(--c-text);
    margin: 0;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.005em;
}

a { color: var(--c-primary); text-decoration: none; }
a:hover { color: var(--c-primary-600); }

.text-muted, .text-secondary { color: var(--c-muted) !important; }

/* Bootstrap green utilities → project emerald (cohesion without editing every view) */
.text-success { color: var(--c-primary) !important; }
.bg-success { background-color: var(--c-primary) !important; }
.border-success { border-color: var(--c-primary) !important; }
.btn-success { background-color: var(--c-primary); border-color: var(--c-primary); }
.btn-success:hover { background-color: var(--c-primary-600); border-color: var(--c-primary-600); }
.bg-success-subtle { background-color: var(--c-primary-050) !important; }
.text-bg-success { background-color: var(--c-primary) !important; color: #fff !important; }
.table-success, .table-success > * { --bs-table-bg: var(--c-primary-050); }
.badge.bg-success { background-color: var(--c-primary) !important; }

.material-icons { font-size: 20px; vertical-align: -4px; }

/* ---------------- Navbar ---------------- */
.main-nav {
    background: var(--c-surface) !important;
    border-bottom: 1px solid var(--c-line);
    box-shadow: none;
    padding: 0;
    min-height: var(--nav-h);
}
.main-nav .container { min-height: var(--nav-h); }
.brand-logo { display: inline-flex; align-items: center; gap: .55rem; color: var(--c-ink); }
.brand-mark {
    width: 34px; height: 34px; border-radius: 8px;
    background: var(--c-primary); color: #fff;
    display: grid; place-items: center; font-weight: 700; font-size: .85rem;
    letter-spacing: .5px;
}
.brand-text strong { font-size: 1.02rem; font-weight: 700; color: var(--c-ink); display: block; line-height: 1.05; letter-spacing: -.01em; }
.brand-text small { font-size: .66rem; color: var(--c-muted); text-transform: uppercase; letter-spacing: .08em; }
.main-nav .nav-link {
    color: var(--c-text) !important; font-weight: 500; font-size: .84rem;
    padding: .5rem .7rem !important; border-radius: 6px; margin: 0 1px;
}
.main-nav .nav-link:hover { color: var(--c-primary) !important; background: var(--c-primary-050); }
.main-nav .nav-link.active { color: var(--c-primary) !important; font-weight: 600; }
.dropdown-menu { border: 1px solid var(--c-line); box-shadow: var(--shadow); border-radius: var(--radius); padding: .3rem; font-size: .85rem; }
.dropdown-item { border-radius: 6px; font-weight: 500; color: var(--c-text); padding: .45rem .7rem; }
.dropdown-item:hover { background: var(--c-primary-050); color: var(--c-primary); }

/* ---------------- Masthead (home) ---------------- */
.masthead {
    position: relative; overflow: hidden;
    background: linear-gradient(135deg, #0a5240 0%, #0f6b52 46%, #0e7c86 100%);
    color: #e9f4f0;
}
.masthead::before {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background:
        radial-gradient(circle at 88% 12%, rgba(255,255,255,.14), transparent 42%),
        radial-gradient(circle at 6% 96%, rgba(255,255,255,.08), transparent 38%),
        repeating-linear-gradient(135deg, rgba(255,255,255,.03) 0 2px, transparent 2px 22px);
}
.masthead .container { position: relative; z-index: 2; }
.masthead-inner {
    display: grid; grid-template-columns: 1.35fr 1fr; gap: 2.5rem; align-items: end;
    padding: 3.5rem 0 4.5rem;
}
/* KPI card sits lower (bottom-aligned + dips onto the wave) so the woven texture up top shows */
.masthead .stat-panel { align-self: end; margin-bottom: -2.1rem; }

/* Coastal line motif (sun + waves) in the hero corner */
.masthead-decor {
    position: absolute; top: 16px; right: 32px; width: 200px; z-index: 1;
    opacity: .2; pointer-events: none;
}
.masthead-decor svg { width: 100%; height: auto; display: block; }
.eyebrow {
    display: inline-flex; align-items: center; gap: .4rem;
    font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em;
    color: #fff; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.22);
    padding: .3rem .7rem; border-radius: 100px; margin-bottom: 1.1rem;
}
.masthead h1 {
    font-size: 2.15rem; line-height: 1.1; font-weight: 800; color: #fff;
    letter-spacing: -.025em; margin: 0 0 .8rem; text-shadow: 0 1px 12px rgba(0,0,0,.12);
}
.masthead .lead { font-size: 1.02rem; color: rgba(255,255,255,.85); max-width: 46ch; margin: 0 0 1.5rem; line-height: 1.55; }
.masthead-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.masthead .btn-light { background: #fff; border-color: #fff; color: var(--c-primary-600); font-weight: 600; }
.masthead .btn-light:hover { background: #eef7f3; }
.masthead .btn-outline-light { border-color: rgba(255,255,255,.6); color: #fff; }
.masthead .btn-outline-light:hover { background: rgba(255,255,255,.14); border-color: #fff; }

.masthead-wave { position: absolute; left: 0; right: 0; bottom: -1px; z-index: 1; line-height: 0; }
.masthead-wave svg { width: 100%; height: 46px; display: block; }

.stat-panel {
    border: 1px solid rgba(255,255,255,.4); border-radius: var(--radius);
    background: rgba(255,255,255,.97); overflow: hidden; box-shadow: 0 16px 38px rgba(8,52,40,.30);
}
.stat-panel-head {
    padding: .6rem 1rem; font-size: .7rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .09em; color: #fff; background: linear-gradient(90deg, var(--c-primary), #0e7c86);
}
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; }
.stat-cell { padding: 1.05rem 1rem; border-right: 1px solid var(--c-line-2); border-bottom: 1px solid var(--c-line-2); position: relative; }
.stat-cell::before { content: ''; position: absolute; left: 1rem; top: 1.05rem; width: 20px; height: 3px; border-radius: 3px; background: var(--sc, var(--c-primary)); }
.stat-cell { padding-top: 1.5rem; }
.stat-cell:nth-child(2n) { border-right: 0; }
.stat-cell:nth-last-child(-n+2) { border-bottom: 0; }
.stat-cell .num { font-size: 1.75rem; font-weight: 800; color: var(--sc, var(--c-ink)); line-height: 1; letter-spacing: -.02em; }
.stat-cell .lbl { font-size: .72rem; color: var(--c-muted); margin-top: .3rem; }
.sc-1 { --sc: #0f6b52; } .sc-2 { --sc: #0e7c86; } .sc-3 { --sc: #b26a1c; } .sc-4 { --sc: #3457a6; }

/* ---------------- Quick access strip ---------------- */
.quicklinks {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem;
    margin: 1rem 0 1.75rem; position: relative; z-index: 4;
}
.quicklink {
    display: flex; align-items: center; gap: .7rem;
    background: var(--c-surface); border: 1px solid var(--c-line); border-top: 3px solid var(--ql, var(--c-primary));
    border-radius: var(--radius); padding: .9rem .95rem; color: var(--c-text);
    box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s, border-color .15s;
}
.quicklink:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--ql, var(--c-primary)); color: var(--c-text); }
.quicklink .ql-ic {
    flex: 0 0 auto; width: 38px; height: 38px; border-radius: 9px;
    background: var(--ql-bg, var(--c-primary-050)); color: var(--ql, var(--c-primary)); display: grid; place-items: center;
}
.quicklink strong { display: block; font-size: .89rem; font-weight: 600; color: var(--c-ink); line-height: 1.1; }
.quicklink span { font-size: .74rem; color: var(--c-muted); }
.ql-1 { --ql: #0f6b52; --ql-bg: #e4f1eb; }
.ql-2 { --ql: #0e7c86; --ql-bg: #e0f1f2; }
.ql-3 { --ql: #b26a1c; --ql-bg: #f6ecd9; }
.ql-4 { --ql: #3457a6; --ql-bg: #e6ebf7; }

/* ---------------- Sections ---------------- */
.section { padding: 2.25rem 0; }
.section.tight { padding: 1.25rem 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1.1rem; gap: 1rem; }
.section-title {
    font-size: 1.05rem; font-weight: 700; color: var(--c-ink); letter-spacing: -.01em;
    margin: 0; padding-left: .7rem; border-left: 3px solid var(--c-primary);
}

/* ---------------- Cards / surfaces ---------------- */
.content-card {
    background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card { border-color: var(--c-line); }

/* ---------------- Inner page header (colored) ---------------- */
.page-hero-sm {
    position: relative; overflow: hidden; text-align: left; color: #fff;
    background: linear-gradient(120deg, #0a5240 0%, #0f6b52 55%, #0e7c86 100%);
    padding: 1.5rem 0 1.4rem;
}
.page-hero-sm::before {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background:
        radial-gradient(circle at 93% 18%, rgba(255,255,255,.13), transparent 46%),
        repeating-linear-gradient(135deg, rgba(255,255,255,.03) 0 2px, transparent 2px 20px);
}
.page-hero-sm .container { position: relative; z-index: 2; }
.hero-row { display: flex; align-items: center; gap: .9rem; }
.hero-ic {
    flex: 0 0 auto; width: 44px; height: 44px; border-radius: 11px;
    background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.24);
    color: #fff; display: grid; place-items: center;
}
.hero-ic .material-icons { font-size: 24px; }
.page-hero-sm h1 { font-size: 1.3rem; font-weight: 700; color: #fff; margin: 0; letter-spacing: -.015em; }
.page-hero-sm .breadcrumb { margin: .2rem 0 0; font-size: .78rem; }
.page-hero-sm .breadcrumb a { color: rgba(255,255,255,.82); }
.page-hero-sm .breadcrumb a:hover { color: #fff; }
.page-hero-sm .breadcrumb-item.active { color: #fff; }
.page-hero-sm .breadcrumb-item + .breadcrumb-item::before { color: rgba(255,255,255,.5); }

/* Colorful requirement badges (alur) */
.req-item:nth-child(4n+1) { border-left-color: #0f6b52; }
.req-item:nth-child(4n+1) .num-badge { background: #e4f1eb; color: #0f6b52; }
.req-item:nth-child(4n+2) { border-left-color: #0e7c86; }
.req-item:nth-child(4n+2) .num-badge { background: #e0f1f2; color: #0e7c86; }
.req-item:nth-child(4n+3) { border-left-color: #b26a1c; }
.req-item:nth-child(4n+3) .num-badge { background: #f6ecd9; color: #b26a1c; }
.req-item:nth-child(4n+4) { border-left-color: #3457a6; }
.req-item:nth-child(4n+4) .num-badge { background: #e6ebf7; color: #3457a6; }

/* Colorful news thumbnails */
.news-img.nv-0 { background: #e4f1eb; color: #0f6b52; }
.news-img.nv-1 { background: #e0f1f2; color: #0e7c86; }
.news-img.nv-2 { background: #f6ecd9; color: #b26a1c; }
.news-img.nv-3 { background: #e6ebf7; color: #3457a6; }

/* Mini stat chips */
.mini-stats { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem; }
.mini-stat {
    display: flex; align-items: center; gap: .55rem; background: var(--c-surface);
    border: 1px solid var(--c-line); border-left: 3px solid var(--ms, var(--c-primary));
    border-radius: var(--radius-sm); padding: .5rem .8rem; min-width: 118px;
}
.mini-stat .ms-num { font-size: 1.15rem; font-weight: 800; color: var(--ms, var(--c-ink)); line-height: 1; }
.mini-stat .ms-lbl { font-size: .7rem; color: var(--c-muted); text-transform: uppercase; letter-spacing: .04em; }
.ms-1 { --ms: #0f6b52; } .ms-2 { --ms: #0e7c86; } .ms-3 { --ms: #b26a1c; } .ms-4 { --ms: #3457a6; }

/* Section icon accent */
.sec-ic {
    display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
    background: var(--c-primary-050); color: var(--c-primary); vertical-align: middle; margin-right: .3rem;
}
.sec-ic .material-icons { font-size: 18px; }

/* ---------------- Buttons ---------------- */
.btn { border-radius: var(--radius-sm); font-weight: 500; font-size: .86rem; padding: .45rem .9rem; }
.btn-lg { padding: .6rem 1.1rem; font-size: .95rem; }
.btn-sm { padding: .3rem .6rem; font-size: .78rem; }
.btn-sidomas { background: var(--c-primary); border: 1px solid var(--c-primary); color: #fff; }
.btn-sidomas:hover { background: var(--c-primary-600); border-color: var(--c-primary-600); color: #fff; }
.btn-outline-sidomas { border: 1px solid var(--c-line); color: var(--c-primary); background: var(--c-surface); }
.btn-outline-sidomas:hover { background: var(--c-primary-050); border-color: var(--c-primary); color: var(--c-primary-600); }
.btn-light { background: #fff; border: 1px solid var(--c-line); color: var(--c-text); }
.btn-light:hover { background: var(--c-line-2); }

/* ---------------- Forms ---------------- */
.form-section-title {
    font-size: .82rem; font-weight: 700; color: var(--c-ink); text-transform: uppercase;
    letter-spacing: .05em; padding-bottom: .5rem; margin-bottom: 1rem; border-bottom: 1px solid var(--c-line-2);
}
.form-section-title::before {
    content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 3px;
    background: linear-gradient(135deg, var(--c-primary), #0e7c86); margin-right: .5rem; vertical-align: baseline;
}
.form-label { font-weight: 500; font-size: .8rem; color: var(--c-text); margin-bottom: .25rem; }
.required::after { content: ' *'; color: #c0392b; }
.form-control, .form-select {
    font-size: .86rem; border-color: var(--c-line); border-radius: var(--radius-sm);
    color: var(--c-text); padding: .42rem .65rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(15, 107, 82, .12);
}

/* ---------------- Tables ---------------- */
.table { font-size: .85rem; color: var(--c-text); margin-bottom: 0; }
.table > thead th {
    background: #fafbfa; color: var(--c-muted); border-bottom: 1px solid var(--c-line);
    text-transform: uppercase; font-size: .7rem; letter-spacing: .05em; font-weight: 600;
    padding: .6rem .7rem; white-space: nowrap;
}
.table > tbody td { padding: .6rem .7rem; border-color: var(--c-line-2); vertical-align: middle; }
.table-hover > tbody > tr:hover > * { background: var(--c-primary-050); }
table.dataTable thead th { background: #fafbfa; color: var(--c-muted); border: none; }
.badge { font-weight: 600; font-size: .68rem; letter-spacing: .02em; padding: .32em .55em; border-radius: 5px; }

/* ---------------- Requirement list (alur) ---------------- */
.req-item {
    background: var(--c-surface); border: 1px solid var(--c-line); border-left: 3px solid var(--c-primary);
    border-radius: var(--radius-sm); padding: .7rem .9rem; margin-bottom: .5rem;
    display: flex; gap: .8rem; align-items: flex-start; font-size: .88rem;
}
.req-item .num-badge {
    flex: 0 0 auto; width: 24px; height: 24px; border-radius: 6px;
    background: var(--c-primary-050); color: var(--c-primary); display: grid; place-items: center;
    font-weight: 700; font-size: .78rem;
}

/* ---------------- News ---------------- */
.news-card {
    background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius);
    overflow: hidden; height: 100%; transition: border-color .15s, box-shadow .15s;
}
.news-card:hover { border-color: var(--c-primary); box-shadow: var(--shadow-sm); }
.news-card .news-img {
    height: 120px; background: var(--c-primary-050); color: var(--c-primary);
    display: grid; place-items: center; border-bottom: 1px solid var(--c-line-2);
}
.news-card .news-body { padding: .85rem .95rem; }
.news-card .news-body h6 { font-weight: 600; font-size: .9rem; color: var(--c-ink); margin: .25rem 0 .35rem; line-height: 1.25; }

/* ---------------- Footer ---------------- */
.site-footer {
    background: var(--c-surface); color: var(--c-muted); border-top: 1px solid var(--c-line);
    padding: 1.3rem 0; font-size: .82rem; margin-top: 1rem;
}
.site-footer a { color: var(--c-text); }
.site-footer a:hover { color: var(--c-primary); }
.site-footer .footer-links { list-style: none; display: flex; gap: 1.1rem; margin: 0; padding: 0; }

/* ---------------- Alerts ---------------- */
.alert { border-radius: var(--radius); font-size: .86rem; border: 1px solid transparent; }
.alert-success { background: var(--c-primary-050); border-color: #cfe4dc; color: var(--c-primary-600); }

/* ---------------- Responsive ---------------- */
@media (max-width: 860px) {
    .masthead-inner { grid-template-columns: 1fr; gap: 1.5rem; padding: 2rem 0; }
    .masthead h1 { font-size: 1.6rem; }
    .masthead .stat-panel { margin-bottom: 0; }
    .masthead-decor { display: none; }
    .quicklinks { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .quicklinks { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
}
