/* ==========================================================================
   PERATURAN.UPR.AC.ID — Modern UI
   ========================================================================== */
:root {
    --navy-900: #071a3d;
    --navy-800: #0b2a5b;
    --navy-700: #12397a;
    --blue-500: #2563eb;
    --gold-400: #f6c343;
    --gold-500: #eab308;
    --ink: #0f172a;
    --muted: #5b6478;
    --line: #e5e9f2;
    --surface: #ffffff;
    --bg: #f5f7fb;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
    --shadow-md: 0 10px 30px -12px rgba(11, 42, 91, .25);
    --shadow-lg: 0 24px 60px -20px rgba(7, 26, 61, .35);
    --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.m-body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.65;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

.m-body h1, .m-body h2, .m-body h3, .m-body h4 {
    font-family: var(--font);
    color: inherit;
    letter-spacing: -.02em;
    margin: 0;
}

.m-body a { color: var(--blue-500); text-decoration: none; transition: color .2s; }
.m-body a:hover { color: var(--navy-800); text-decoration: none; }
.m-body img { max-width: 100%; }

.m-container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- Buttons ---------- */
.m-btn {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    padding: .85rem 1.5rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: .95rem;
    line-height: 1;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s, background .2s, color .2s, border-color .2s;
}
.m-btn:hover { transform: translateY(-2px); }
.m-btn--gold { background: var(--gold-400); color: var(--navy-900) !important; box-shadow: 0 10px 24px -10px rgba(246, 195, 67, .8); }
.m-btn--gold:hover { background: #ffd35c; }
.m-btn--ghost { border-color: rgba(255, 255, 255, .55); color: #fff !important; background: rgba(255, 255, 255, .06); backdrop-filter: blur(4px); }
.m-btn--ghost:hover { background: rgba(255, 255, 255, .16); border-color: #fff; }

/* ---------- Navbar ---------- */
.m-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, .85);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid transparent;
    transition: box-shadow .25s, border-color .25s;
}
.m-nav.is-scrolled { box-shadow: var(--shadow-sm); border-bottom-color: var(--line); }
.m-nav__inner { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.m-nav__brand img { height: 52px; width: auto; display: block; }
.m-nav__menu { display: flex; align-items: center; gap: .35rem; list-style: none; margin: 0; padding: 0; }
.m-nav__link {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .6rem 1rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: .95rem;
    color: var(--ink) !important;
    background: none;
    border: 0;
    cursor: pointer;
    font-family: inherit;
    transition: background .2s, color .2s;
}
.m-nav__link:hover { background: #eef2fb; color: var(--navy-800) !important; }
.m-nav__link.is-active { background: var(--navy-800); color: #fff !important; }
.m-nav__link .fa-angle-down { transition: transform .2s; }

.m-dropdown { position: relative; }
.m-dropdown__menu {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    min-width: 240px;
    padding: .5rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .2s, transform .2s, visibility .2s;
}
.m-dropdown.is-open .m-dropdown__menu { opacity: 1; visibility: visible; transform: none; }
.m-dropdown.is-open .fa-angle-down { transform: rotate(180deg); }
.m-dropdown__item {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .7rem .85rem;
    border-radius: 10px;
    color: var(--ink) !important;
    font-weight: 500;
    font-size: .95rem;
}
.m-dropdown__item i { color: var(--blue-500); width: 18px; text-align: center; }
.m-dropdown__item:hover { background: #eef2fb; }

.m-nav__toggle {
    display: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--navy-800);
    font-size: 1.2rem;
    cursor: pointer;
}

@media (max-width: 860px) {
    .m-nav__toggle { display: inline-flex; align-items: center; justify-content: center; }
    .m-nav__brand img { height: 44px; }
    .m-nav__collapse {
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        background: var(--surface);
        border-bottom: 1px solid var(--line);
        box-shadow: var(--shadow-md);
        display: none;
        padding: .75rem 20px 1.25rem;
    }
    .m-nav__collapse.is-open { display: block; }
    .m-nav__menu { flex-direction: column; align-items: stretch; }
    .m-nav__link { width: 100%; justify-content: space-between; border-radius: 12px; }
    .m-dropdown__menu {
        position: static;
        box-shadow: none;
        border: 0;
        background: #f3f6fc;
        margin-top: .35rem;
        display: none;
        opacity: 1;
        visibility: visible;
        transform: none;
    }
    .m-dropdown.is-open .m-dropdown__menu { display: block; }
}

/* ---------- Hero ---------- */
.m-hero {
    position: relative;
    min-height: min(78vh, 680px);
    display: flex;
    align-items: center;
    color: #fff;
    background-color: var(--navy-800);
    background-size: cover;
    background-position: center;
    overflow: hidden;
    isolation: isolate;
}
.m-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(100deg, rgba(7, 26, 61, .95) 0%, rgba(11, 42, 91, .85) 40%, rgba(11, 42, 91, .35) 100%);
}
.m-hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 120px;
    z-index: -1;
    background: linear-gradient(to bottom, transparent, rgba(7, 26, 61, .35));
}
.m-hero__content { max-width: 680px; padding: 6rem 0 8rem; }
.m-hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .45rem .9rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .2);
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: .02em;
    margin-bottom: 1.5rem;
}
.m-hero__eyebrow::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gold-400);
    box-shadow: 0 0 0 4px rgba(246, 195, 67, .25);
}
.m-hero h1 {
    font-size: clamp(1.6rem, 3.6vw, 2.6rem);
    font-weight: 800;
    line-height: 1.08;
    margin-bottom: 1.1rem;
    word-break: break-word;
}
.m-hero h1 span { color: var(--gold-400); }
.m-hero h2 {
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    font-weight: 500;
    color: rgba(255, 255, 255, .82);
    margin-bottom: 2.25rem;
    letter-spacing: 0;
}
.m-hero__actions { display: flex; flex-wrap: wrap; gap: .85rem; }

