@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600&family=DM+Mono:wght@400;500&display=swap');

:root {
    --sidebar-w: 260px;
    --sidebar-mini: 68px;
    --accent: #0F7B6C;
    --accent-light: #E6F5F2;
    --accent-mid: #1AA090;
    --accent-dark: #085048;
    --bg-page: #F0F2F5;
    --bg-white: #FFFFFF;
    --bg-surface: #F8F9FA;
    --text-primary: #1A1D23;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    --border: rgba(0,0,0,0.07);
    --border-md: rgba(0,0,0,0.12);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.1), 0 4px 10px rgba(0,0,0,0.05);
    --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-page);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ── SIDEBAR ──────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--accent-dark);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    color: #fff;
    padding: 0;
    transition: var(--transition);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: visible;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
}

.sidebar.minimized {
    width: var(--sidebar-mini);
}

/* Wrapper dalam sidebar agar scroll/clip bekerja tapi toggle-btn bisa keluar */
.sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    width: 100%;
    position: relative;
}

/* Logo — penuh lebar sidebar, seperti desain asli */
.sidebar .logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
    background: rgba(0,0,0,0.18);
    min-height: 110px;
    width: 100%;
    box-sizing: border-box;
}

.sidebar .logo img {
    width: calc(100% - 20px);
    max-width: 230px;
    height: auto;
    max-height: 90px;
    object-fit: contain;
    display: block;
    transition: var(--transition);
}

.sidebar.minimized .logo {
    padding: 10px 6px;
    min-height: 60px;
}

.sidebar.minimized .logo img {
    width: calc(100% - 12px);
    max-width: 46px;
    max-height: 46px;
}

.sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 0 20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.sidebar-scroll::-webkit-scrollbar { width: 4px; }
.sidebar-scroll::-webkit-scrollbar-track { background: transparent; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; }

.sidebar ul {
    list-style: none;
    padding: 0 10px;
}

.sidebar-section-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
    padding: 12px 10px 4px;
    white-space: nowrap;
    overflow: hidden;
    transition: var(--transition);
}

.sidebar.minimized .sidebar-section-label {
    opacity: 0;
}

.sidebar ul li {
    position: relative;
    margin-bottom: 2px;
}

.sidebar ul li > a {
    color: rgba(255,255,255,0.72);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: var(--radius-md);
    transition: var(--transition);
    white-space: nowrap;
    overflow: hidden;
    font-size: 13.5px;
    font-weight: 400;
}

.sidebar ul li > a:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.sidebar ul li > a.active,
.sidebar ul li.active > a {
    background: rgba(255,255,255,0.13);
    color: #fff;
    font-weight: 500;
}

.sidebar .icon {
    font-style: normal;
    font-size: 16px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.08);
    transition: var(--transition);
}

.sidebar ul li > a:hover .icon,
.sidebar ul li.active > a .icon {
    background: rgba(255,255,255,0.15);
}

.sidebar ul li a span {
    transition: var(--transition);
    overflow: hidden;
}

.sidebar.minimized ul li a span {
    display: none;
}

.sidebar.minimized ul li a {
    justify-content: center;
    padding: 9px 0;
}

/* Submenu */
.sidebar ul li ul {
    padding-left: 14px;
    display: none;
    overflow: hidden;
    padding-top: 2px;
}

.sidebar ul li.active > ul {
    display: block;
}

.sidebar ul li ul li a {
    font-size: 12.5px;
    padding: 7px 10px;
    color: rgba(255,255,255,0.6);
}

.sidebar ul li ul li a:hover {
    color: #fff;
    background: rgba(255,255,255,0.06);
}

/* Toggle button — melayang keluar di pojok kanan sidebar */
/* Toggle expand button — berada di tepi kanan sidebar, di antara sidebar dan konten */
.toggle-btn {
    position: absolute;
    top: 50%;
    right: -14px;
    transform: translateY(-50%);
    z-index: 1002;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-white);
    border: 2px solid var(--border-md);
    color: var(--accent);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: var(--transition);
    line-height: 1;
}

.toggle-btn:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transform: translateY(-50%) scale(1.1);
}

