:root {
    --ink: #22261f;
    --ink-soft: #5b6154;
    --paper: #fbfaf6;
    --card: #ffffff;
    --line: #dcdccf;
    --accent: #3b6d11;
    --accent-soft: #eaf3de;
    --warn: #a32d2d;
    --warn-soft: #fcebeb;
    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
    line-height: 1.5;
    padding-top: 80px; /* Padding agar konten tidak tertutup fixed navbar */
}

.wrap {
    max-width: 780px;
    margin: 0 auto;
    padding: 32px 20px 60px;
}

.eyebrow {
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin: 0 0 4px;
}

h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 24px;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
}

.field {
    margin-bottom: 16px;
}

.field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--ink-soft);
}

.field input[type=text],
.field input[type=password],
.field input[type=date],
.field input[type=number],
.field select,
.field textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 14px;
    color: var(--ink);
    background: var(--paper);
}

.field textarea { min-height: 64px; resize: vertical; }

.row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin-bottom: 8px;
}

thead th {
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--ink-soft);
    border-bottom: 1px solid var(--line);
    padding: 8px 8px;
}

tbody td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

tbody td input[type=number] {
    width: 90px;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 6px;
}

/* Fix CSS untuk input type text di dalam tabel */
tbody td input[type=text] {
    width: 100%;
    min-width: 200px;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 14px;
    color: var(--ink);
    background: var(--paper);
    font-family: inherit;
}

tbody td input[type=text]:focus {
    outline: none;
    border-color: var(--accent);
}

.muted { color: var(--ink-soft); }

.btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 11px 22px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.btn:hover { opacity: 0.92; }

.btn-secondary {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--line);
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
}

.alert-success {
    background: var(--accent-soft);
    color: #27500a;
    border: 1px solid #c0dd97;
}

.alert-error {
    background: var(--warn-soft);
    color: #791f1f;
    border: 1px solid #f0a5a5;
}

.badge {
    display: inline-block;
    font-size: 12px;
    padding: 3px 9px;
    border-radius: 999px;
    font-weight: 600;
}

.badge-open      { background: #fdf3d8; color: #854f0b; }
.badge-partial   { background: #e6f1fb; color: #0c447c; }
.badge-completed { background: var(--accent-soft); color: #27500a; }

.badge-active    { background: var(--accent-soft); color: #27500a; }
.badge-inactive  { background: #f1efe8; color: #5f5e5a; }

.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}
.inline-form .field { margin-bottom: 0; flex: 1; min-width: 140px; }
.inline-form .btn { height: 38px; }

.action-link { font-size: 13px; color: var(--ink-soft); text-decoration: none; }
.action-link:hover { color: var(--warn); }
.action-link.is-active-link:hover { color: var(--accent); }

.list-link {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}
.list-link:hover { text-decoration: underline; }

.pack-preview {
    display: block;
    font-size: 11px;
    color: var(--accent);
    margin-top: 4px;
    min-height: 14px;
}

.preview-overlay {
    position: fixed;
    inset: 0;
    background: rgba(34, 38, 31, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 50;
}

.preview-modal {
    background: var(--card);
    border-radius: var(--radius);
    padding: 24px;
    max-width: 520px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}

.preview-modal h2 {
    font-size: 18px;
    margin: 0 0 4px;
}

.preview-modal table {
    margin-top: 12px;
}

.row-issue td {
    background: var(--warn-soft);
}

.issue-note {
    font-size: 12px;
    color: var(--warn);
    padding-top: 0 !important;
}

.tag-rounded {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: #854f0b;
    background: #fdf3d8;
    padding: 1px 6px;
    border-radius: 999px;
}

.preview-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* =========================================================
   STYLE UNTUK NAVBAR (Fixed, Responsif, Warna RGB)
========================================================= */

.navbar-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgb(0, 152, 121);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 1000;
}

.navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 60px;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
}
.nav-logo img {
    height: 32px;
    border-radius: 4px;
}

.nav-menu {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    margin-left: 30px;
}

.nav-links {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    white-space: nowrap;
}

.nav-item {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.nav-item:hover {
    color: #ffffff;
}

.nav-item.is-active {
    color: #ffffff;
    font-weight: 600;
    border-bottom: 2px solid #ffffff;
    padding-bottom: 2px;
}

.nav-sep {
    color: rgba(255, 255, 255, 0.3);
}

.nav-toggle {
    display: none;
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

/* =========================================================
   STYLE UNTUK DROPDOWN MASTER DATA
========================================================= */

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    padding: 10px 0; 
    transition: color 0.2s;
}

.dropdown-toggle:hover {
    color: #ffffff;
}

.dropdown-menu-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    padding-top: 12px; 
    min-width: 180px;
    z-index: 1100;
}

.dropdown-menu-inner {
    background-color: #ffffff;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.15);
    border-radius: 6px;
    padding: 6px 0;
    border: 1px solid var(--line);
}

.dropdown-menu-inner .nav-item {
    color: var(--ink) !important;
    padding: 10px 16px;
    display: block;
    font-size: 14px;
    text-align: left;
    border-bottom: none;
    transition: background 0.2s;
}

.dropdown-menu-inner .nav-item:hover {
    background-color: var(--paper);
    color: rgb(0, 152, 121) !important;
}

.dropdown-menu-inner .nav-item.is-active {
    font-weight: 600;
    background-color: var(--accent-soft);
    color: var(--accent) !important;
    border-bottom: none;
}

.dropdown:hover .dropdown-menu-content {
    display: block;
}

.dropdown-menu-inner::before {
    content: "";
    position: absolute;
    top: 0px; 
    left: 20px;
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent #ffffff transparent;
}


/* =========================================================
   RESPONSIVE UNTUK MOBILE (Layar di bawah 850px)
========================================================= */
@media (max-width: 850px) {
    .nav-toggle {
        display: block;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        align-items: flex-start;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background-color: rgb(0, 152, 121);
        margin-left: 0;
        padding: 15px 20px;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }

    .nav-menu.show {
        display: flex;
    }

    .nav-links {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: 12px;
        margin-bottom: 15px;
    }

    .nav-user {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        border-top: 1px solid rgba(255,255,255,0.1);
        padding-top: 15px;
        gap: 12px;
    }

    .nav-sep {
        display: none;
    }
    
    .dropdown {
        display: block;
        width: 100%;
    }
    
    .dropdown-toggle {
        width: 100%;
        text-align: left;
        padding: 4px 0;
    }

    .dropdown-menu-content {
        display: block;
        position: static;
        box-shadow: none;
        background: transparent;
        border: none;
        padding-top: 0;
        margin-top: 5px;
    }

    .dropdown-menu-inner {
        background: transparent;
        box-shadow: none;
        border: none;
        padding-left: 15px;
    }

    .dropdown-menu-inner::before {
        display: none;
    }

    .dropdown-menu-inner .nav-item {
        color: rgba(255, 255, 255, 0.75) !important;
        padding: 6px 0;
    }
    
    .dropdown-menu-inner .nav-item:hover,
    .dropdown-menu-inner .nav-item.is-active {
        background: transparent;
        color: #ffffff !important;
    }
}