/* ---------- Page header (inner pages) ---------- */
.m-page-header {
    position: relative;
    padding: 4.5rem 0 5.5rem;
    color: #fff;
    background:
        radial-gradient(1200px 400px at 85% -10%, rgba(246, 195, 67, .18), transparent 60%),
        linear-gradient(120deg, var(--navy-900), var(--navy-700));
    overflow: hidden;
}
.m-page-header::after {
    content: "";
    position: absolute;
    right: -80px;
    bottom: -120px;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    border: 60px solid rgba(255, 255, 255, .04);
}
.m-breadcrumb { font-size: .9rem; color: rgba(255, 255, 255, .7); margin-bottom: .75rem; }
.m-breadcrumb a { color: rgba(255, 255, 255, .85) !important; }
.m-breadcrumb a:hover { color: #fff !important; }
.m-breadcrumb i { margin: 0 .45rem; font-size: .75rem; }
.m-page-header h2 { font-size: clamp(1.75rem, 4vw, 2.6rem); font-weight: 800; }

/* ---------- Sections ---------- */
.m-section { padding: 5rem 0; }
.m-section--overlap { padding-top: 0; margin-top: -4.5rem; position: relative; z-index: 2; }
.m-section__head { text-align: center; max-width: 640px; margin: 0 auto 2.5rem; }
.m-section__label {
    display: inline-block;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--blue-500);
    margin-bottom: .5rem;
}
.m-section__head h3 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; }

/* ---------- Stat / category cards ---------- */
.m-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}
.m-stat {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.75rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    color: var(--ink) !important;
    overflow: hidden;
    transition: transform .25s, box-shadow .25s, border-color .25s;
}
.m-stat::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--blue-500), var(--gold-400));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .3s;
}
.m-stat:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: #cfd9ef; }
.m-stat:hover::after { transform: scaleX(1); }
.m-stat__top { display: flex; align-items: center; justify-content: space-between; }
.m-stat__icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 1.45rem;
    color: var(--navy-800);
    background: linear-gradient(135deg, #e7eefc, #fdf3d6);
}
.m-stat__arrow {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #f1f4fa;
    color: var(--navy-800);
    transition: background .2s, color .2s, transform .2s;
}
.m-stat:hover .m-stat__arrow { background: var(--navy-800); color: #fff; transform: rotate(-45deg); }
.m-stat__num { font-size: 2.6rem; font-weight: 800; line-height: 1; color: var(--navy-800); letter-spacing: -.03em; }
.m-stat__name { font-size: 1.05rem; font-weight: 700; color: var(--ink); }
.m-stat__hint { font-size: .85rem; color: var(--muted); margin-top: -.6rem; }

/* ---------- Card ---------- */
.m-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 2rem;
}

