:root {
    --primary: #0f172a;
    --success: #10b981;
    --info: #3b82f6;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg: #f8fafc;
    --border: #e2e8f0;
}

body { 
    font-family: 'Inter', -apple-system, sans-serif; 
    background-color: var(--bg); color: var(--primary); 
    margin: 0; padding: 20px; line-height: 1.5;
}

main { max-width: 1100px; margin: 0 auto; }
h2.title { text-align: center; font-weight: 800; margin-bottom: 30px; }

/* Dashboard Cards */
.card {
    background: white; padding: 24px; border-radius: 12px;
    border: 1px solid var(--border); box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}
.card-header { font-size: 16px; font-weight: 700; margin-bottom: 20px; color: var(--primary); }

/* Form Layouts */
.grid { display: grid; gap: 20px; margin-bottom: 20px; }
.grid-3 { grid-template-columns: 1fr 2fr 1fr; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 13px; font-weight: 600; color: #64748b; }

.input-control {
    border: 1px solid var(--border); border-radius: 8px;
    padding: 10px 12px; font-size: 14px; width: 100%; box-sizing: border-box;
}

/* Custom Dropdown Master Barang */
.master-manager-wrapper { position: relative; margin-top: 5px; }
.dropdown-trigger {
    width: 100%; padding: 10px 15px; background: white; border: 1px solid var(--border);
    border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between;
    align-items: center; font-size: 14px; font-weight: 600; color: #475569;
}
.dropdown-content {
    display: none; position: absolute; top: 105%; left: 0; width: 100%;
    background: white; border: 1px solid var(--border); border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); z-index: 100; padding: 10px; box-sizing: border-box;
}
.dropdown-content.show { display: block; }
.search-master-box {
    padding: 8px; border: 1px solid var(--border); border-radius: 6px;
    width: 100%; margin-bottom: 10px; box-sizing: border-box; outline: none;
}
.master-items-list { max-height: 250px; overflow-y: auto; list-style: none; padding: 0; margin: 0; }
.master-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 12px; border-radius: 6px; border-bottom: 1px solid #f1f5f9;
}
.master-item:hover { background: #f8fafc; }
.btn-del-master {
    background: #fee2e2; color: var(--danger); padding: 4px 10px;
    font-size: 11px; font-weight: 700; text-decoration: none; border-radius: 4px;
}

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px; padding: 10px 20px; font-size: 14px; font-weight: 600;
    border-radius: 8px; cursor: pointer; border: none; text-decoration: none; transition: 0.2s;
}
.btn-success { background: var(--success); color: white; }
.btn-info { background: var(--info); color: white; }
.btn-danger { background: #fee2e2; color: var(--danger); }
.btn-outline { border: 1px solid var(--border); background: white; color: var(--primary); }

/* Tables */
.table-container { overflow-x: auto; border-radius: 12px; border: 1px solid var(--border); background: white; }
table { width: 100%; border-collapse: collapse; text-align: left; }
thead th { background: #f8fafc; padding: 12px; font-size: 11px; border: 1px solid var(--border); text-transform: uppercase; text-align: center; }
.sub-th { background: #f1f5f9; font-size: 10px; }
tbody td { padding: 12px; font-size: 14px; border: 1px solid var(--border); }

/* Modal */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.6); display: none;
    align-items: center; justify-content: center; z-index: 9999; backdrop-filter: blur(4px);
}
.modal-overlay.active { display: flex; }
.modal-content {
    background: white; padding: 30px; border-radius: 16px;
    text-align: center; max-width: 320px; width: 90%;
}
.modal-icon {
    width: 50px; height: 50px; background: #ecfdf5; color: var(--success);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 24px; margin: 0 auto 15px;
}

.edit-mode { border: 2px solid var(--warning); background: #fffcf0; }
.controls-row { display: flex; justify-content: space-between; margin-bottom: 15px; align-items: center; }