body {
    margin: 0;
    font-family: Arial;
    background: linear-gradient(135deg, #1b5e20, #66bb6a);
}

.container {
    max-width: 900px;
    margin: auto;
    padding: 30px;
    animation: fadeIn 1s ease;
}

h1 {
    color: #fff;
    text-align: center;
    margin-bottom: 30px;
}

.card {
    background: #e8f5e9;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    animation: slideUp 0.7s ease;
}

/* Inputs and selects: full-width form controls */
input, select {
    padding: 10px;
    margin: 6px 0 12px 0;
    width: 100%;
    border: 1px solid #bde7c1;
    border-radius: 10px;
    box-sizing: border-box;
    background: white;
    font-size: 14px;
    height: 44px;
}

/* Buttons: not full-width by default; row layout will handle sizing */
button {
    padding: 10px 14px;
    margin: 6px 6px 0 0;
    border: none;
    border-radius: 10px;
    background: #2e7d32;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: 0.18s ease;
    height: 44px;
}

button:hover { transform: translateY(-1px); opacity: 0.95; }

table {
    width: 100%;
    border-collapse: collapse;
}

/* Table wrapper allows horizontal scrolling on small viewports */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrapper table { min-width: 720px; }

th, td {
    padding: 10px;
    background: #c8e6c9;
    text-align: center;
    border-radius: 6px;
}

.hasil {
    background: #a5d6a7;
    padding: 15px;
    border-radius: 12px;
    margin-top: 10px;
    font-size: 18px;
}

@keyframes fadeIn {
    from {opacity: 0;}
    to {opacity: 1;}
}

@keyframes slideUp {
    from {transform: translateY(20px); opacity: 0;}
    to {transform: translateY(0); opacity: 1;}
}
.layout {
    display: block;
    min-height: 100vh;
}

/* Top navigation bar (replaces sidebar) */
.topnav{
    position: sticky;
    top: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    background: linear-gradient(90deg,#165c2c,#2e7d32);
    color: #fff;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}
.topnav h2 { margin: 0; font-size: 18px; color: #fff; }
.topnav-actions { display: flex; gap: 8px; align-items: center; }
.topnav-actions button{ background: rgba(255,255,255,0.08); color: #fff; border-radius:8px; padding:8px 10px; height:40px; }

/* Ensure the toggle is positioned relative to topnav on small screens */
.sidebar-toggle { left: 8px; top: 8px; }

.container {
    flex: 1;
}

@keyframes slideIn {
    from { transform: translateX(-50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Use single background gradient to avoid conflicting rules */
/* (previous duplicate 'body' rule removed to fix mobile gradient issues) */
body{
    background: linear-gradient(135deg, #a5d6a7, #2e7d32);
}

.container{
    background: transparent;
}

/* Responsive adjustments */
@media (max-width: 900px){
    .container { padding: 18px; }
    .card { padding: 16px; }
}

@media (max-width: 760px){
    /* stack sidebar above content */
    .layout { flex-direction: column; }
    /* show topnav on small screens; when .visible it becomes an overlay column */
    .topnav { display: flex; }
    .topnav.visible { display: flex; position: fixed; left: 0; top: 0; right: 0; z-index: 1250; flex-direction: column; padding: 12px; }
    /* hide sidebar by default on small screens; toggle will add .visible */
    .sidebar { display: none; width: 100%; box-shadow: none; border-bottom: 1px solid rgba(0,0,0,0.06); }
    .sidebar.visible { display: block; position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 1200; overflow:auto; box-shadow: 6px 0 30px rgba(0,0,0,0.28); }
    /* prevent body scroll when sidebar open */
    body.no-scroll { overflow: hidden; }
    /* sidebar toggle button visible */
    .sidebar-toggle { display: inline-flex; }
    .sidebar h2 { font-size: 18px; }
    .container { max-width: 100%; padding: 12px; }
    /* reduce card spacing on small screens */
    .card { margin-bottom: 12px; }
    /* make the table horizontally scrollable and readable */
    .table-wrapper table { min-width: 640px; }
}

@media (max-width: 420px){
    /* compact spacing on very small phones */
    input, select, button { height: 40px; padding: 8px 10px; font-size: 14px; }
    #judulHPP { height: 40px; }
    .sidebar { padding: 12px; }
    .sidebar button { height: 40px; padding: 8px 10px; }
    .card { padding: 12px; }
    .table-wrapper table { min-width: 560px; }
}

.judul-box{
    background:#e8f5e9;
    padding:15px;
    border-radius:15px;
    margin-bottom:20px;
    border-left:6px solid #2e7d32;
}

.judul-box label{
    font-weight:bold;
    color:#1b5e20;
    margin-bottom:5px;
    display:block;
}

#judulHPP{
    width:100%;
    padding:10px;
    border-radius:10px;
    border:1px solid #66bb6a;
    outline:none;
}

/* Row utility for side-by-side buttons */
.row{
    display:flex;
    gap:10px;
    margin-top:8px;
}
.row button{ flex:1; }

/* ensure judul input matches other form inputs */
.judul-box input{ box-sizing: border-box; height:44px; }


/* CARD KOLEKSI */
.card.koleksi{
    background: rgba(255,255,255,0.95);
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    border-left: 8px solid #1b5e20;
    transition: 0.4s;
}

.card.koleksi:hover{
    transform: translateY(-5px) scale(1.02);
}

/*koleksi */
.card.koleksi h3{
    color: #1b5e20;
    font-size: 20px;
}

.grid{
    display:grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap:20px;
    padding-bottom: 40px;
}


.card.koleksi button{
    background: linear-gradient(135deg, #66bb6a, #1b5e20);
    color:white;
    border:none;
    padding:8px 15px;
    border-radius:10px;
    margin-top:10px;
    cursor:pointer;
}

/* Sidebar toggle (hamburger) */
.sidebar-toggle{
    display:none; /* shown on small screens via media query */
    position: fixed;
    left: 12px;
    top: 12px;
    z-index: 1300;
    background: #1b5e20;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 18px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.18);
}