@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ===== CSS Variables / Design Tokens ===== */
:root {
    --primary: #c96b86;
    --primary-hover: #a34d68;
    --primary-light: #f7dbe3;
    --primary-glow: rgba(201, 107, 134, 0.16);
    --gradient-primary: linear-gradient(135deg, #c96b86 0%, #a34d68 100%);
    --gradient-header: rgba(255, 255, 255, 0.86);

    --bg-page: #fdf7f5;
    --surface: #ffffff;
    --surface-alt: #fff9f8;
    --text-main: #4a3a40;
    --text-muted: #8c7178;
    --border-subtle: rgba(163, 77, 104, 0.16);
    --border-focus: #dfa0b3;

    --card-shadow: 0 10px 28px rgba(120, 60, 80, 0.1);
    --card-shadow-hover: 0 16px 34px rgba(120, 60, 80, 0.16);

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --radius-full: 9999px;

    --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ===== Reset & Base ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Plus Jakarta Sans", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    color: var(--text-main, #4a3a40);
    background-color: var(--bg-page, #fdf7f5);
    background-image: radial-gradient(circle at 8% 8%, rgba(233, 190, 205, 0.25), transparent 30%), radial-gradient(circle at 92% 85%, rgba(215, 175, 190, 0.2), transparent 32%), radial-gradient(rgba(201, 107, 134, 0.1) 1px, transparent 1px);
    background-size: auto, auto, 26px 26px;
    line-height: 1.65;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--pink-dark, #a34d68);
    text-decoration: none;
    transition: color 0.25s ease, background 0.25s ease;
}

a:hover {
    color: var(--primary-hover);
}

/* ===== Header & Navbar (Flexbox) ===== */
header {
    background: rgba(255, 255, 255, 0.86);
    color: var(--text-main, #4a3a40);
    padding: 16px 7%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;

    border-radius: 0;
    box-shadow: 0 8px 24px rgba(120, 60, 80, 0.1);
    position: sticky;
    top: 0;
    z-index: 50;
    gap: 30px;
    border: 0;
    border-bottom: 1px solid var(--border-subtle, rgba(163, 77, 104, 0.16));
    backdrop-filter: blur(14px);
}

header h1 {
    font-size: 25px;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    font-family: Georgia, "Times New Roman", serif;
    color: var(--pink-dark, #a34d68);
    background: linear-gradient(90deg, #a34d68, #c96b86, #e2a6b8);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

header nav a {
    color: var(--text-main, #4a3a40);
    font-weight: 500;
    font-size: 14px;
    padding: 9px 15px;
    border-radius: 10px;
    background: transparent;
    border: 0;
    transition: background 0.25s ease, color 0.25s ease;
    display: block;
}

header nav a:hover {
    text-decoration: none;
    background: rgba(201, 107, 134, 0.12);
    color: var(--pink-dark, #a34d68);
    transform: none;
    box-shadow: none;
}

/* ===== Main Layout ===== */
main {
    max-width: 1180px;
    width: 86%;
    margin: 0 auto;
    padding: 32px 0 55px;
    flex: 1;
}

section {
    border-radius: 22px;
    padding: 30px;
    margin-bottom: 32px;
    box-shadow: 0 10px 28px rgba(120, 60, 80, 0.1);
    border: 1px solid var(--border-subtle, rgba(163, 77, 104, 0.16));
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.68);
    backdrop-filter: blur(10px);
}

section:hover {
    box-shadow: var(--card-shadow-hover);
}

section h2 {
    margin-bottom: 20px;
    color: var(--text-main, #4a3a40);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: Georgia, "Times New Roman", serif;
}

section p {
    color: var(--text-muted);
    font-size: 0.98rem;
    line-height: 1.65;
}

/* Hero Section / Welcome card */
main section:first-of-type {
    background: linear-gradient(135deg, #ffffff 0%, #fff8f7 100%);
}

/* ===== Kartu Statistik (CSS Grid) ===== */
main section:nth-of-type(2) {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    border-left: none;
    background: transparent;
    padding: 0;
    box-shadow: none;
    border: 0;
    overflow: visible;
    backdrop-filter: none;
}

main section:nth-of-type(2):hover {
    box-shadow: none;
}

main section:nth-of-type(2) h2 {
    grid-column: 1 / -1;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--border-subtle, rgba(163, 77, 104, 0.16));
    padding-bottom: 14px;
}

main section:nth-of-type(2) article {
    border-radius: 22px;
    padding: 26px;
    text-align: center;
    box-shadow: 0 10px 28px rgba(120, 60, 80, 0.1);
    border: 1px solid rgba(201, 107, 134, 0.16);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    min-height: 165px;
    border-top: 3px solid var(--accent);
    background: rgba(255, 255, 255, 0.72);
    --accent: #c96b86;
    --accent-soft: rgba(201, 107, 134, 0.14);
}

main section:nth-of-type(2) article::before {
    display: block;
    width: 46px;
    height: 46px;
    margin: 0 auto 10px;
    border-radius: 50%;
    background-color: var(--accent-soft);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 22px 22px;
    content: "";
}

main section:nth-of-type(2) article:nth-of-type(1)::before {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a34d68' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 3a3 3 0 1 0 3 3'/><path d='M6 21a3 3 0 1 0 3-3'/><path d='M9 6 20 17'/><path d='M9 18 20 7'/></svg>");
}

main section:nth-of-type(2) article:nth-of-type(2)::before {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23996f2e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='9' cy='7' r='4'/><path d='M17 11a4 4 0 1 0-3-6.7'/><path d='M1 21v-1a6 6 0 0 1 12 0v1'/><path d='M17 14a6 6 0 0 1 6 6v1'/></svg>");
}

main section:nth-of-type(2) article:nth-of-type(3)::before {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236f5488' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='4' y='2' width='16' height='20' rx='2'/><path d='M9 22v-4h6v4'/><path d='M8 6h.01'/><path d='M16 6h.01'/><path d='M12 6h.01'/><path d='M8 10h.01'/><path d='M16 10h.01'/><path d='M12 10h.01'/></svg>");
}


/* Mengatur tampilan artikel pertama di section kedua */
main section:nth-of-type(2) article:nth-of-type(1) {
    border-top: 3px solid #c96b86;
    background: rgba(255, 255, 255, 0.72);
}

main section:nth-of-type(2) article:nth-of-type(2) {
    border-top: 3px solid var(--accent);
    background: rgba(255, 255, 255, 0.72);
    --accent: #b98a4f;
    --accent-soft: rgba(203, 161, 101, 0.16);
}

main section:nth-of-type(2) article:nth-of-type(3) {
    border-top: 3px solid var(--accent);
    background: rgba(255, 255, 255, 0.72);
    --accent: #8f6fa8;
    --accent-soft: rgba(143, 111, 168, 0.14);
}

main section:nth-of-type(2) article:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 34px rgba(120, 60, 80, 0.16);
}

main section:nth-of-type(2) article h3 {
    font-size: 12.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--muted, #8c7178);
    margin-bottom: 0.5rem;
}

main section:nth-of-type(2) article p {
    font-size: 42px;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
    letter-spacing: -0.5px;
    font-family: Georgia, "Times New Roman", serif;
}

main section:nth-of-type(2) article:nth-of-type(1) p {
    color: #c96b86;
}

main section:nth-of-type(2) article:nth-of-type(2) p {
    color: var(--accent);
}

main section:nth-of-type(2) article:nth-of-type(3) p {
    color: var(--accent);
}

/* ===== Kolom Pencarian ===== */
.search-box {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 18px 22px;
    border: 1px solid var(--border-subtle, rgba(163, 77, 104, 0.16));
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.68);
    box-shadow: 0 6px 18px rgba(120, 60, 80, 0.1);
    backdrop-filter: blur(10px);
}

.search-box label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main, #4a3a40);
}

.search-box input {
    width: 100%;
    max-width: 100%;
    padding: 11px 13px;
    border: 1px solid rgba(190, 125, 140, 0.28);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    background-color: rgba(255, 255, 255, 0.85);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23a0a3bd' stroke-width='2.2'%3E%3Ccircle cx='11' cy='11' r='6'/%3E%3Cpath stroke-linecap='round' d='M20 20l-4.2-4.2'/%3E%3C/svg%3E");
    padding-left: 2.8rem;
    background-repeat: no-repeat;
    background-position: 0.9rem center;
    background-size: 1.05rem;
    color: var(--text-main, #4a3a40);
    outline: none;
    transition: var(--transition);
}

.search-box input:focus {
    border-color: #dfa0b3;
    box-shadow: 0 0 0 3px rgba(201, 107, 134, 0.12);
    background-color: #ffffff;
}

/* ===== Tabel Responsif ===== */
.table-responsive {
    overflow-x: auto;
    border-radius: 16px;
    border: 1px solid var(--border-subtle, rgba(163, 77, 104, 0.16));
    box-shadow: 0 10px 28px rgba(120, 60, 80, 0.1);
    background: rgba(255, 255, 255, 0.7);
}

/* ===== Tabel Modern ===== */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    border-spacing: 0;
    border-radius: 0;
}

th, td {
    text-align: left;
    padding: 14px 16px;
    vertical-align: middle;
    border-bottom: 1px solid rgba(190, 125, 140, 0.12);
}

thead {
    background: rgba(201, 107, 134, 0.1);
    color: var(--pink-dark, #a34d68);
}

th {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #8c4752;
    border-bottom: 2px solid var(--border-subtle);
    white-space: nowrap;
}

tbody tr {
    border-bottom: 1px solid #f6ecea;
    transition: background-color 0.15s ease;
}

tbody tr:last-child {
    border-bottom: none;
}

tbody tr:nth-child(even) {
    background-color: rgba(247, 219, 227, 0.16);
}

tbody tr:hover {
    background-color: rgba(247, 219, 227, 0.4);
}

#loading-indicator td {
    padding: 2.2rem 1rem;
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.95rem;
}

/* Action Buttons in Table */
td button {
    padding: 0.45rem 0.95rem;
    margin-right: 0.4rem;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* Edit Button */
td button:first-of-type {
    background-color: #eef2ff;
    color: #fff;
    border: 0;
    background: linear-gradient(135deg, #e3aebc, #d99aaa);
    border-radius: 10px;
    box-shadow: none;
}

td button:first-of-type:hover {
    background-color: #4f46e5;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(120, 60, 80, 0.16);
    background: #d99aaa;
}

/* Delete Button */
td button:last-of-type,
td button.btn-hapus {
    background-color: #fef2f2;
    color: #fff;
    border: 0;
    background: linear-gradient(135deg, #cd7f92, #b95c73);
    border-radius: 10px;
    box-shadow: none;
}

td button:last-of-type:hover,
td button.btn-hapus:hover {
    background-color: #dc2626;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(120, 60, 80, 0.16);
    background: #b95c73;
}

/* ===== Form ===== */
form {
    max-width: 720px;
    padding: 30px;
    border: 1px solid rgba(163, 77, 104, 0.16);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 10px 28px rgba(120, 60, 80, 0.1);
    backdrop-filter: blur(12px);
}

form p {
    margin-bottom: 20px;
}

form label {
    display: inline-block;
    margin-bottom: 0.45rem;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-main, #4a3a40);
}

form input,
form select {
    width: 100%;
    max-width: 440px;
    padding: 11px 13px;
    border: 1px solid rgba(190, 125, 140, 0.28);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    background-color: rgba(255, 255, 255, 0.85);
    color: var(--text-main, #4a3a40);
    outline: none;
    transition: var(--transition);
}

form input:focus,
form select:focus {
    border-color: #dfa0b3;
    box-shadow: 0 0 0 3px rgba(201, 107, 134, 0.12);
}

form button[type="submit"] {
    background: linear-gradient(135deg, #c96b86, #a34d68);
    color: #fff;
    border: 0;
    padding: 11px 26px;
    border-radius: 10px;
    font-size: 0.98rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(163, 77, 104, 0.25);
    transition: var(--transition);
}

form button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(224, 83, 104, 0.4);
    filter: brightness(1.04);
}

form button[type="submit"]:active {
    transform: translateY(0);
}

/* ===== Pesan Error Validasi ===== */
.error {
    display: inline-block;
    color: #dc2626;
    background-color: #fef2f2;
    border: 1px solid #fee2e2;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 500;
    margin-top: 0.45rem;
}

/* ===== Hamburger Menu ===== */
.nav-toggle-label {
    display: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: #a34d68;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(163, 77, 104, 0.16);
    border-radius: 10px;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.nav-toggle-label:hover {
    background: rgba(201, 107, 134, 0.12);
}

/* ===== Footer ===== */
footer {
    text-align: center;
    padding: 28px;
    color: var(--text-muted, #8c7178);
    font-size: 12px;
    border-top: 1px solid var(--border-subtle, rgba(163, 77, 104, 0.16));
    margin-top: auto;
    letter-spacing: 0.3px;
}

/* ===== Responsive Breakpoints ===== */

/* Tablet ke bawah */
@media (max-width: 850px) {
    main section:nth-of-type(2) {
        grid-template-columns: repeat(2, 1fr);
    }

    header {
        padding: 1rem 1.25rem;
    }

    section {
        padding: 1.4rem;
    }
}

/* Mobile ke bawah */
@media (max-width: 640px) {
    header {
        position: relative;
    }

    .nav-toggle-label {
        display: flex;
    }

    header nav {
        display: none;
        width: 100%;
        order: 3;
        margin-top: 1rem;
        background: rgba(255, 255, 255, 0.94);
        border-radius: 16px;
        padding: 10px;
        box-shadow: 0 10px 28px var(--shadow);
        border: 1px solid var(--line);
    }

    header nav.nav-open {
        display: block;
        animation: fadeInDown 0.25s ease forwards;
    }

    @keyframes fadeInDown {
        from {
            opacity: 0;
            transform: translateY(-8px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    header nav ul {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }

    header nav a {
        color: var(--text-main);
        background: #fdf6f5;
        border: 1px solid var(--border-subtle);
        text-align: center;
    }

    header nav a:hover {
        background: var(--primary);
        color: #ffffff;
    }

    main section:nth-of-type(2) {
        grid-template-columns: 1fr;
    }

    form input,
    form select {
        max-width: 100%;
    }
}