/* ---------- About ---------- */
.m-about { display: grid; grid-template-columns: 1.35fr 1fr; gap: 2rem; align-items: start; }
.m-about__text p { color: #334155; margin: 0 0 1rem; }
.m-about__list { list-style: none; counter-reset: item; padding: 0; margin: 0 0 1.5rem; }
.m-about__list li {
    counter-increment: item;
    position: relative;
    padding: .9rem 1rem .9rem 3.5rem;
    margin-bottom: .65rem;
    background: #f7f9fd;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: #334155;
}
.m-about__list li::before {
    content: counter(item);
    position: absolute;
    left: 1rem;
    top: .9rem;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--navy-800);
    color: #fff;
    font-weight: 700;
    font-size: .85rem;
    display: grid;
    place-items: center;
}
.m-about__note {
    padding: 1rem 1.25rem;
    border-left: 4px solid var(--gold-400);
    background: #fffaeb;
    border-radius: 0 12px 12px 0;
    color: #5b4a12 !important;
    font-size: .95rem;
}
.m-about__media { position: sticky; top: 100px; }
.m-about__media img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow-lg); display: block; }
@media (max-width: 860px) {
    .m-about { grid-template-columns: 1fr; }
    .m-about__media { position: static; order: -1; }
}

/* ---------- Table (download) ---------- */
.m-table-card { padding: 1.5rem; }
.m-body table.m-table { width: 100% !important; border-collapse: separate; border-spacing: 0; margin: 0 !important; font-size: .95rem; }
.m-body table.m-table thead th {
    background: #f1f4fa;
    color: var(--navy-800);
    font-weight: 700;
    font-size: .8rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    border: 0 !important;
    padding: .95rem 1rem;
    white-space: nowrap;
}
.m-body table.m-table thead th:first-child { border-radius: 10px 0 0 10px; }
.m-body table.m-table thead th:last-child { border-radius: 0 10px 10px 0; }
.m-body table.m-table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border: 0 !important;
    border-bottom: 1px solid var(--line) !important;
    background: transparent !important;
}
.m-body table.m-table tbody tr:hover td { background: #f8faff !important; }
.m-table__title { font-weight: 700; color: var(--ink); }
.m-table__no { color: var(--muted); font-weight: 600; }
.m-chip {
    display: inline-block;
    padding: .3rem .75rem;
    border-radius: 999px;
    background: #eef2fb;
    color: var(--navy-700);
    font-size: .8rem;
    font-weight: 700;
    white-space: nowrap;
}
.m-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-grid;
    place-items: center;
    border: 0;
    cursor: pointer;
    font-size: 1rem;
    transition: transform .2s, background .2s;
}
.m-icon-btn:hover { transform: translateY(-2px); }
.m-icon-btn--dl { background: #e6f6ee; color: #0f8a4b !important; }
.m-icon-btn--dl:hover { background: #ccefdc; }
.m-icon-btn--view { background: #e7eefc; color: var(--blue-500); }
.m-icon-btn--view:hover { background: #d3e0fb; }

/* DataTables controls */
.m-body .dataTables_wrapper .row { margin-left: 0; margin-right: 0; }
.m-body .dataTables_wrapper .dataTables_length,
.m-body .dataTables_wrapper .dataTables_filter,
.m-body .dataTables_wrapper .dataTables_info { color: var(--muted); font-size: .9rem; padding: .5rem 0; }
.m-body .dataTables_wrapper .dataTables_filter input,
.m-body .dataTables_wrapper .dataTables_length select {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: .5rem .8rem;
    font-family: inherit;
    font-size: .9rem;
    background: #fff;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.m-body .dataTables_wrapper .dataTables_filter input { min-width: 240px; margin-left: .5rem; }
.m-body .dataTables_wrapper .dataTables_filter input:focus,
.m-body .dataTables_wrapper .dataTables_length select:focus { border-color: var(--blue-500); box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }
.m-body .dataTables_wrapper .pagination { gap: .3rem; flex-wrap: wrap; margin: .5rem 0; }
.m-body .dataTables_wrapper .page-link {
    border: 1px solid var(--line);
    border-radius: 10px !important;
    color: var(--navy-800);
    font-weight: 600;
    padding: .45rem .8rem;
}
.m-body .dataTables_wrapper .page-item.active .page-link { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.m-body .dataTables_wrapper .page-item.disabled .page-link { color: #a3acbf; }
@media (max-width: 600px) {
    .m-body .dataTables_wrapper .dataTables_filter input { min-width: 0; width: 100%; margin: .35rem 0 0; }
    .m-body .dataTables_wrapper .dataTables_filter label { width: 100%; }
}

/* Modal */
.m-body .modal-content { border: 0; border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; }
.m-body .modal-header { background: var(--navy-800); color: #fff; padding: 1rem 1.5rem; border: 0; align-items: center; }
.m-body .modal-title { font-size: 1rem; font-weight: 700; line-height: 1.4; }
.m-body .modal-header .close { color: #fff; opacity: .8; text-shadow: none; order: 2; margin-left: auto; }
.m-body .modal-header .close:hover { opacity: 1; }
.m-body .modal-body { padding: 1.25rem; }
.m-body .modal-body embed { border-radius: 10px; background: #f1f4fa; }
.m-body .modal-footer { border: 0; padding: 1rem 0 0; }
.m-body .modal-footer .btn { border-radius: 999px; padding: .55rem 1.25rem; font-weight: 600; background: #f1f4fa; border: 0; }

/* ---------- Footer ---------- */
.m-footer {
    background: var(--navy-900);
    color: rgba(255, 255, 255, .72);
    padding: 4rem 0 0;
    margin-top: 0;
}
.m-footer__grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 2.5rem; padding-bottom: 3rem; }
.m-footer__logo {
    display: inline-block;
    background: #fff;
    padding: .65rem 1rem;
    border-radius: 14px;
}
.m-footer__logo img { height: 58px; display: block; }
.m-footer h3 { color: #fff; font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; }
.m-footer p { margin: 0 0 .75rem; }
.m-footer__addr { display: flex; gap: .75rem; }
.m-footer__addr i { color: var(--gold-400); margin-top: .3rem; }
.m-footer__social { display: flex; gap: .6rem; list-style: none; padding: 0; margin: 1.25rem 0 0; }
.m-footer__social a {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .08);
    color: #fff !important;
    transition: background .2s, transform .2s;
}
.m-footer__social a:hover { background: var(--gold-400); color: var(--navy-900) !important; transform: translateY(-3px); }
.m-footer__bottom {
    border-top: 1px solid rgba(255, 255, 255, .1);
    padding: 1.25rem 0;
    font-size: .9rem;
    color: rgba(255, 255, 255, .55);
}
.m-footer__bottom a { color: rgba(255, 255, 255, .8) !important; }
@media (max-width: 760px) {
    .m-footer__grid { grid-template-columns: 1fr; }
}

/* ---------- Back to top ---------- */
.m-totop {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    border: 0;
    background: var(--navy-800);
    color: #fff;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity .25s, transform .25s, visibility .25s;
    z-index: 999;
}
.m-totop.is-visible { opacity: 1; visibility: visible; transform: none; }

/* ---------- Reveal animation ---------- */
.m-js .m-reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.m-js .m-reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .m-js .m-reveal { opacity: 1; transform: none; transition: none; }
    .m-btn, .m-stat, .m-stat__arrow { transition: none; }
}