/* Ikon panah rotate saat minimized */
.toggle-btn .toggle-icon {
    display: inline-block;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.minimized .toggle-btn .toggle-icon {
    transform: rotate(180deg);
}

/* ── MAIN CONTENT ────────────────────────────────────── */
.main-content {
    margin-left: calc(var(--sidebar-w) + 1px);
    transition: var(--transition);
    min-height: 100vh;
    padding-bottom: 70px;
}

.main-content.minimized {
    margin-left: calc(var(--sidebar-mini) + 1px);
}

/* ── HEADER ──────────────────────────────────────────── */
.header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    background: var(--bg-white);
    padding: 12px 24px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header .user-info span {
    font-size: 13px;
    color: var(--text-secondary);
}

.header .user-info span u {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
    background: var(--accent-light);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
}

.header .user-info img {
    width: 36px !important;
    height: 36px !important;
    border-radius: 50%;
    border: 2px solid var(--accent) !important;
    object-fit: cover;
}

.dropdown {
    position: relative;
    cursor: pointer;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: var(--bg-white);
    min-width: 180px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    z-index: 200;
}

.dropdown-content a {
    display: block;
    padding: 10px 16px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 13px;
    transition: var(--transition);
}

.dropdown-content a:hover {
    background: var(--bg-surface);
    color: var(--accent);
}

.dropdown:hover .dropdown-content {
    display: block;
    animation: dropIn 0.15s ease;
}

@keyframes dropIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── NAVBAR ──────────────────────────────────────────── */
.navbar {
    background: var(--bg-white);
    padding: 14px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--accent) !important;
    letter-spacing: -0.3px;
}

/* ── CONTENT AREA ────────────────────────────────────── */
.content {
    padding: 24px;
}

.main {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    border: 1px solid var(--border);
    min-height: 400px;
}

/* ── SEARCH ──────────────────────────────────────────── */
.search-container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.search-input {
    height: 34px;
    padding: 0 12px;
    border: 1px solid var(--border-md);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-surface);
    width: 44px;
    transition: var(--transition);
    outline: none;
}

.search-input:focus {
    border-color: var(--accent);
    width: 240px;
    background: var(--bg-white);
    box-shadow: 0 0 0 3px rgba(15,123,108,0.1);
}

.search-button {
    height: 34px;
    padding: 0 14px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.02em;
}

.search-button:hover {
    background: var(--accent-dark);
}

/* ── TABLE ───────────────────────────────────────────── */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
    font-size: 13.5px;
}

table th,
table td {
    padding: 11px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

table th {
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 11.5px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    position: relative;
    border-bottom: 2px solid var(--border-md);
}

table th a {
    color: var(--text-muted);
    text-decoration: none;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

table tbody tr {
    transition: background 0.12s;
}

table tbody tr:hover {
    background: var(--accent-light);
}

table tbody tr:last-child td {
    border-bottom: none;
}

/* ── BUTTONS ─────────────────────────────────────────── */
.button,
button {
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 13px;
    transition: var(--transition);
    text-decoration: none;
}

.button:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15,123,108,0.3);
}

.btn-edit {
    display: inline-flex;
    align-items: center;
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 6px 12px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-family: inherit;
    font-weight: 500;
    transition: var(--transition);
}

.btn-edit:hover {
    background: var(--accent-dark);
}

.btn-delete {
    display: inline-flex;
    align-items: center;
    background: #FEE2E2;
    color: #B91C1C;
    border: none;
    padding: 6px 12px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-family: inherit;
    font-weight: 500;
    transition: var(--transition);
}

.btn-delete:hover {
    background: #B91C1C;
    color: #fff;
}

.btn-print {
    display: inline-flex;
    align-items: center;
    background: #EFF6FF;
    color: #1D4ED8;
    border: none;
    padding: 6px 12px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-family: inherit;
    font-weight: 500;
    transition: var(--transition);
}

.btn-print:hover {
    background: #1D4ED8;
    color: #fff;
}

/* ── FORM ────────────────────────────────────────────── */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 13px;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 60%;
    padding: 9px 12px;
    border: 1px solid var(--border-md);
    border-radius: var(--radius-md);
    font-size: 13.5px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-white);
    transition: var(--transition);
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(15,123,108,0.1);
}

.form-group button {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-weight: 500;
    font-size: 13.5px;
    transition: var(--transition);
}

.form-group button:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15,123,108,0.3);
}

/* ── CARDS ───────────────────────────────────────────── */
.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.card {
    background: var(--bg-white);
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    width: auto !important;
    margin: 0 !important;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--accent);
}

.card h3 {
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

/* ── MODAL ───────────────────────────────────────────── */
.modal {
    display: none;
    position: fixed;
    z-index: 1500;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeInOverlay 0.2s ease;
}

@keyframes fadeInOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--bg-white);
    margin: 8% auto;
    padding: 28px;
    border-radius: var(--radius-lg);
    width: 42%;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.close-modal {
    color: var(--text-muted);
    float: right;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    transition: color 0.15s;
}

.close-modal:hover { color: var(--text-primary); }

/* ── FORM POPUP ──────────────────────────────────────── */
.form-popup {
    display: none;
    position: fixed;
    z-index: 9;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
}

.form-popup-content {
    position: relative;
    background: var(--bg-white);
    margin: auto;
    top: 8%;
    max-width: 620px;
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.close {
    position: absolute;
    right: 18px;
    top: 18px;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.close:hover {
    background: #FEE2E2;
    color: #B91C1C;
}

.form-container {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.left-column, .right-column {
    width: calc(50% - 8px);
    display: flex;
    flex-direction: column;
}

.left-column label, .right-column label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 12.5px;
    margin-top: 12px;
    margin-bottom: 5px;
}

.textarea {
    resize: vertical;
    min-height: 80px;
    border: 1px solid var(--border-md);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    font-family: inherit;
    font-size: 13.5px;
    transition: var(--transition);
    outline: none;
}

.textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(15,123,108,0.1);
}

.form-button {
    text-align: center;
    margin-top: 24px;
}

.form-button button {
    padding: 11px 28px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    font-size: 14px;
    transition: var(--transition);
}

.form-button button:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(15,123,108,0.35);
}

/* ── PAGINATION ──────────────────────────────────────── */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    text-decoration: none;
    color: var(--text-secondary);
    border: 1px solid var(--border-md);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
    background: var(--bg-white);
}

.pagination a:hover {
    background: var(--accent-light);
    color: var(--accent);
    border-color: var(--accent);
}

.pagination a.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ── BREADCRUMBS ─────────────────────────────────────── */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 20px;
    font-size: 12.5px;
    color: var(--text-muted);
}

.breadcrumbs a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}

.breadcrumbs a:hover { color: var(--accent-dark); }

.breadcrumbs a::after {
    content: '/';
    margin-left: 6px;
    color: var(--text-muted);
    font-weight: 400;
}

.breadcrumbs a:last-child::after { content: ''; }

/* ── FOOTER ──────────────────────────────────────────── */
.footer {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-white);
    border-top: 1px solid var(--border);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px;
    z-index: 50;
    transition: var(--transition);
}

.footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

/* ── USER LEVEL BADGE ────────────────────────────────── */
.level-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
}

/* ── BTN ADD USER ────────────────────────────────────── */
.btn-add-user {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 20px;
    padding: 9px 18px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    font-size: 13.5px;
    transition: var(--transition);
}

.btn-add-user:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15,123,108,0.3);
}

/* ── GENERAL INPUTS ──────────────────────────────────── */
input, select, textarea {
    font-family: 'Plus Jakarta Sans', sans-serif;
}

#searchInput {
    padding: 8px 12px;
    font-size: 13px;
    border: 1px solid var(--border-md);
    border-radius: var(--radius-md);
    width: 220px;
    outline: none;
    transition: var(--transition);
    font-family: inherit;
}

#searchInput:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(15,123,108,0.1);
}

/* ── ALERT / NOTIFICATION ────────────────────────────── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    margin-bottom: 16px;
    border-left: 3px solid;
}

.alert-success { background: #F0FDF4; color: #15803D; border-color: #16A34A; }
.alert-error   { background: #FEF2F2; color: #B91C1C; border-color: #DC2626; }
.alert-info    { background: #EFF6FF; color: #1D4ED8; border-color: #2563EB; }
.alert-warning { background: #FFFBEB; color: #B45309; border-color: #D97706; }

/* ── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar {
        width: 260px;
        transform: translateX(-100%);
        box-shadow: none;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0,0,0,0.2);
    }

    .sidebar.minimized {
        width: 0;
        transform: translateX(-100%);
    }

    .main-content {
        margin-left: 0 !important;
    }

    .main-content.minimized {
        margin-left: 0 !important;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        width: 100%;
    }

    .left-column,
    .right-column {
        width: 100%;
    }

    .modal-content {
        width: 90%;
        margin: 20% auto;
    }

    .content {
        padding: 16px;
    }

    /* Di mobile, toggle-btn disembunyikan — sidebar dibuka lewat swipe overlay */
    .toggle-btn {
        display: none;
    }
}